Removed util.

This commit is contained in:
Alan Jeffrey 2016-12-14 10:37:58 -06:00
parent 01b6ad55bd
commit 9be4fd56ce
133 changed files with 396 additions and 352 deletions

View file

@ -50,12 +50,12 @@ selectors = "0.15"
serde = {version = "0.8", optional = true}
serde_derive = {version = "0.8", optional = true}
servo_atoms = {path = "../atoms", optional = true}
servo_config = {path = "../config"}
smallvec = "0.1"
style_traits = {path = "../style_traits"}
servo_url = {path = "../url"}
time = "0.1"
unicode-segmentation = "0.1.2"
util = {path = "../util"}
plugins = {path = "../plugins", optional = true}
[dependencies.num_cpus]

View file

@ -80,6 +80,7 @@ extern crate selectors;
extern crate serde;
#[cfg(feature = "servo")] #[macro_use] extern crate serde_derive;
#[cfg(feature = "servo")] #[macro_use] extern crate servo_atoms;
extern crate servo_config;
extern crate servo_url;
extern crate smallvec;
#[macro_use]
@ -87,7 +88,6 @@ extern crate style_traits;
extern crate time;
#[allow(unused_extern_crates)]
extern crate unicode_segmentation;
extern crate util;
pub mod animation;
pub mod atomic_refcell;

View file

@ -21,13 +21,13 @@ use selector_parser::{PseudoElement, RestyleDamage, SelectorImpl};
use selectors::MatchAttr;
use selectors::bloom::BloomFilter;
use selectors::matching::{AFFECTED_BY_PSEUDO_ELEMENTS, MatchingReason, StyleRelations};
use servo_config::opts;
use sink::ForgetfulSink;
use std::collections::HashMap;
use std::hash::BuildHasherDefault;
use std::slice::IterMut;
use std::sync::Arc;
use stylist::ApplicableDeclarationBlock;
use util::opts;
fn create_common_style_affecting_attributes_from_element<E: TElement>(element: &E)
-> CommonStyleAffectingAttributes {

View file

@ -8,10 +8,10 @@
use dom::{OpaqueNode, TElement, TNode, UnsafeNode};
use rayon;
use servo_config::opts;
use std::sync::atomic::Ordering;
use traversal::{DomTraversalContext, PerLevelTraversalData, PreTraverseToken};
use traversal::{STYLE_SHARING_CACHE_HITS, STYLE_SHARING_CACHE_MISSES};
use util::opts;
pub const CHUNK_SIZE: usize = 64;

View file

@ -28,6 +28,7 @@ use font_metrics::FontMetricsProvider;
#[cfg(feature = "servo")] use logical_geometry::{LogicalMargin, PhysicalSide};
use logical_geometry::WritingMode;
use parser::{Parse, ParserContext, ParserContextExtraData};
#[cfg(feature = "servo")] use servo_config::prefs::PREFS;
use servo_url::ServoUrl;
use style_traits::ToCss;
use stylesheets::Origin;
@ -846,7 +847,7 @@ impl PropertyDeclaration {
}
% endif
% if property.experimental and product == "servo":
if !::util::prefs::PREFS.get("${property.experimental}")
if !PREFS.get("${property.experimental}")
.as_boolean().unwrap_or(false) {
return PropertyDeclarationParseResult::ExperimentalProperty
}
@ -878,7 +879,7 @@ impl PropertyDeclaration {
}
% endif
% if shorthand.experimental and product == "servo":
if !::util::prefs::PREFS.get("${shorthand.experimental}")
if !PREFS.get("${shorthand.experimental}")
.as_boolean().unwrap_or(false) {
return PropertyDeclarationParseResult::ExperimentalProperty
}

View file

@ -18,6 +18,7 @@ use parser::{ParserContext, ParserContextExtraData, log_css_error};
use properties::{PropertyDeclarationBlock, parse_property_declaration_list};
use selector_parser::{SelectorImpl, SelectorParser};
use selectors::parser::SelectorList;
use servo_config::prefs::PREFS;
use servo_url::ServoUrl;
use std::cell::Cell;
use std::fmt;
@ -723,7 +724,7 @@ impl<'a, 'b> AtRuleParser for NestedRuleParser<'a, 'b> {
Ok(AtRuleType::WithBlock(AtRulePrelude::FontFace))
},
"viewport" => {
if ::util::prefs::PREFS.get("layout.viewport.enabled").as_boolean().unwrap_or(false) ||
if PREFS.get("layout.viewport.enabled").as_boolean().unwrap_or(false) ||
cfg!(feature = "gecko") {
Ok(AtRuleType::WithBlock(AtRulePrelude::Viewport))
} else {

View file

@ -14,12 +14,12 @@ use restyle_hints::{RESTYLE_DESCENDANTS, RESTYLE_SELF};
use selector_parser::RestyleDamage;
use selectors::Element;
use selectors::matching::StyleRelations;
use servo_config::opts;
use std::borrow::Borrow;
use std::cell::RefCell;
use std::mem;
use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
use stylist::Stylist;
use util::opts;
/// Every time we do another layout, the old bloom filters are invalid. This is
/// detected by ticking a generation number every layout.