Reorder imports

This commit is contained in:
Pyfisch 2018-11-06 20:38:02 +01:00
parent 4a947dd719
commit 9e92eb205a
546 changed files with 1968 additions and 1536 deletions

View file

@ -8,15 +8,14 @@
// compile it out so that people remember it exists, thus the cfg'd Sender
// import.
use Atom;
use bezier::Bezier;
use context::SharedStyleContext;
use dom::{OpaqueNode, TElement};
use font_metrics::FontMetricsProvider;
use properties::{self, CascadeMode, ComputedValues, LonghandId};
use properties::animated_properties::AnimatedProperty;
use properties::longhands::animation_direction::computed_value::single_value::T as AnimationDirection;
use properties::longhands::animation_play_state::computed_value::single_value::T as AnimationPlayState;
use properties::{self, CascadeMode, ComputedValues, LonghandId};
use rule_tree::CascadeLevel;
use servo_arc::Arc;
#[cfg(feature = "servo")]
@ -26,11 +25,12 @@ use std::fmt;
use std::sync::mpsc::Sender;
use stylesheets::keyframes_rule::{KeyframesAnimation, KeyframesStep, KeyframesStepValue};
use timer::Timer;
use values::computed::box_::TransitionProperty;
use values::computed::Time;
use values::computed::TimingFunction;
use values::computed::box_::TransitionProperty;
use values::generics::box_::AnimationIterationCount;
use values::generics::easing::{StepPosition, TimingFunction as GenericTimingFunction};
use Atom;
/// This structure represents a keyframes animation current iteration state.
///

View file

@ -6,7 +6,6 @@
//!
//! [attr]: https://dom.spec.whatwg.org/#interface-attr
use {Atom, LocalName, Namespace, Prefix};
use app_units::Au;
use cssparser::{self, Color, RGBA};
use euclid::num::Zero;
@ -17,10 +16,11 @@ use servo_arc::Arc;
use servo_url::ServoUrl;
use shared_lock::Locked;
use std::str::FromStr;
use str::str_join;
use str::{read_exponent, read_fraction, HTML_SPACE_CHARACTERS};
use str::{read_numbers, split_commas, split_html_space_chars};
use str::str_join;
use values::specified::Length;
use {Atom, LocalName, Namespace, Prefix};
// Duplicated from script::dom::values.
const UNSIGNED_LONG_MAX: u32 = 2147483647;

View file

@ -14,6 +14,8 @@ mod common {
#[cfg(feature = "bindgen")]
mod bindings {
use super::super::PYTHON;
use super::common::*;
use bindgen::{Builder, CodegenConfig};
use regex::Regex;
use std::cmp;
@ -26,8 +28,6 @@ mod bindings {
use std::slice;
use std::sync::Mutex;
use std::time::SystemTime;
use super::common::*;
use super::super::PYTHON;
use toml;
use toml::value::Table;
@ -606,9 +606,9 @@ mod bindings {
#[cfg(not(feature = "bindgen"))]
mod bindings {
use std::{env, fs, io};
use std::path::{Path, PathBuf};
use super::common::*;
use std::path::{Path, PathBuf};
use std::{env, fs, io};
/// Copy contents of one directory into another.
/// It currently only does a shallow copy.

View file

@ -9,9 +9,9 @@ use animation::Animation;
use app_units::Au;
use bloom::StyleBloom;
use data::{EagerPseudoStyles, ElementData};
use dom::{SendElement, TElement};
#[cfg(feature = "servo")]
use dom::OpaqueNode;
use dom::{SendElement, TElement};
use euclid::Size2D;
use euclid::TypedScale;
use font_metrics::FontMetricsProvider;
@ -27,8 +27,8 @@ use properties::PropertyId;
use rule_cache::RuleCache;
use rule_tree::StrongRuleNode;
use selector_parser::{SnapshotMap, EAGER_PSEUDO_COUNT};
use selectors::NthIndexCache;
use selectors::matching::ElementSelectorFlags;
use selectors::NthIndexCache;
use servo_arc::Arc;
#[cfg(feature = "servo")]
use servo_atoms::Atom;

View file

@ -6,7 +6,6 @@
//!
//! [counter-style]: https://drafts.csswg.org/css-counter-styles/
use Atom;
use cssparser::{AtRuleParser, DeclarationListParser, DeclarationParser};
use cssparser::{CowRcStr, Parser, SourceLocation, Token};
use error_reporting::ContextualParseError;
@ -20,8 +19,9 @@ use std::ops::Range;
use str::CssStringWriter;
use style_traits::{Comma, CssWriter, OneOrMoreSeparated, ParseError};
use style_traits::{StyleParseErrorKind, ToCss};
use values::CustomIdent;
use values::specified::Integer;
use values::CustomIdent;
use Atom;
/// Parse a counter style name reference.
///

View file

@ -6,7 +6,6 @@
//!
//! [custom]: https://drafts.csswg.org/css-variables/
use Atom;
use cssparser::{Delimiter, Parser, ParserInput, SourcePosition, Token, TokenSerializationType};
use hash::map::Entry;
use precomputed_hash::PrecomputedHash;
@ -20,6 +19,7 @@ use std::cmp;
use std::fmt::{self, Write};
use std::hash::Hash;
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
use Atom;
/// The environment from which to get `env` function values.
///

View file

@ -7,7 +7,6 @@
#![allow(unsafe_code)]
#![deny(missing_docs)]
use {Atom, LocalName, Namespace, WeakAtom};
use applicable_declarations::ApplicableDeclarationBlock;
use atomic_refcell::{AtomicRef, AtomicRefCell, AtomicRefMut};
#[cfg(feature = "gecko")]
@ -20,9 +19,9 @@ use font_metrics::FontMetricsProvider;
use media_queries::Device;
use properties::{AnimationRules, ComputedValues, PropertyDeclarationBlock};
use selector_parser::{AttrValue, Lang, PseudoElement, SelectorImpl};
use selectors::Element as SelectorsElement;
use selectors::matching::{ElementSelectorFlags, QuirksMode, VisitedHandlingMode};
use selectors::sink::Push;
use selectors::Element as SelectorsElement;
use servo_arc::{Arc, ArcBorrow};
use shared_lock::Locked;
use std::fmt;
@ -31,6 +30,7 @@ use std::hash::Hash;
use std::ops::Deref;
use stylist::CascadeData;
use traversal_flags::TraversalFlags;
use {Atom, LocalName, Namespace, WeakAtom};
/// An opaque handle to a node, which, unlike UnsafeNode, cannot be transformed
/// back into a non-opaque representation. The only safe operation that can be

View file

@ -5,17 +5,17 @@
//! Generic implementations of some DOM APIs so they can be shared between Servo
//! and Gecko.
use Atom;
use context::QuirksMode;
use dom::{TDocument, TElement, TNode, TShadowRoot};
use invalidation::element::invalidator::{DescendantInvalidationLists, Invalidation};
use invalidation::element::invalidator::{InvalidationProcessor, InvalidationVector};
use selectors::{Element, NthIndexCache, SelectorList};
use selectors::attr::CaseSensitivity;
use selectors::matching::{self, MatchingContext, MatchingMode};
use selectors::parser::{Combinator, Component, LocalName, SelectorImpl};
use selectors::{Element, NthIndexCache, SelectorList};
use smallvec::SmallVec;
use std::borrow::Borrow;
use Atom;
/// <https://dom.spec.whatwg.org/#dom-element-matches>
pub fn element_matches<E>(

View file

@ -6,10 +6,10 @@
//!
//! [ff]: https://drafts.csswg.org/css-fonts/#at-font-face-rule
use cssparser::{AtRuleParser, DeclarationListParser, DeclarationParser, Parser};
use cssparser::{CowRcStr, SourceLocation};
#[cfg(feature = "gecko")]
use cssparser::UnicodeRange;
use cssparser::{AtRuleParser, DeclarationListParser, DeclarationParser, Parser};
use cssparser::{CowRcStr, SourceLocation};
use error_reporting::ContextualParseError;
use parser::{Parse, ParserContext};
#[cfg(feature = "gecko")]
@ -18,17 +18,17 @@ use selectors::parser::SelectorParseErrorKind;
use shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
use std::fmt::{self, Write};
use str::CssStringWriter;
use style_traits::values::SequenceWriter;
use style_traits::{Comma, CssWriter, OneOrMoreSeparated, ParseError};
use style_traits::{StyleParseErrorKind, ToCss};
use style_traits::values::SequenceWriter;
use values::computed::font::FamilyName;
use values::generics::font::FontStyle as GenericFontStyle;
use values::specified::Angle;
use values::specified::font::SpecifiedFontStyle;
use values::specified::font::{AbsoluteFontWeight, FontStretch};
#[cfg(feature = "gecko")]
use values::specified::font::{SpecifiedFontFeatureSettings, SpecifiedFontVariationSettings};
use values::specified::font::SpecifiedFontStyle;
use values::specified::url::SpecifiedUrl;
use values::specified::Angle;
/// A source for a font-face rule.
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]

View file

@ -6,12 +6,12 @@
#![deny(missing_docs)]
use Atom;
use app_units::Au;
use context::SharedStyleContext;
use logical_geometry::WritingMode;
use media_queries::Device;
use properties::style_structs::Font;
use Atom;
/// Represents the font metrics that style needs from a font to compute the
/// value of certain CSS units like `ex`.

View file

@ -31,16 +31,16 @@ use gecko_bindings::structs::RawServoStyleRule;
use gecko_bindings::structs::RawServoStyleSheetContents;
use gecko_bindings::sugar::ownership::{HasArcFFI, HasFFI, Strong};
use media_queries::MediaList;
use properties::{ComputedValues, PropertyDeclarationBlock};
use properties::animated_properties::AnimationValue;
use properties::{ComputedValues, PropertyDeclarationBlock};
use rule_tree::StrongRuleNode;
use servo_arc::{Arc, ArcBorrow};
use shared_lock::Locked;
use std::{mem, ptr};
use stylesheets::keyframes_rule::Keyframe;
use stylesheets::{CounterStyleRule, CssRules, FontFaceRule, FontFeatureValuesRule};
use stylesheets::{DocumentRule, ImportRule, KeyframesRule, MediaRule, NamespaceRule, PageRule};
use stylesheets::{StyleRule, StylesheetContents, SupportsRule};
use stylesheets::keyframes_rule::Keyframe;
macro_rules! impl_arc_ffi {
($servo_type:ty => $gecko_type:ty[$addref:ident, $release:ident]) => {

View file

@ -12,15 +12,17 @@ use app_units::Au;
use gecko::values::GeckoStyleCoordConvertible;
use gecko_bindings::bindings;
use gecko_bindings::structs::{self, nsStyleCoord_CalcValue};
use gecko_bindings::structs::{nsresult, SheetType, nsStyleImage};
use gecko_bindings::structs::{nsStyleImage, nsresult, SheetType};
use gecko_bindings::sugar::ns_style_coord::{CoordData, CoordDataMut, CoordDataValue};
use std::f32::consts::PI;
use stylesheets::{Origin, RulesMutateError};
use values::computed::{Angle, CalcLengthOrPercentage, Gradient, Image};
use values::computed::{Integer, LengthOrPercentage, LengthOrPercentageOrAuto, NonNegativeLengthOrPercentageOrAuto};
use values::computed::{Percentage, TextAlign};
use values::computed::image::LineDirection;
use values::computed::url::ComputedImageUrl;
use values::computed::{Angle, CalcLengthOrPercentage, Gradient, Image};
use values::computed::{
Integer, LengthOrPercentage, LengthOrPercentageOrAuto, NonNegativeLengthOrPercentageOrAuto,
};
use values::computed::{Percentage, TextAlign};
use values::generics::box_::VerticalAlign;
use values::generics::grid::{TrackListValue, TrackSize};
use values::generics::image::{CompatMode, GradientItem, Image as GenericImage};
@ -233,11 +235,11 @@ impl nsStyleImage {
// FIXME(emilio): This is really complex, we should use cbindgen for this.
fn set_gradient(&mut self, gradient: Gradient) {
use self::structs::nsStyleCoord;
use self::structs::NS_STYLE_GRADIENT_SIZE_CLOSEST_CORNER as CLOSEST_CORNER;
use self::structs::NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE as CLOSEST_SIDE;
use self::structs::NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER as FARTHEST_CORNER;
use self::structs::NS_STYLE_GRADIENT_SIZE_FARTHEST_SIDE as FARTHEST_SIDE;
use self::structs::nsStyleCoord;
use values::generics::image::{Circle, Ellipse, EndingShape, GradientKind, ShapeExtent};
use values::specified::position::{X, Y};
@ -495,9 +497,9 @@ impl nsStyleImage {
use self::structs::NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE as CLOSEST_SIDE;
use self::structs::NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER as FARTHEST_CORNER;
use self::structs::NS_STYLE_GRADIENT_SIZE_FARTHEST_SIDE as FARTHEST_SIDE;
use values::computed::Length;
use values::computed::image::LineDirection;
use values::computed::position::Position;
use values::computed::Length;
use values::generics::image::{Circle, ColorStop, CompatMode, Ellipse};
use values::generics::image::{EndingShape, GradientKind, ShapeExtent};
@ -652,9 +654,9 @@ pub mod basic_shape {
use gecko::values::GeckoStyleCoordConvertible;
use gecko_bindings::structs;
use gecko_bindings::structs::{nsStyleCoord, nsStyleCorners};
use gecko_bindings::structs::{StyleBasicShape, StyleBasicShapeType};
use gecko_bindings::structs::{StyleGeometryBox, StyleShapeSource, StyleShapeSourceType};
use gecko_bindings::structs::{nsStyleCoord, nsStyleCorners};
use gecko_bindings::sugar::ns_style_coord::{CoordDataMut, CoordDataValue};
use gecko_bindings::sugar::refptr::RefPtr;
use std::borrow::Borrow;

View file

@ -8,8 +8,10 @@ use atomic_refcell::{AtomicRef, AtomicRefCell, AtomicRefMut};
use context::QuirksMode;
use dom::TElement;
use gecko_bindings::bindings::{self, RawServoStyleSet};
use gecko_bindings::structs::{RawGeckoPresContextBorrowed, ServoStyleSetSizes, StyleSheet as DomStyleSheet};
use gecko_bindings::structs::{StyleSheetInfo, nsIDocument};
use gecko_bindings::structs::{nsIDocument, StyleSheetInfo};
use gecko_bindings::structs::{
RawGeckoPresContextBorrowed, ServoStyleSetSizes, StyleSheet as DomStyleSheet,
};
use gecko_bindings::sugar::ownership::{HasArcFFI, HasBoxFFI, HasFFI, HasSimpleFFI};
use invalidation::media_queries::{MediaListKey, ToMediaListKey};
use malloc_size_of::MallocSizeOfOps;

View file

@ -5,8 +5,8 @@
//! Global style data
use context::StyleSystemOptions;
use gecko_bindings::bindings::{Gecko_RegisterProfilerThread, Gecko_UnregisterProfilerThread};
use gecko_bindings::bindings::Gecko_SetJemallocThreadLocalArena;
use gecko_bindings::bindings::{Gecko_RegisterProfilerThread, Gecko_UnregisterProfilerThread};
use num_cpus;
use parallel::STYLE_THREAD_STACK_SIZE_KB;
use rayon;

View file

@ -4,17 +4,17 @@
//! Gecko's media feature list and evaluator.
use Atom;
use app_units::Au;
use euclid::Size2D;
use gecko_bindings::bindings;
use gecko_bindings::structs;
use media_queries::Device;
use media_queries::media_feature::{AllowsRanges, ParsingRequirements};
use media_queries::media_feature::{MediaFeatureDescription, Evaluator};
use media_queries::media_feature::{Evaluator, MediaFeatureDescription};
use media_queries::media_feature_expression::{AspectRatio, RangeOrOperator};
use media_queries::Device;
use values::computed::CSSPixelLength;
use values::computed::Resolution;
use Atom;
fn viewport_size(device: &Device) -> Size2D<Au> {
let pc = device.pres_context();

View file

@ -4,8 +4,8 @@
//! Gecko's media-query device and expression representation.
use app_units::AU_PER_PX;
use app_units::Au;
use app_units::AU_PER_PX;
use cssparser::RGBA;
use custom_properties::CssEnvironment;
use euclid::Size2D;
@ -20,10 +20,10 @@ use servo_arc::Arc;
use std::fmt;
use std::sync::atomic::{AtomicBool, AtomicIsize, AtomicUsize, Ordering};
use string_cache::Atom;
use style_traits::{CSSPixel, DevicePixel};
use style_traits::viewport::ViewportConstraints;
use values::{CustomIdent, KeyframesName};
use style_traits::{CSSPixel, DevicePixel};
use values::computed::font::FontSize;
use values::{CustomIdent, KeyframesName};
/// The `Device` in Gecko wraps a pres context, has a default values computed,
/// and contains all the viewport rule state.

View file

@ -10,8 +10,8 @@
use cssparser::ToCss;
use gecko_bindings::structs::{self, CSSPseudoElementType};
use properties::{ComputedValues, PropertyFlags};
use properties::longhands::display::computed_value::T as Display;
use properties::{ComputedValues, PropertyFlags};
use selector_parser::{NonTSPseudoClass, PseudoElementCascadeType, SelectorImpl};
use std::fmt;
use str::{starts_with_ignore_ascii_case, string_as_ascii_lowercase};

View file

@ -12,10 +12,10 @@ use gecko_bindings::structs::RawServoSelectorList;
use gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI};
use invalidation::element::document_state::InvalidationMatchingData;
use selector_parser::{Direction, SelectorParser};
use selectors::SelectorList;
use selectors::parser::{SelectorParseErrorKind, Visit};
use selectors::parser::{self as selector_parser, Selector};
use selectors::parser::{SelectorParseErrorKind, Visit};
use selectors::visitor::SelectorVisitor;
use selectors::SelectorList;
use std::fmt;
use str::starts_with_ignore_ascii_case;
use string_cache::{Atom, Namespace, WeakAtom, WeakNamespace};

View file

@ -5,7 +5,6 @@
//! A gecko snapshot, that stores the element attributes and state before they
//! change in order to properly calculate restyle hints.
use WeakAtom;
use dom::TElement;
use element_state::ElementState;
use gecko::snapshot_helpers;
@ -18,6 +17,7 @@ use invalidation::element::element_wrapper::ElementSnapshot;
use selectors::attr::{AttrSelectorOperation, AttrSelectorOperator};
use selectors::attr::{CaseSensitivity, NamespaceConstraint};
use string_cache::{Atom, Namespace};
use WeakAtom;
/// A snapshot of a Gecko element.
pub type GeckoElementSnapshot = ServoElementSnapshot;

View file

@ -4,11 +4,11 @@
//! Element an snapshot common logic.
use CaseSensitivityExt;
use gecko_bindings::bindings;
use gecko_bindings::structs::{self, nsAtom};
use selectors::attr::CaseSensitivity;
use string_cache::{Atom, WeakAtom};
use CaseSensitivityExt;
/// A function that, given an element of type `T`, allows you to get a single
/// class or a class list.

View file

@ -6,10 +6,10 @@
use cssparser::Parser;
use gecko_bindings::bindings;
use gecko_bindings::structs::root::mozilla::CORSMode;
use gecko_bindings::structs::root::mozilla::css::URLValue;
use gecko_bindings::structs::root::mozilla::CORSMode;
use gecko_bindings::structs::root::nsStyleImageRequest;
use gecko_bindings::sugar::ownership::{HasArcFFI, FFIArcHelpers};
use gecko_bindings::sugar::ownership::{FFIArcHelpers, HasArcFFI};
use gecko_bindings::sugar::refptr::RefPtr;
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
use nsstring::nsCString;

View file

@ -6,30 +6,34 @@
//! Different kind of helpers to interact with Gecko values.
use Atom;
use app_units::Au;
use counter_style::{Symbol, Symbols};
use cssparser::RGBA;
use gecko_bindings::structs::{self, CounterStylePtr, nsStyleCoord};
use gecko_bindings::structs::{self, nsStyleCoord, CounterStylePtr};
use gecko_bindings::structs::{StyleGridTrackBreadth, StyleShapeRadius};
use gecko_bindings::sugar::ns_style_coord::{CoordData, CoordDataMut, CoordDataValue};
use media_queries::Device;
use nsstring::{nsACString, nsCStr};
use std::cmp::max;
use values::{Auto, Either, None_, Normal};
use values::computed::{Angle, ExtremumLength, Length, LengthOrPercentage, LengthOrPercentageOrAuto};
use values::computed::{LengthOrPercentageOrNone, Number, NumberOrPercentage};
use values::computed::{MaxLength as ComputedMaxLength, MozLength as ComputedMozLength, Percentage};
use values::computed::{NonNegativeLength, NonNegativeLengthOrPercentage, NonNegativeNumber};
use values::computed::FlexBasis as ComputedFlexBasis;
use values::computed::basic_shape::ShapeRadius as ComputedShapeRadius;
use values::generics::{CounterStyleOrNone, NonNegative};
use values::computed::FlexBasis as ComputedFlexBasis;
use values::computed::{
Angle, ExtremumLength, Length, LengthOrPercentage, LengthOrPercentageOrAuto,
};
use values::computed::{LengthOrPercentageOrNone, Number, NumberOrPercentage};
use values::computed::{
MaxLength as ComputedMaxLength, MozLength as ComputedMozLength, Percentage,
};
use values::computed::{NonNegativeLength, NonNegativeLengthOrPercentage, NonNegativeNumber};
use values::generics::basic_shape::ShapeRadius;
use values::generics::box_::Perspective;
use values::generics::flex::FlexBasis;
use values::generics::gecko::ScrollSnapPoint;
use values::generics::grid::{TrackBreadth, TrackKeyword};
use values::generics::length::{MaxLength, MozLength};
use values::generics::{CounterStyleOrNone, NonNegative};
use values::{Auto, Either, None_, Normal};
use Atom;
/// A trait that defines an interface to convert from and to `nsStyleCoord`s.
pub trait GeckoStyleCoordConvertible: Sized {
@ -558,8 +562,8 @@ impl CounterStyleOrNone {
/// Convert Gecko CounterStylePtr to CounterStyleOrNone or String.
pub fn from_gecko_value(gecko_value: &CounterStylePtr) -> Either<Self, String> {
use gecko_bindings::bindings;
use values::CustomIdent;
use values::generics::SymbolsType;
use values::CustomIdent;
let name = unsafe { bindings::Gecko_CounterStyle_GetName(gecko_value) };
if !name.is_null() {

View file

@ -14,7 +14,6 @@
//! style system it's kind of pointless in the Stylo case, and only Servo forces
//! the separation between the style system implementation and everything else.
use CaseSensitivityExt;
use app_units::Au;
use applicable_declarations::ApplicableDeclarationBlock;
use atomic_refcell::{AtomicRefCell, AtomicRefMut};
@ -29,9 +28,6 @@ use gecko::global_style_data::GLOBAL_STYLE_DATA;
use gecko::selector_parser::{NonTSPseudoClass, PseudoElement, SelectorImpl};
use gecko::snapshot_helpers;
use gecko_bindings::bindings;
use gecko_bindings::bindings::{Gecko_ElementState, Gecko_GetDocumentLWTheme};
use gecko_bindings::bindings::{Gecko_GetLastChild, Gecko_GetPreviousSibling, Gecko_GetNextStyleChild};
use gecko_bindings::bindings::{Gecko_SetNodeFlags, Gecko_UnsetNodeFlags};
use gecko_bindings::bindings::Gecko_ElementHasAnimations;
use gecko_bindings::bindings::Gecko_ElementHasCSSAnimations;
use gecko_bindings::bindings::Gecko_ElementHasCSSTransitions;
@ -47,35 +43,40 @@ use gecko_bindings::bindings::Gecko_IsSignificantChild;
use gecko_bindings::bindings::Gecko_MatchLang;
use gecko_bindings::bindings::Gecko_UnsetDirtyStyleAttr;
use gecko_bindings::bindings::Gecko_UpdateAnimations;
use gecko_bindings::bindings::{Gecko_ElementState, Gecko_GetDocumentLWTheme};
use gecko_bindings::bindings::{
Gecko_GetLastChild, Gecko_GetNextStyleChild, Gecko_GetPreviousSibling,
};
use gecko_bindings::bindings::{Gecko_SetNodeFlags, Gecko_UnsetNodeFlags};
use gecko_bindings::structs;
use gecko_bindings::structs::{RawGeckoElement, RawGeckoNode, RawGeckoXBLBinding};
use gecko_bindings::structs::{nsAtom, nsIContent, nsINode_BooleanFlag};
use gecko_bindings::structs::nsChangeHint;
use gecko_bindings::structs::nsIDocument_DocumentTheme as DocumentTheme;
use gecko_bindings::structs::nsRestyleHint;
use gecko_bindings::structs::EffectCompositor_CascadeLevel as CascadeLevel;
use gecko_bindings::structs::ELEMENT_HANDLED_SNAPSHOT;
use gecko_bindings::structs::ELEMENT_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO;
use gecko_bindings::structs::ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO;
use gecko_bindings::structs::ELEMENT_HAS_SNAPSHOT;
use gecko_bindings::structs::EffectCompositor_CascadeLevel as CascadeLevel;
use gecko_bindings::structs::NODE_DESCENDANTS_NEED_FRAMES;
use gecko_bindings::structs::NODE_NEEDS_FRAME;
use gecko_bindings::structs::nsChangeHint;
use gecko_bindings::structs::nsIDocument_DocumentTheme as DocumentTheme;
use gecko_bindings::structs::nsRestyleHint;
use gecko_bindings::structs::{nsAtom, nsIContent, nsINode_BooleanFlag};
use gecko_bindings::structs::{RawGeckoElement, RawGeckoNode, RawGeckoXBLBinding};
use gecko_bindings::sugar::ownership::{HasArcFFI, HasSimpleFFI};
use hash::FxHashMap;
use logical_geometry::WritingMode;
use media_queries::Device;
use properties::{ComputedValues, LonghandId};
use properties::{Importance, PropertyDeclaration, PropertyDeclarationBlock};
use properties::animated_properties::{AnimationValue, AnimationValueMap};
use properties::style_structs::Font;
use properties::{ComputedValues, LonghandId};
use properties::{Importance, PropertyDeclaration, PropertyDeclarationBlock};
use rule_tree::CascadeLevel as ServoCascadeLevel;
use selector_parser::{AttrValue, HorizontalDirection, Lang};
use selectors::{Element, OpaqueElement};
use selectors::attr::{AttrSelectorOperation, AttrSelectorOperator};
use selectors::attr::{CaseSensitivity, NamespaceConstraint};
use selectors::matching::{ElementSelectorFlags, MatchingContext};
use selectors::matching::VisitedHandlingMode;
use selectors::matching::{ElementSelectorFlags, MatchingContext};
use selectors::sink::Push;
use selectors::{Element, OpaqueElement};
use servo_arc::{Arc, ArcBorrow, RawOffsetArc};
use shared_lock::Locked;
use std::cell::RefCell;
@ -85,6 +86,7 @@ use std::mem;
use std::ptr;
use string_cache::{Atom, Namespace, WeakAtom, WeakNamespace};
use stylist::CascadeData;
use CaseSensitivityExt;
#[inline]
fn elements_with_id<'a, 'le>(

View file

@ -7,9 +7,9 @@
use gecko_bindings::bindings::Gecko_AddRefCSSShadowArrayArbitraryThread;
use gecko_bindings::bindings::Gecko_NewCSSShadowArray;
use gecko_bindings::bindings::Gecko_ReleaseCSSShadowArrayArbitraryThread;
use gecko_bindings::structs::{RefPtr, nsCSSShadowArray, nsCSSShadowItem};
use std::{ptr, slice};
use gecko_bindings::structs::{nsCSSShadowArray, nsCSSShadowItem, RefPtr};
use std::ops::{Deref, DerefMut};
use std::{ptr, slice};
impl RefPtr<nsCSSShadowArray> {
/// Replaces the current `nsCSSShadowArray` with a new one of len `len`.

View file

@ -6,8 +6,8 @@
use gecko_bindings::bindings::Gecko_EnsureStyleAnimationArrayLength;
use gecko_bindings::bindings::Gecko_EnsureStyleTransitionArrayLength;
use gecko_bindings::structs::{StyleAnimation, StyleTransition};
use gecko_bindings::structs::nsStyleAutoArray;
use gecko_bindings::structs::{StyleAnimation, StyleTransition};
use std::iter::{once, Chain, IntoIterator, Once};
use std::ops::{Index, IndexMut};
use std::slice::{Iter, IterMut};

View file

@ -6,7 +6,7 @@
use gecko_bindings::bindings;
use gecko_bindings::structs::{nsStyleCoord, nsStyleCoord_Calc, nsStyleCoord_CalcValue};
use gecko_bindings::structs::{nscoord, nsStyleCorners, nsStyleSides, nsStyleUnion, nsStyleUnit};
use gecko_bindings::structs::{nsStyleCorners, nsStyleSides, nsStyleUnion, nsStyleUnit, nscoord};
use std::mem;
impl nsStyleCoord {
@ -277,8 +277,8 @@ pub unsafe trait CoordDataMut: CoordData {
#[inline(always)]
/// Sets the inner value.
fn set_value(&mut self, value: CoordDataValue) {
use gecko_bindings::structs::nsStyleUnit::*;
use self::CoordDataValue::*;
use gecko_bindings::structs::nsStyleUnit::*;
self.reset();
unsafe {
let (unit, union) = self.values_mut();
@ -364,8 +364,8 @@ pub unsafe trait CoordData {
#[inline(always)]
/// Get the appropriate value for this object.
fn as_value(&self) -> CoordDataValue {
use gecko_bindings::structs::nsStyleUnit::*;
use self::CoordDataValue::*;
use gecko_bindings::structs::nsStyleUnit::*;
unsafe {
match self.unit() {
eStyleUnit_Null => Null,

View file

@ -4,13 +4,13 @@
//! A rust helper to ease the use of Gecko's refcounted types.
use Atom;
use gecko_bindings::{structs, bindings};
use gecko_bindings::sugar::ownership::HasArcFFI;
use gecko_bindings::{bindings, structs};
use servo_arc::Arc;
use std::{fmt, mem, ptr};
use std::marker::PhantomData;
use std::ops::{Deref, DerefMut};
use std::{fmt, mem, ptr};
use Atom;
/// Trait for all objects that have Addref() and Release
/// methods and can be placed inside RefPtr<T>

View file

@ -7,10 +7,10 @@
use gecko::values::{convert_nscolor_to_rgba, convert_rgba_to_nscolor};
use gecko_bindings::structs::StyleComplexColor;
use gecko_bindings::structs::StyleComplexColor_Tag as Tag;
use values::{Auto, Either};
use values::computed::{Color as ComputedColor, RGBAColor as ComputedRGBA};
use values::computed::ui::ColorOrAuto;
use values::computed::{Color as ComputedColor, RGBAColor as ComputedRGBA};
use values::generics::color::{Color as GenericColor, ComplexColorRatios};
use values::{Auto, Either};
impl StyleComplexColor {
/// Create a `StyleComplexColor` value that represents `currentColor`.

View file

@ -17,13 +17,13 @@ use gecko_bindings::bindings::Gecko_ReleaseAtom;
use gecko_bindings::structs::{nsAtom, nsAtom_AtomKind, nsDynamicAtom, nsStaticAtom};
use nsstring::{nsAString, nsStr};
use precomputed_hash::PrecomputedHash;
use std::{mem, slice, str};
use std::borrow::{Borrow, Cow};
use std::char::{self, DecodeUtf16};
use std::fmt::{self, Write};
use std::hash::{Hash, Hasher};
use std::iter::Cloned;
use std::ops::Deref;
use std::{mem, slice, str};
use style_traits::SpecifiedValueInfo;
#[macro_use]

View file

@ -5,16 +5,16 @@
//! A wrapper over an element and a snapshot, that allows us to selector-match
//! against a past state of the element.
use {Atom, CaseSensitivityExt, LocalName, Namespace, WeakAtom};
use dom::TElement;
use element_state::ElementState;
use selector_parser::{AttrValue, NonTSPseudoClass, PseudoElement, SelectorImpl};
use selector_parser::{Snapshot, SnapshotMap};
use selectors::{Element, OpaqueElement};
use selectors::attr::{AttrSelectorOperation, CaseSensitivity, NamespaceConstraint};
use selectors::matching::{ElementSelectorFlags, MatchingContext};
use selectors::{Element, OpaqueElement};
use std::cell::Cell;
use std::fmt;
use {Atom, CaseSensitivityExt, LocalName, Namespace, WeakAtom};
/// In order to compute restyle hints, we perform a selector match against a
/// list of partial selectors whose rightmost simple selector may be sensitive

View file

@ -4,7 +4,6 @@
//! Code for invalidations due to state or attribute changes.
use {Atom, LocalName, Namespace};
use context::QuirksMode;
use element_state::{DocumentState, ElementState};
use fallible::FallibleVec;
@ -16,6 +15,7 @@ use selectors::parser::{Combinator, Component};
use selectors::parser::{Selector, SelectorIter, Visit};
use selectors::visitor::SelectorVisitor;
use smallvec::SmallVec;
use {Atom, LocalName, Namespace};
/// Mapping between (partial) CompoundSelectors (and the combinator to their
/// right) and the states and attributes they depend on.

View file

@ -8,8 +8,8 @@
use context::StackLimitChecker;
use dom::{TElement, TNode, TShadowRoot};
use selector_parser::SelectorImpl;
use selectors::matching::{CompoundSelectorMatchingResult, MatchingContext};
use selectors::matching::matches_compound_selector_from;
use selectors::matching::{CompoundSelectorMatchingResult, MatchingContext};
use selectors::parser::{Combinator, Component, Selector};
use smallvec::SmallVec;
use std::fmt;

View file

@ -5,7 +5,6 @@
//! An invalidation processor for style changes due to state and attribute
//! changes.
use {Atom, WeakAtom};
use context::SharedStyleContext;
use data::ElementData;
use dom::TElement;
@ -17,12 +16,13 @@ use invalidation::element::invalidator::{Invalidation, InvalidationProcessor};
use invalidation::element::restyle_hints::RestyleHint;
use selector_map::SelectorMap;
use selector_parser::Snapshot;
use selectors::NthIndexCache;
use selectors::attr::CaseSensitivity;
use selectors::matching::{MatchingContext, MatchingMode, VisitedHandlingMode};
use selectors::matching::matches_selector;
use selectors::matching::{MatchingContext, MatchingMode, VisitedHandlingMode};
use selectors::NthIndexCache;
use smallvec::SmallVec;
use stylesheets::origin::{Origin, OriginSet};
use {Atom, WeakAtom};
/// The collector implementation.
struct Collector<'a, 'b: 'a, 'selectors: 'a, E>

View file

@ -7,9 +7,6 @@
#![deny(unsafe_code)]
use Atom;
use CaseSensitivityExt;
use LocalName as SelectorLocalName;
use dom::{TDocument, TElement, TNode};
use fxhash::FxHashSet;
use invalidation::element::element_wrapper::{ElementSnapshot, ElementWrapper};
@ -20,6 +17,9 @@ use selectors::attr::CaseSensitivity;
use selectors::parser::{Component, LocalName, Selector};
use shared_lock::SharedRwLockReadGuard;
use stylesheets::{CssRule, StylesheetInDocument};
use Atom;
use CaseSensitivityExt;
use LocalName as SelectorLocalName;
/// A style sheet invalidation represents a kind of element or subtree that may
/// need to be restyled. Whether it represents a whole subtree or just a single

View file

@ -169,20 +169,20 @@ pub use gecko_string_cache as string_cache;
#[cfg(feature = "gecko")]
pub use gecko_string_cache::Atom;
#[cfg(feature = "gecko")]
pub use gecko_string_cache::Namespace;
#[cfg(feature = "gecko")]
pub use gecko_string_cache::Atom as Prefix;
#[cfg(feature = "gecko")]
pub use gecko_string_cache::Atom as LocalName;
#[cfg(feature = "gecko")]
pub use gecko_string_cache::Namespace;
#[cfg(feature = "servo")]
pub use servo_atoms::Atom;
#[cfg(feature = "servo")]
pub use html5ever::Prefix;
#[cfg(feature = "servo")]
pub use html5ever::LocalName;
#[cfg(feature = "servo")]
pub use html5ever::Namespace;
#[cfg(feature = "servo")]
pub use html5ever::Prefix;
#[cfg(feature = "servo")]
pub use servo_atoms::Atom;
/// The CSS properties supported by the style system.
/// Generated from the properties.mako.rs template by build.rs

View file

@ -4,8 +4,8 @@
//! Geometry in flow-relative space.
use euclid::{Point2D, Rect, SideOffsets2D, Size2D};
use euclid::num::Zero;
use euclid::{Point2D, Rect, SideOffsets2D, Size2D};
use properties::style_structs;
use std::cmp::{max, min};
use std::fmt::{self, Debug, Error, Formatter};

View file

@ -12,8 +12,8 @@ use context::{SharedStyleContext, StyleContext};
use data::ElementData;
use dom::TElement;
use invalidation::element::restyle_hints::RestyleHint;
use properties::ComputedValues;
use properties::longhands::display::computed_value::T as Display;
use properties::ComputedValues;
use rule_tree::{CascadeLevel, StrongRuleNode};
use selector_parser::{PseudoElement, RestyleDamage};
use selectors::matching::ElementSelectorFlags;

View file

@ -6,12 +6,12 @@
//!
//! https://drafts.csswg.org/mediaqueries-4/#typedef-media-condition
use super::{Device, MediaFeatureExpression};
use context::QuirksMode;
use cssparser::{Parser, Token};
use parser::ParserContext;
use std::fmt::{self, Write};
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
use super::{Device, MediaFeatureExpression};
/// A binary `and` or `or` operator.
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToCss)]

View file

@ -4,14 +4,14 @@
//! Media features.
use Atom;
use super::media_feature_expression::{AspectRatio, RangeOrOperator};
use super::Device;
use cssparser::Parser;
use parser::ParserContext;
use std::fmt;
use style_traits::ParseError;
use super::Device;
use super::media_feature_expression::{AspectRatio, RangeOrOperator};
use values::computed::{CSSPixelLength, Resolution};
use Atom;
/// A generic discriminant for an enum value.
pub type KeywordDiscriminant = u8;

View file

@ -5,24 +5,24 @@
//! Parsing for media feature expressions, like `(foo: bar)` or
//! `(width >= 400px)`.
use Atom;
use super::media_feature::{Evaluator, MediaFeatureDescription};
use super::media_feature::{KeywordDiscriminant, ParsingRequirements};
use super::Device;
use context::QuirksMode;
use cssparser::{Parser, Token};
#[cfg(feature = "gecko")]
use gecko_bindings::structs;
use num_traits::Zero;
use parser::{Parse, ParserContext};
use std::cmp::{PartialOrd, Ordering};
use std::cmp::{Ordering, PartialOrd};
use std::fmt::{self, Write};
use str::{starts_with_ignore_ascii_case, string_as_ascii_lowercase};
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
use stylesheets::Origin;
use super::Device;
use super::media_feature::{Evaluator, MediaFeatureDescription};
use super::media_feature::{ParsingRequirements, KeywordDiscriminant};
use values::{serialize_atom_identifier, CSSFloat};
use values::computed::{self, ToComputedValue};
use values::specified::{Integer, Length, Number, Resolution};
use values::{serialize_atom_identifier, CSSFloat};
use Atom;
/// An aspect ratio, with a numerator and denominator.
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq)]

View file

@ -6,12 +6,12 @@
//!
//! https://drafts.csswg.org/mediaqueries/#typedef-media-query-list
use super::{Device, MediaQuery, Qualifier};
use context::QuirksMode;
use cssparser::{Delimiter, Parser};
use cssparser::{ParserInput, Token};
use error_reporting::ContextualParseError;
use parser::ParserContext;
use super::{Device, MediaQuery, Qualifier};
/// A type that encapsulates a media query list.
#[css(comma, derive_debug)]

View file

@ -6,14 +6,14 @@
//!
//! https://drafts.csswg.org/mediaqueries/#typedef-media-query
use Atom;
use super::media_condition::MediaCondition;
use cssparser::Parser;
use parser::ParserContext;
use std::fmt::{self, Write};
use str::string_as_ascii_lowercase;
use style_traits::{CssWriter, ParseError, ToCss};
use super::media_condition::MediaCondition;
use values::CustomIdent;
use Atom;
/// <https://drafts.csswg.org/mediaqueries/#mq-prefix>
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToCss)]

View file

@ -14,11 +14,11 @@ pub mod media_feature;
pub mod media_feature_expression;
pub use self::media_condition::MediaCondition;
pub use self::media_feature_expression::MediaFeatureExpression;
pub use self::media_list::MediaList;
pub use self::media_query::{MediaQuery, MediaQueryType, MediaType, Qualifier};
pub use self::media_feature_expression::MediaFeatureExpression;
#[cfg(feature = "servo")]
pub use servo::media_queries::Device;
#[cfg(feature = "gecko")]
pub use gecko::media_queries::Device;
#[cfg(feature = "servo")]
pub use servo::media_queries::Device;

View file

@ -731,9 +731,9 @@ unsafe impl Send for RuleTree {}
#[cfg(feature = "gecko")]
#[cfg(debug_assertions)]
mod gecko_leak_checking {
use super::RuleNode;
use std::mem::size_of;
use std::os::raw::{c_char, c_void};
use super::RuleNode;
extern "C" {
pub fn NS_LogCtor(aPtr: *const c_void, aTypeName: *const c_char, aSize: u32);

View file

@ -5,13 +5,12 @@
//! A data structure to efficiently index structs containing selectors by local
//! name, ids and hash.
use {Atom, LocalName, Namespace, WeakAtom};
use applicable_declarations::ApplicableDeclarationList;
use context::QuirksMode;
use dom::TElement;
use fallible::FallibleVec;
use hash::{HashMap, HashSet};
use hash::map as hash_map;
use hash::{HashMap, HashSet};
use hashglobe::FailedAllocationError;
use precomputed_hash::PrecomputedHash;
use rule_tree::{CascadeLevel, ShadowCascadeOrder};
@ -21,6 +20,7 @@ use selectors::parser::{Combinator, Component, SelectorIter};
use smallvec::SmallVec;
use std::hash::{BuildHasherDefault, Hash, Hasher};
use stylist::Rule;
use {Atom, LocalName, Namespace, WeakAtom};
/// A hasher implementation that doesn't hash anything, because it expects its
/// input to be a suitable u32 hash.

View file

@ -6,7 +6,6 @@
#![deny(missing_docs)]
use Atom;
use cssparser::{Parser as CssParser, ParserInput};
use element_state::ElementState;
use selectors::parser::SelectorList;
@ -14,6 +13,7 @@ use std::fmt::{self, Debug, Write};
use style_traits::{CssWriter, ParseError, ToCss};
use stylesheets::{Namespaces, Origin, UrlExtraData};
use values::serialize_atom_identifier;
use Atom;
/// A convenient alias for the type that represents an attribute value used for
/// selector parser implementation.

View file

@ -8,17 +8,17 @@ use app_units::Au;
use cssparser::RGBA;
use custom_properties::CssEnvironment;
use euclid::{Size2D, TypedScale, TypedSize2D};
use media_queries::MediaType;
use media_queries::media_feature::{AllowsRanges, ParsingRequirements};
use media_queries::media_feature::{MediaFeatureDescription, Evaluator};
use media_queries::media_feature::{Evaluator, MediaFeatureDescription};
use media_queries::media_feature_expression::RangeOrOperator;
use media_queries::MediaType;
use properties::ComputedValues;
use std::sync::atomic::{AtomicBool, AtomicIsize, Ordering};
use style_traits::{CSSPixel, DevicePixel};
use style_traits::viewport::ViewportConstraints;
use values::KeyframesName;
use values::computed::CSSPixelLength;
use style_traits::{CSSPixel, DevicePixel};
use values::computed::font::FontSize;
use values::computed::CSSPixelLength;
use values::KeyframesName;
/// A device is a structure that represents the current media a given document
/// is displayed in.

View file

@ -6,7 +6,6 @@
//! Servo's selector parser.
use {Atom, CaseSensitivityExt, LocalName, Namespace, Prefix};
use attr::{AttrIdentifier, AttrValue};
use cssparser::{serialize_identifier, CowRcStr, Parser as CssParser, SourceLocation, ToCss};
use dom::{OpaqueNode, TElement, TNode};
@ -14,8 +13,8 @@ use element_state::{DocumentState, ElementState};
use fxhash::FxHashMap;
use invalidation::element::document_state::InvalidationMatchingData;
use invalidation::element::element_wrapper::ElementSnapshot;
use properties::{ComputedValues, PropertyFlags};
use properties::longhands::display::computed_value::T as Display;
use properties::{ComputedValues, PropertyFlags};
use selector_parser::{AttrValue as SelectorAttrValue, PseudoElementCascadeType, SelectorParser};
use selectors::attr::{AttrSelectorOperation, CaseSensitivity, NamespaceConstraint};
use selectors::parser::{SelectorParseErrorKind, Visit};
@ -24,6 +23,7 @@ use std::fmt;
use std::mem;
use std::ops::{Deref, DerefMut};
use style_traits::{ParseError, StyleParseErrorKind};
use {Atom, CaseSensitivityExt, LocalName, Namespace, Prefix};
/// A pseudo-element, both public and private.
///
@ -348,8 +348,8 @@ impl NonTSPseudoClass {
/// Gets a given state flag for this pseudo-class. This is used to do
/// selector matching, and it's set from the DOM.
pub fn state_flag(&self) -> ElementState {
use element_state::ElementState;
use self::NonTSPseudoClass::*;
use element_state::ElementState;
match *self {
Active => ElementState::IN_ACTIVE_STATE,
Focus => ElementState::IN_FOCUS_STATE,

View file

@ -64,7 +64,6 @@
//! selectors are effectively stripped off, so that matching them all against
//! elements makes sense.
use Atom;
use applicable_declarations::ApplicableDeclarationBlock;
use atomic_refcell::{AtomicRefCell, AtomicRefMut};
use bloom::StyleBloom;
@ -74,8 +73,8 @@ use matching::MatchMethods;
use owning_ref::OwningHandle;
use properties::ComputedValues;
use rule_tree::StrongRuleNode;
use selectors::NthIndexCache;
use selectors::matching::{ElementSelectorFlags, VisitedHandlingMode};
use selectors::NthIndexCache;
use servo_arc::Arc;
use smallbitvec::SmallBitVec;
use smallvec::SmallVec;
@ -86,6 +85,7 @@ use std::ptr::NonNull;
use style_resolver::{PrimaryStyle, ResolvedElementStyles};
use stylist::Stylist;
use uluru::{Entry, LRUCache};
use Atom;
mod checks;

View file

@ -7,12 +7,12 @@
use app_units::Au;
use dom::TElement;
use properties::{self, ComputedValues, StyleBuilder};
use properties::computed_value_flags::ComputedValueFlags;
use properties::longhands::display::computed_value::T as Display;
use properties::longhands::float::computed_value::T as Float;
use properties::longhands::overflow_x::computed_value::T as Overflow;
use properties::longhands::position::computed_value::T as Position;
use properties::{self, ComputedValues, StyleBuilder};
/// A struct that implements all the adjustment methods.
///

View file

@ -10,11 +10,13 @@ use data::{EagerPseudoStyles, ElementStyles};
use dom::TElement;
use log::Level::Trace;
use matching::MatchMethods;
use properties::{AnimationRules, ComputedValues};
use properties::longhands::display::computed_value::T as Display;
use properties::{AnimationRules, ComputedValues};
use rule_tree::StrongRuleNode;
use selector_parser::{PseudoElement, SelectorImpl};
use selectors::matching::{ElementSelectorFlags, MatchingContext, MatchingMode, VisitedHandlingMode};
use selectors::matching::{
ElementSelectorFlags, MatchingContext, MatchingMode, VisitedHandlingMode,
};
use servo_arc::Arc;
use stylist::RuleInclusion;

View file

@ -6,7 +6,6 @@
//!
//! [font-feature-values]: https://drafts.csswg.org/css-fonts-3/#at-font-feature-values-rule
use Atom;
use cssparser::{AtRuleParser, AtRuleType, BasicParseErrorKind, CowRcStr};
use cssparser::{DeclarationListParser, DeclarationParser, Parser};
use cssparser::{QualifiedRuleParser, RuleListParser, SourceLocation, Token};
@ -23,6 +22,7 @@ use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
use stylesheets::CssRuleType;
use values::computed::font::FamilyName;
use values::serialize_atom_identifier;
use Atom;
/// A @font-feature-values block declaration.
/// It is `<ident>: <integer>+`.

View file

@ -4,23 +4,23 @@
//! Keyframes: https://drafts.csswg.org/css-animations/#keyframes
use cssparser::{AtRuleParser, CowRcStr, Parser, ParserInput, QualifiedRuleParser, RuleListParser};
use cssparser::{parse_one_rule, DeclarationListParser, DeclarationParser, SourceLocation, Token};
use cssparser::{AtRuleParser, CowRcStr, Parser, ParserInput, QualifiedRuleParser, RuleListParser};
use error_reporting::ContextualParseError;
use parser::ParserContext;
use properties::longhands::transition_timing_function::single_value::SpecifiedValue as SpecifiedTimingFunction;
use properties::LonghandIdSet;
use properties::{Importance, PropertyDeclaration};
use properties::{LonghandId, PropertyDeclarationBlock, PropertyId};
use properties::{PropertyDeclarationId, SourcePropertyDeclaration};
use properties::LonghandIdSet;
use properties::longhands::transition_timing_function::single_value::SpecifiedValue as SpecifiedTimingFunction;
use servo_arc::Arc;
use shared_lock::{DeepCloneParams, DeepCloneWithLock, SharedRwLock, SharedRwLockReadGuard};
use shared_lock::{Locked, ToCssWithGuard};
use std::fmt::{self, Write};
use str::CssStringWriter;
use style_traits::{CssWriter, ParseError, ParsingMode, StyleParseErrorKind, ToCss};
use stylesheets::{CssRuleType, StylesheetContents};
use stylesheets::rule_parser::VendorPrefix;
use stylesheets::{CssRuleType, StylesheetContents};
use values::{serialize_percentage, KeyframesName};
/// A [`@keyframes`][keyframes] rule.

View file

@ -45,13 +45,13 @@ pub use self::media_rule::MediaRule;
pub use self::namespace_rule::NamespaceRule;
pub use self::origin::{Origin, OriginSet, OriginSetIterator, PerOrigin, PerOriginIter};
pub use self::page_rule::PageRule;
pub use self::rule_parser::{State, TopLevelRuleParser, InsertRuleContext};
pub use self::rule_list::{CssRules, CssRulesHelpers};
pub use self::rule_parser::{InsertRuleContext, State, TopLevelRuleParser};
pub use self::rules_iterator::{AllRules, EffectiveRules};
pub use self::rules_iterator::{NestedRuleIterationCondition, RulesIterator};
pub use self::style_rule::StyleRule;
pub use self::stylesheet::{DocumentStyleSheet, Namespaces, Stylesheet};
pub use self::stylesheet::{StylesheetContents, StylesheetInDocument, UserAgentStylesheets};
pub use self::style_rule::StyleRule;
pub use self::supports_rule::SupportsRule;
pub use self::viewport_rule::ViewportRule;
@ -88,7 +88,7 @@ impl UrlExtraData {
#[cfg(feature = "gecko")]
impl fmt::Debug for UrlExtraData {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
use gecko_bindings::{structs, bindings};
use gecko_bindings::{bindings, structs};
struct DebugURI(*mut structs::nsIURI);
impl fmt::Debug for DebugURI {

View file

@ -4,11 +4,11 @@
//! The `@namespace` at-rule.
use {Namespace, Prefix};
use cssparser::SourceLocation;
use shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
use std::fmt::{self, Write};
use str::CssStringWriter;
use {Namespace, Prefix};
/// A `@namespace` rule.
#[derive(Clone, Debug, PartialEq)]

View file

@ -11,10 +11,10 @@ use shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked};
use shared_lock::{SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard};
use std::fmt::{self, Write};
use str::CssStringWriter;
use stylesheets::{CssRule, RulesMutateError};
use stylesheets::loader::StylesheetLoader;
use stylesheets::rule_parser::{InsertRuleContext, State};
use stylesheets::stylesheet::StylesheetContents;
use stylesheets::{CssRule, RulesMutateError};
/// A list of CSS rules.
#[derive(Debug)]

View file

@ -4,7 +4,6 @@
//! Parsing of the stylesheet contents.
use {Namespace, Prefix};
use counter_style::{parse_counter_style_body, parse_counter_style_name_definition};
use cssparser::{AtRuleParser, AtRuleType, Parser, QualifiedRuleParser, RuleListParser};
use cssparser::{BasicParseError, BasicParseErrorKind, CowRcStr, SourceLocation};
@ -19,17 +18,18 @@ use servo_arc::Arc;
use shared_lock::{Locked, SharedRwLock};
use str::starts_with_ignore_ascii_case;
use style_traits::{ParseError, StyleParseErrorKind};
use stylesheets::{CssRule, CssRuleType, CssRules, RulesMutateError, StylesheetLoader};
use stylesheets::{DocumentRule, FontFeatureValuesRule, KeyframesRule, MediaRule};
use stylesheets::{NamespaceRule, PageRule, StyleRule, SupportsRule, ViewportRule};
use stylesheets::document_rule::DocumentCondition;
use stylesheets::font_feature_values_rule::parse_family_name_list;
use stylesheets::keyframes_rule::parse_keyframe_list;
use stylesheets::stylesheet::Namespaces;
use stylesheets::supports_rule::SupportsCondition;
use stylesheets::viewport_rule;
use values::{CssUrl, CustomIdent, KeyframesName};
use stylesheets::{CssRule, CssRuleType, CssRules, RulesMutateError, StylesheetLoader};
use stylesheets::{DocumentRule, FontFeatureValuesRule, KeyframesRule, MediaRule};
use stylesheets::{NamespaceRule, PageRule, StyleRule, SupportsRule, ViewportRule};
use values::computed::font::FamilyName;
use values::{CssUrl, CustomIdent, KeyframesName};
use {Namespace, Prefix};
/// The information we need particularly to do CSSOM insertRule stuff.
pub struct InsertRuleContext<'a> {

View file

@ -9,8 +9,8 @@ use media_queries::Device;
use shared_lock::SharedRwLockReadGuard;
use smallvec::SmallVec;
use std::slice;
use stylesheets::{CssRule, DocumentRule, ImportRule, MediaRule, SupportsRule};
use stylesheets::StylesheetInDocument;
use stylesheets::{CssRule, DocumentRule, ImportRule, MediaRule, SupportsRule};
/// An iterator over a list of rules.
pub struct RulesIterator<'a, 'b, C>

View file

@ -6,9 +6,9 @@
use cssparser::SourceLocation;
#[cfg(feature = "gecko")]
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
#[cfg(feature = "gecko")]
use malloc_size_of::MallocUnconditionalShallowSizeOf;
#[cfg(feature = "gecko")]
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
use properties::PropertyDeclarationBlock;
use selector_parser::SelectorImpl;
use selectors::SelectorList;

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use {Namespace, Prefix};
use context::QuirksMode;
use cssparser::{Parser, ParserInput, RuleListParser};
use error_reporting::{ContextualParseError, ParseErrorReporter};
@ -15,16 +14,19 @@ use media_queries::{Device, MediaList};
use parking_lot::RwLock;
use parser::ParserContext;
use servo_arc::Arc;
use shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked, SharedRwLock, SharedRwLockReadGuard};
use shared_lock::{
DeepCloneParams, DeepCloneWithLock, Locked, SharedRwLock, SharedRwLockReadGuard,
};
use std::mem;
use std::sync::atomic::{AtomicBool, Ordering};
use style_traits::ParsingMode;
use stylesheets::{CssRule, CssRules, Origin, UrlExtraData};
use stylesheets::loader::StylesheetLoader;
use stylesheets::rule_parser::{State, TopLevelRuleParser};
use stylesheets::rules_iterator::{EffectiveRules, EffectiveRulesIterator};
use stylesheets::rules_iterator::{NestedRuleIterationCondition, RulesIterator};
use stylesheets::{CssRule, CssRules, Origin, UrlExtraData};
use use_counters::UseCounters;
use {Namespace, Prefix};
/// This structure holds the user-agent and user stylesheets.
pub struct UserAgentStylesheets {

View file

@ -4,9 +4,9 @@
//! [@supports rules](https://drafts.csswg.org/css-conditional-3/#at-supports)
use cssparser::parse_important;
use cssparser::{Delimiter, Parser, SourceLocation, Token};
use cssparser::{ParseError as CssParseError, ParserInput};
use cssparser::parse_important;
#[cfg(feature = "gecko")]
use malloc_size_of::{MallocSizeOfOps, MallocUnconditionalShallowSizeOf};
use parser::ParserContext;

View file

@ -9,8 +9,8 @@
use app_units::Au;
use context::QuirksMode;
use cssparser::{parse_important, AtRuleParser, DeclarationListParser, DeclarationParser, Parser};
use cssparser::CowRcStr;
use cssparser::{parse_important, AtRuleParser, DeclarationListParser, DeclarationParser, Parser};
use error_reporting::ContextualParseError;
use euclid::TypedSize2D;
use font_metrics::get_metrics_provider_for_product;
@ -26,8 +26,8 @@ use std::fmt::{self, Write};
use std::iter::Enumerate;
use std::str::Chars;
use str::CssStringWriter;
use style_traits::{CssWriter, ParseError, PinchZoomFactor, StyleParseErrorKind, ToCss};
use style_traits::viewport::{Orientation, UserZoom, ViewportConstraints, Zoom};
use style_traits::{CssWriter, ParseError, PinchZoomFactor, StyleParseErrorKind, ToCss};
use stylesheets::{Origin, StylesheetInDocument};
use values::computed::{Context, ToComputedValue};
use values::specified::{LengthOrPercentageOrAuto, NoCalcLength, ViewportPercentageLength};

View file

@ -4,7 +4,6 @@
//! Selector matching.
use {Atom, LocalName, Namespace, WeakAtom};
use applicable_declarations::{ApplicableDeclarationBlock, ApplicableDeclarationList};
use context::{CascadeInputs, QuirksMode};
use dom::{TElement, TShadowRoot};
@ -16,9 +15,9 @@ use hashglobe::FailedAllocationError;
use invalidation::element::invalidation_map::InvalidationMap;
use invalidation::media_queries::{EffectiveMediaQueryResults, ToMediaListKey};
#[cfg(feature = "gecko")]
use malloc_size_of::{MallocShallowSizeOf, MallocSizeOf, MallocSizeOfOps};
#[cfg(feature = "gecko")]
use malloc_size_of::MallocUnconditionalShallowSizeOf;
#[cfg(feature = "gecko")]
use malloc_size_of::{MallocShallowSizeOf, MallocSizeOf, MallocSizeOfOps};
use media_queries::Device;
use properties::{self, CascadeMode, ComputedValues};
use properties::{AnimationRules, PropertyDeclarationBlock};
@ -26,14 +25,14 @@ use rule_cache::{RuleCache, RuleCacheConditions};
use rule_tree::{CascadeLevel, RuleTree, ShadowCascadeOrder, StrongRuleNode, StyleSource};
use selector_map::{PrecomputedHashMap, PrecomputedHashSet, SelectorMap, SelectorMapEntry};
use selector_parser::{PerPseudoElementMap, PseudoElement, SelectorImpl, SnapshotMap};
use selectors::NthIndexCache;
use selectors::attr::{CaseSensitivity, NamespaceConstraint};
use selectors::bloom::BloomFilter;
use selectors::matching::{matches_selector, ElementSelectorFlags, MatchingContext, MatchingMode};
use selectors::matching::VisitedHandlingMode;
use selectors::matching::{matches_selector, ElementSelectorFlags, MatchingContext, MatchingMode};
use selectors::parser::{AncestorHashes, Combinator, Component, Selector};
use selectors::parser::{SelectorIter, Visit};
use selectors::visitor::SelectorVisitor;
use selectors::NthIndexCache;
use servo_arc::{Arc, ArcBorrow};
use shared_lock::{Locked, SharedRwLockReadGuard, StylesheetGuards};
use smallbitvec::SmallBitVec;
@ -43,14 +42,15 @@ use std::sync::Mutex;
use style_traits::viewport::ViewportConstraints;
use stylesheet_set::{DataValidity, DocumentStylesheetSet, SheetRebuildKind};
use stylesheet_set::{DocumentStylesheetFlusher, SheetCollectionFlusher};
use stylesheets::keyframes_rule::KeyframesAnimation;
use stylesheets::viewport_rule::{self, MaybeNew, ViewportRule};
use stylesheets::StyleRule;
use stylesheets::StylesheetInDocument;
#[cfg(feature = "gecko")]
use stylesheets::{CounterStyleRule, FontFaceRule, FontFeatureValuesRule, PageRule};
use stylesheets::{CssRule, Origin, OriginSet, PerOrigin, PerOriginIter};
use stylesheets::StyleRule;
use stylesheets::StylesheetInDocument;
use stylesheets::keyframes_rule::KeyframesAnimation;
use stylesheets::viewport_rule::{self, MaybeNew, ViewportRule};
use thread_state::{self, ThreadState};
use {Atom, LocalName, Namespace, WeakAtom};
/// The type of the stylesheets that the stylist contains.
#[cfg(feature = "servo")]

View file

@ -720,8 +720,8 @@ where
E: TElement,
{
use style_traits::ToCss;
use values::Either;
use values::generics::image::Image;
use values::Either;
// We speculatively evaluate any paint worklets during styling.
// This allows us to run paint worklets in parallel with style and layout.

View file

@ -4,16 +4,16 @@
//! Animated types for CSS values related to effects.
#[cfg(not(feature = "gecko"))]
use values::Impossible;
use values::animated::color::Color;
use values::computed::{Angle, Number};
use values::computed::length::Length;
#[cfg(feature = "gecko")]
use values::computed::url::ComputedUrl;
use values::computed::{Angle, Number};
use values::generics::effects::BoxShadow as GenericBoxShadow;
use values::generics::effects::Filter as GenericFilter;
use values::generics::effects::SimpleShadow as GenericSimpleShadow;
#[cfg(not(feature = "gecko"))]
use values::Impossible;
/// An animated value for a single `box-shadow`.
pub type BoxShadow = GenericBoxShadow<Color, Length, Length, Length>;

View file

@ -5,8 +5,8 @@
//! Animation implementation for various font-related types.
use super::{Animate, Procedure, ToAnimatedZero};
use values::computed::font::{FontVariationSettings, FontWeight};
use values::computed::Number;
use values::computed::font::{FontWeight, FontVariationSettings};
use values::distance::{ComputeSquaredDistance, SquaredDistance};
use values::generics::font::{FontSettings as GenericFontSettings, FontTag, VariationValue};

View file

@ -5,10 +5,12 @@
//! Animation implementation for various length-related types.
use super::{Animate, Procedure, ToAnimatedValue, ToAnimatedZero};
use values::computed::length::{
CalcLengthOrPercentage, Length, LengthOrPercentageOrAuto, LengthOrPercentageOrNone,
};
use values::computed::MaxLength as ComputedMaxLength;
use values::computed::MozLength as ComputedMozLength;
use values::computed::Percentage;
use values::computed::length::{Length, CalcLengthOrPercentage, LengthOrPercentageOrNone, LengthOrPercentageOrAuto};
/// <https://drafts.csswg.org/css-transitions/#animtype-lpcalc>
impl Animate for CalcLengthOrPercentage {

View file

@ -13,10 +13,10 @@ use euclid::{Point2D, Size2D};
use properties::PropertyId;
use smallvec::SmallVec;
use std::cmp;
use values::computed::Angle as ComputedAngle;
use values::computed::BorderCornerRadius as ComputedBorderCornerRadius;
use values::computed::length::CalcLengthOrPercentage;
use values::computed::url::ComputedUrl;
use values::computed::Angle as ComputedAngle;
use values::computed::BorderCornerRadius as ComputedBorderCornerRadius;
pub mod color;
pub mod effects;

View file

@ -4,14 +4,14 @@
//! Animation implementations for various SVG-related types.
use properties::animated_properties::ListAnimation;
use super::{Animate, Procedure, ToAnimatedZero};
use properties::animated_properties::ListAnimation;
use values::animated::color::Color as AnimatedColor;
use values::computed::{Number, NumberOrPercentage, LengthOrPercentage};
use values::computed::url::ComputedUrl;
use values::computed::{LengthOrPercentage, Number, NumberOrPercentage};
use values::distance::{ComputeSquaredDistance, SquaredDistance};
use values::generics::svg::{SVGLength, SvgLengthOrPercentageOrNumber, SVGPaint};
use values::generics::svg::{SVGStrokeDashArray, SVGOpacity};
use values::generics::svg::{SVGLength, SVGPaint, SvgLengthOrPercentageOrNumber};
use values::generics::svg::{SVGOpacity, SVGStrokeDashArray};
/// Animated SVGPaint.
pub type IntermediateSVGPaint = SVGPaint<AnimatedColor, ComputedUrl>;

View file

@ -5,13 +5,13 @@
//! Computed angles.
use num_traits::Zero;
use std::{f32, f64};
use std::f64::consts::PI;
use std::fmt::{self, Write};
use std::ops::Add;
use std::{f32, f64};
use style_traits::{CssWriter, ToCss};
use values::CSSFloat;
use values::distance::{ComputeSquaredDistance, SquaredDistance};
use values::CSSFloat;
/// A computed angle in degrees.
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]

View file

@ -6,8 +6,8 @@
use std::fmt::{self, Write};
use style_traits::{CssWriter, ToCss};
use values::computed::{Context, ToComputedValue};
use values::computed::length::NonNegativeLengthOrPercentageOrAuto;
use values::computed::{Context, ToComputedValue};
use values::generics::background::BackgroundSize as GenericBackgroundSize;
use values::specified::background::BackgroundRepeat as SpecifiedBackgroundRepeat;
use values::specified::background::BackgroundRepeatKeyword;

View file

@ -9,8 +9,8 @@
use std::fmt::{self, Write};
use style_traits::{CssWriter, ToCss};
use values::computed::{Image, LengthOrPercentage};
use values::computed::url::ComputedUrl;
use values::computed::{Image, LengthOrPercentage};
use values::generics::basic_shape as generic;
/// A computed alias for FillRule.

View file

@ -6,8 +6,8 @@
use app_units::Au;
use values::animated::ToAnimatedZero;
use values::computed::{Number, NumberOrPercentage};
use values::computed::length::{LengthOrPercentage, NonNegativeLength};
use values::computed::{Number, NumberOrPercentage};
use values::generics::border::BorderCornerRadius as GenericBorderCornerRadius;
use values::generics::border::BorderImageSideWidth as GenericBorderImageSideWidth;
use values::generics::border::BorderImageSlice as GenericBorderImageSlice;

View file

@ -4,8 +4,8 @@
//! Computed types for box properties.
use values::computed::{Context, Number, ToComputedValue};
use values::computed::length::{LengthOrPercentage, NonNegativeLength};
use values::computed::{Context, Number, ToComputedValue};
use values::generics::box_::AnimationIterationCount as GenericAnimationIterationCount;
use values::generics::box_::Perspective as GenericPerspective;
use values::generics::box_::VerticalAlign as GenericVerticalAlign;
@ -13,7 +13,9 @@ use values::specified::box_ as specified;
pub use values::specified::box_::{AnimationName, Appearance, Contain, Display, OverflowClipBox};
pub use values::specified::box_::{Clear as SpecifiedClear, Float as SpecifiedFloat};
pub use values::specified::box_::{OverscrollBehavior, ScrollSnapType, TouchAction, TransitionProperty, WillChange};
pub use values::specified::box_::{
OverscrollBehavior, ScrollSnapType, TouchAction, TransitionProperty, WillChange,
};
/// A computed value for the `vertical-align` property.
pub type VerticalAlign = GenericVerticalAlign<LengthOrPercentage>;

View file

@ -7,8 +7,8 @@
use cssparser::{Color as CSSParserColor, RGBA};
use std::fmt;
use style_traits::{CssWriter, ToCss};
use values::animated::ToAnimatedValue;
use values::animated::color::RGBA as AnimatedRGBA;
use values::animated::ToAnimatedValue;
use values::generics::color::Color as GenericColor;
/// Computed value type for the specified RGBAColor.

View file

@ -4,16 +4,16 @@
//! Computed types for CSS values related to effects.
#[cfg(not(feature = "gecko"))]
use values::Impossible;
use values::computed::{Angle, NonNegativeNumber};
use values::computed::color::Color;
use values::computed::length::{Length, NonNegativeLength};
#[cfg(feature = "gecko")]
use values::computed::url::ComputedUrl;
use values::computed::{Angle, NonNegativeNumber};
use values::generics::effects::BoxShadow as GenericBoxShadow;
use values::generics::effects::Filter as GenericFilter;
use values::generics::effects::SimpleShadow as GenericSimpleShadow;
#[cfg(not(feature = "gecko"))]
use values::Impossible;
/// A computed value for a single shadow of the `box-shadow` property.
pub type BoxShadow = GenericBoxShadow<Color, Length, NonNegativeLength, Length>;

View file

@ -4,28 +4,28 @@
//! Computed values for font properties
use Atom;
use app_units::Au;
use byteorder::{BigEndian, ByteOrder};
use cssparser::{serialize_identifier, CssStringWriter, Parser};
#[cfg(feature = "gecko")]
use gecko_bindings::{bindings, structs};
#[cfg(feature = "gecko")]
use gecko_bindings::sugar::refptr::RefPtr;
#[cfg(feature = "gecko")]
use gecko_bindings::{bindings, structs};
#[cfg(feature = "gecko")]
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
use std::fmt::{self, Write};
use std::hash::{Hash, Hasher};
#[cfg(feature = "servo")]
use std::slice;
use style_traits::{CssWriter, ParseError, ToCss};
use values::CSSFloat;
use values::animated::{ToAnimatedValue, ToAnimatedZero};
use values::computed::{Angle, Context, Integer, NonNegativeLength, NonNegativePercentage};
use values::computed::{Number, Percentage, ToComputedValue};
use values::generics::font::{self as generics, FeatureTagValue, FontSettings, VariationValue};
use values::specified::font::{self as specified, MIN_FONT_WEIGHT, MAX_FONT_WEIGHT};
use values::specified::font::{self as specified, MAX_FONT_WEIGHT, MIN_FONT_WEIGHT};
use values::specified::length::{FontBaseSize, NoCalcLength};
use values::CSSFloat;
use Atom;
pub use values::computed::Length as MozScriptMinSize;
pub use values::specified::font::{FontSynthesis, MozScriptSizeMultiplier, XLang, XTextZoom};

View file

@ -10,16 +10,16 @@
use std::f32::consts::PI;
use std::fmt::{self, Write};
use style_traits::{CssWriter, ToCss};
use values::{Either, None_};
use values::computed::{Angle, Color, Context};
use values::computed::{Length, LengthOrPercentage, NumberOrPercentage, ToComputedValue};
#[cfg(feature = "gecko")]
use values::computed::Percentage;
use values::computed::position::Position;
use values::computed::url::ComputedImageUrl;
#[cfg(feature = "gecko")]
use values::computed::Percentage;
use values::computed::{Angle, Color, Context};
use values::computed::{Length, LengthOrPercentage, NumberOrPercentage, ToComputedValue};
use values::generics::image::{self as generic, CompatMode};
use values::specified::image::LineDirection as SpecifiedLineDirection;
use values::specified::position::{X, Y};
use values::{Either, None_};
/// A computed image layer.
pub type ImageLayer = Either<None_, Image>;

View file

@ -4,20 +4,20 @@
//! `<length>` computed values, and related ones.
use super::{Context, Number, Percentage, ToComputedValue};
use app_units::Au;
use ordered_float::NotNan;
use std::fmt::{self, Write};
use std::ops::{Add, Neg};
use style_traits::{CssWriter, ToCss};
use style_traits::values::specified::AllowedNumericType;
use super::{Context, Number, Percentage, ToComputedValue};
use values::{specified, Auto, CSSFloat, Either, Normal};
use style_traits::{CssWriter, ToCss};
use values::animated::{Animate, Procedure, ToAnimatedValue, ToAnimatedZero};
use values::distance::{ComputeSquaredDistance, SquaredDistance};
use values::generics::NonNegative;
use values::generics::length::{MaxLength as GenericMaxLength, MozLength as GenericMozLength};
use values::specified::length::{AbsoluteLength, FontBaseSize, FontRelativeLength};
use values::generics::NonNegative;
use values::specified::length::ViewportPercentageLength;
use values::specified::length::{AbsoluteLength, FontBaseSize, FontRelativeLength};
use values::{specified, Auto, CSSFloat, Either, Normal};
pub use super::image::Image;
pub use values::specified::url::UrlOrNone;

View file

@ -4,9 +4,9 @@
//! `list` computed values.
pub use values::specified::list::Quotes;
#[cfg(feature = "gecko")]
pub use values::specified::list::ListStyleType;
pub use values::specified::list::Quotes;
impl Quotes {
/// Initial value for `quotes`.

View file

@ -4,9 +4,13 @@
//! Computed values.
use Atom;
#[cfg(feature = "servo")]
use Prefix;
use super::animated::ToAnimatedValue;
use super::generics::grid::GridTemplateComponent as GenericGridTemplateComponent;
use super::generics::grid::{GridLine as GenericGridLine, TrackBreadth as GenericTrackBreadth};
use super::generics::grid::{TrackList as GenericTrackList, TrackSize as GenericTrackSize};
use super::generics::{GreaterThanOrEqualToOne, NonNegative};
use super::specified;
use super::{CSSFloat, CSSInteger};
use context::QuirksMode;
use euclid::Size2D;
use font_metrics::{get_metrics_provider_for_product, FontMetricsProvider};
@ -19,17 +23,12 @@ use std::cell::RefCell;
use std::cmp;
use std::f32;
use std::fmt::{self, Write};
use style_traits::{CssWriter, ToCss};
use style_traits::cursor::CursorKind;
use super::{CSSFloat, CSSInteger};
use super::animated::ToAnimatedValue;
use super::generics::{GreaterThanOrEqualToOne, NonNegative};
use super::generics::grid::{GridLine as GenericGridLine, TrackBreadth as GenericTrackBreadth};
use super::generics::grid::{TrackList as GenericTrackList, TrackSize as GenericTrackSize};
use super::generics::grid::GridTemplateComponent as GenericGridTemplateComponent;
use super::specified;
use style_traits::{CssWriter, ToCss};
use Atom;
#[cfg(feature = "servo")]
use Prefix;
pub use app_units::Au;
#[cfg(feature = "gecko")]
pub use self::align::{AlignContent, AlignItems, JustifyContent, JustifyItems, SelfAlignment};
#[cfg(feature = "gecko")]
@ -37,13 +36,13 @@ pub use self::align::{AlignSelf, JustifySelf};
pub use self::angle::Angle;
pub use self::background::{BackgroundRepeat, BackgroundSize};
pub use self::basic_shape::FillRule;
pub use self::border::{BorderImageRepeat, BorderImageSideWidth, BorderImageSlice, BorderImageWidth};
pub use self::border::{BorderCornerRadius, BorderRadius, BorderSpacing};
pub use self::font::{FontSize, FontSizeAdjust, FontStretch, FontSynthesis, FontVariantAlternates, FontWeight};
pub use self::font::{FontFamily, FontLanguageOverride, FontStyle, FontVariantEastAsian, FontVariationSettings};
pub use self::font::{FontFeatureSettings, FontVariantLigatures, FontVariantNumeric};
pub use self::font::{MozScriptLevel, MozScriptMinSize, MozScriptSizeMultiplier, XLang, XTextZoom};
pub use self::box_::{AnimationIterationCount, AnimationName, Contain, Display, TransitionProperty};
pub use self::border::{
BorderImageRepeat, BorderImageSideWidth, BorderImageSlice, BorderImageWidth,
};
pub use self::box_::{
AnimationIterationCount, AnimationName, Contain, Display, TransitionProperty,
};
pub use self::box_::{Appearance, Clear, Float};
pub use self::box_::{OverflowClipBox, OverscrollBehavior, Perspective, Resize};
pub use self::box_::{ScrollSnapType, TouchAction, VerticalAlign, WillChange};
@ -53,36 +52,47 @@ pub use self::counters::{Content, ContentItem, CounterIncrement, CounterReset};
pub use self::easing::TimingFunction;
pub use self::effects::{BoxShadow, Filter, SimpleShadow};
pub use self::flex::FlexBasis;
pub use self::image::{Gradient, GradientItem, Image, ImageLayer, LineDirection, MozImageRect};
pub use self::font::{
FontFamily, FontLanguageOverride, FontStyle, FontVariantEastAsian, FontVariationSettings,
};
pub use self::font::{FontFeatureSettings, FontVariantLigatures, FontVariantNumeric};
pub use self::font::{
FontSize, FontSizeAdjust, FontStretch, FontSynthesis, FontVariantAlternates, FontWeight,
};
pub use self::font::{MozScriptLevel, MozScriptMinSize, MozScriptSizeMultiplier, XLang, XTextZoom};
#[cfg(feature = "gecko")]
pub use self::gecko::ScrollSnapPoint;
pub use self::rect::LengthOrNumberRect;
pub use self::resolution::Resolution;
pub use super::{Auto, Either, None_};
pub use super::specified::{BorderStyle, TextDecorationLine};
pub use self::image::{Gradient, GradientItem, Image, ImageLayer, LineDirection, MozImageRect};
pub use self::length::{CSSPixelLength, ExtremumLength, NonNegativeLength};
pub use self::length::{CalcLengthOrPercentage, Length, LengthOrNumber, LengthOrPercentage};
pub use self::length::{LengthOrPercentageOrAuto, LengthOrPercentageOrNone, MaxLength, MozLength};
pub use self::length::{CSSPixelLength, ExtremumLength, NonNegativeLength};
pub use self::length::{NonNegativeLengthOrPercentage, NonNegativeLengthOrPercentageOrAuto};
pub use self::list::Quotes;
#[cfg(feature = "gecko")]
pub use self::list::ListStyleType;
pub use self::list::Quotes;
pub use self::motion::OffsetPath;
pub use self::outline::OutlineStyle;
pub use self::percentage::{Percentage, NonNegativePercentage};
pub use self::percentage::{NonNegativePercentage, Percentage};
pub use self::position::{GridAutoFlow, GridTemplateAreas, Position, ZIndex};
pub use self::rect::LengthOrNumberRect;
pub use self::resolution::Resolution;
pub use self::svg::MozContextProperties;
pub use self::svg::{SVGLength, SVGOpacity, SVGPaint, SVGPaintKind};
pub use self::svg::{SVGPaintOrder, SVGStrokeDashArray, SVGWidth};
pub use self::svg::MozContextProperties;
pub use self::table::XSpan;
pub use self::text::{InitialLetter, LetterSpacing, LineHeight, MozTabSize};
pub use self::text::{TextAlign, TextEmphasisPosition, TextEmphasisStyle, TextOverflow, WordSpacing};
pub use self::text::{
TextAlign, TextEmphasisPosition, TextEmphasisStyle, TextOverflow, WordSpacing,
};
pub use self::time::Time;
pub use self::transform::{Rotate, Scale, Transform, TransformOperation};
pub use self::transform::{TransformOrigin, TransformStyle, Translate};
pub use self::ui::{ColorOrAuto, Cursor, MozForceBrokenImageIcon};
#[cfg(feature = "gecko")]
pub use self::ui::CursorImage;
pub use self::ui::{ColorOrAuto, Cursor, MozForceBrokenImageIcon};
pub use super::specified::{BorderStyle, TextDecorationLine};
pub use super::{Auto, Either, None_};
pub use app_units::Au;
#[cfg(feature = "gecko")]
pub mod align;

View file

@ -6,9 +6,9 @@
use std::fmt;
use style_traits::{CssWriter, ToCss};
use values::{serialize_percentage, CSSFloat};
use values::animated::ToAnimatedValue;
use values::generics::NonNegative;
use values::{serialize_percentage, CSSFloat};
/// A computed percentage.
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]

View file

@ -8,9 +8,9 @@
use std::fmt::{self, Write};
use style_traits::{CssWriter, ToCss};
use values::CSSFloat;
use values::computed::{Context, ToComputedValue};
use values::specified;
use values::CSSFloat;
/// A computed `<resolution>`.
pub struct Resolution(CSSFloat);

View file

@ -4,11 +4,13 @@
//! Computed types for SVG properties.
use values::RGBA;
use values::computed::{NonNegativeLengthOrPercentage, NonNegativeNumber, Number, LengthOrPercentage, Opacity};
use values::computed::color::Color;
use values::computed::url::ComputedUrl;
use values::computed::{
LengthOrPercentage, NonNegativeLengthOrPercentage, NonNegativeNumber, Number, Opacity,
};
use values::generics::svg as generic;
use values::RGBA;
pub use values::specified::SVGPaintOrder;

View file

@ -8,14 +8,14 @@
use properties::StyleBuilder;
use std::fmt::{self, Write};
use style_traits::{CssWriter, ToCss};
use values::{CSSFloat, CSSInteger};
use values::computed::{NonNegativeLength, NonNegativeNumber};
use values::computed::length::{Length, LengthOrPercentage};
use values::computed::{NonNegativeLength, NonNegativeNumber};
use values::generics::text::InitialLetter as GenericInitialLetter;
use values::generics::text::LineHeight as GenericLineHeight;
use values::generics::text::MozTabSize as GenericMozTabSize;
use values::generics::text::Spacing;
use values::specified::text::{TextEmphasisFillMode, TextEmphasisShapeKeyword, TextOverflowSide};
use values::{CSSFloat, CSSInteger};
pub use values::specified::TextAlignKeyword as TextAlign;
pub use values::specified::TextEmphasisPosition;

View file

@ -4,9 +4,9 @@
//! Computed types for CSS values that are related to transformations.
use super::CSSFloat;
use euclid::{Transform3D, Vector3D};
use num_traits::Zero;
use super::CSSFloat;
use values::animated::ToAnimatedZero;
use values::computed::{Angle, Integer, Length, LengthOrPercentage, Number, Percentage};
use values::generics::transform as generic;

View file

@ -4,11 +4,11 @@
//! Computed values for UI properties
use values::{Auto, Either};
use values::computed::Number;
use values::computed::color::Color;
use values::computed::url::ComputedImageUrl;
use values::computed::Number;
use values::generics::ui as generics;
use values::{Auto, Either};
pub use values::specified::ui::MozForceBrokenImageIcon;

View file

@ -6,10 +6,10 @@
use values::generics::url::UrlOrNone as GenericUrlOrNone;
#[cfg(feature = "servo")]
pub use servo::url::{ComputedImageUrl, ComputedUrl};
#[cfg(feature = "gecko")]
pub use gecko::url::{ComputedImageUrl, ComputedUrl};
#[cfg(feature = "servo")]
pub use servo::url::{ComputedImageUrl, ComputedUrl};
/// Computed <url> | <none>
pub type UrlOrNone = GenericUrlOrNone<ComputedUrl>;

View file

@ -7,11 +7,11 @@
#[cfg(feature = "servo")]
use computed_values::list_style_type::T as ListStyleType;
use std::ops::Deref;
use values::CustomIdent;
#[cfg(feature = "gecko")]
use values::generics::CounterStyleOrNone;
#[cfg(feature = "gecko")]
use values::specified::Attr;
use values::CustomIdent;
/// A name / value pair for counters.
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]

View file

@ -7,13 +7,13 @@
use cssparser::Parser;
use parser::{Parse, ParserContext};
use std::{mem, usize};
use std::fmt::{self, Write};
use std::{mem, usize};
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
use values::{CSSFloat, CustomIdent};
use values::computed::{Context, ToComputedValue};
use values::specified;
use values::specified::grid::parse_line_names;
use values::{CSSFloat, CustomIdent};
/// A `<grid-line>` type.
///

View file

@ -6,12 +6,12 @@
//!
//! [images]: https://drafts.csswg.org/css-images/#image-values
use Atom;
use custom_properties;
use servo_arc::Arc;
use std::fmt::{self, Write};
use style_traits::{CssWriter, ToCss};
use values::serialize_atom_identifier;
use Atom;
/// An [image].
///

View file

@ -5,12 +5,12 @@
//! Generic types that share their serialization implementations
//! for both specified and computed values.
use super::CustomIdent;
use counter_style::{parse_counter_style_name, Symbols};
use cssparser::Parser;
use parser::{Parse, ParserContext};
use style_traits::{KeywordsCollectFn, ParseError};
use style_traits::{SpecifiedValueInfo, StyleParseErrorKind};
use super::CustomIdent;
pub mod background;
pub mod basic_shape;

View file

@ -7,12 +7,12 @@
use app_units::Au;
use euclid::{self, Rect, Transform3D};
use num_traits::Zero;
use values::{computed, CSSFloat};
use values::computed::length::Length as ComputedLength;
use values::computed::length::LengthOrPercentage as ComputedLengthOrPercentage;
use values::specified::angle::Angle as SpecifiedAngle;
use values::specified::length::Length as SpecifiedLength;
use values::specified::length::LengthOrPercentage as SpecifiedLengthOrPercentage;
use values::{computed, CSSFloat};
/// A generic 2D transformation matrix.
#[allow(missing_docs)]

View file

@ -5,8 +5,8 @@
//! Generic values for UI properties.
use std::fmt::{self, Write};
use style_traits::{CssWriter, ToCss};
use style_traits::cursor::CursorKind;
use style_traits::{CssWriter, ToCss};
/// A generic value for the `cursor` property.
///

View file

@ -8,19 +8,21 @@
#![deny(missing_docs)]
use Atom;
pub use cssparser::{serialize_identifier, serialize_name, CowRcStr, Parser, SourceLocation, Token, RGBA};
pub use cssparser::{
serialize_identifier, serialize_name, CowRcStr, Parser, SourceLocation, Token, RGBA,
};
use parser::{Parse, ParserContext};
use selectors::parser::SelectorParseErrorKind;
use std::fmt::{self, Debug, Write};
use std::hash;
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
use values::distance::{ComputeSquaredDistance, SquaredDistance};
use Atom;
#[cfg(feature = "servo")]
pub use servo::url::CssUrl;
#[cfg(feature = "gecko")]
pub use gecko::url::CssUrl;
#[cfg(feature = "servo")]
pub use servo::url::CssUrl;
pub mod animated;
pub mod computed;

View file

@ -9,10 +9,10 @@ use parser::{Parse, ParserContext};
use std::f32::consts::PI;
use std::fmt::{self, Write};
use style_traits::{CssWriter, ParseError, SpecifiedValueInfo, ToCss};
use values::CSSFloat;
use values::computed::{Context, ToComputedValue};
use values::computed::angle::Angle as ComputedAngle;
use values::computed::{Context, ToComputedValue};
use values::specified::calc::CalcNode;
use values::CSSFloat;
/// A specified angle dimension.
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]

View file

@ -17,13 +17,13 @@ use values::generics::basic_shape as generic;
use values::generics::basic_shape::{GeometryBox, Path, PolygonCoord};
use values::generics::basic_shape::{ShapeBox, ShapeSource};
use values::generics::rect::Rect;
use values::specified::LengthOrPercentage;
use values::specified::SVGPathData;
use values::specified::border::BorderRadius;
use values::specified::image::Image;
use values::specified::position::{HorizontalPosition, Position, PositionComponent};
use values::specified::position::{Side, VerticalPosition};
use values::specified::url::SpecifiedUrl;
use values::specified::LengthOrPercentage;
use values::specified::SVGPathData;
/// A specified alias for FillRule.
pub use values::generics::basic_shape::FillRule;

View file

@ -16,8 +16,8 @@ use values::generics::border::BorderRadius as GenericBorderRadius;
use values::generics::border::BorderSpacing as GenericBorderSpacing;
use values::generics::rect::Rect;
use values::generics::size::Size;
use values::specified::{AllowQuirks, Number, NumberOrPercentage};
use values::specified::length::{Length, LengthOrPercentage, NonNegativeLength};
use values::specified::{AllowQuirks, Number, NumberOrPercentage};
/// A specified value for a single side of the `border-width` property.
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]

View file

@ -4,20 +4,22 @@
//! Specified types for box properties.
use Atom;
use cssparser::Parser;
use custom_properties::Name as CustomPropertyName;
use parser::{Parse, ParserContext};
use properties::{LonghandId, ShorthandId, PropertyId, PropertyFlags, PropertyDeclarationId};
use properties::{LonghandId, PropertyDeclarationId, PropertyFlags, PropertyId, ShorthandId};
use selectors::parser::SelectorParseErrorKind;
use std::fmt::{self, Write};
use style_traits::{CssWriter, KeywordsCollectFn, ParseError, StyleParseErrorKind, SpecifiedValueInfo, ToCss};
use values::{CustomIdent, KeyframesName};
use style_traits::{
CssWriter, KeywordsCollectFn, ParseError, SpecifiedValueInfo, StyleParseErrorKind, ToCss,
};
use values::generics::box_::AnimationIterationCount as GenericAnimationIterationCount;
use values::generics::box_::Perspective as GenericPerspective;
use values::generics::box_::VerticalAlign as GenericVerticalAlign;
use values::specified::{AllowQuirks, Number};
use values::specified::length::{LengthOrPercentage, NonNegativeLength};
use values::specified::{AllowQuirks, Number};
use values::{CustomIdent, KeyframesName};
use Atom;
fn in_ua_or_chrome_sheet(context: &ParserContext) -> bool {
use stylesheets::Origin;

View file

@ -9,13 +9,13 @@
use cssparser::{AngleOrNumber, NumberOrPercentage, Parser, Token};
use parser::ParserContext;
use std::fmt::{self, Write};
use style_traits::{CssWriter, ParseError, SpecifiedValueInfo, StyleParseErrorKind, ToCss};
use style_traits::values::specified::AllowedNumericType;
use values::{CSSFloat, CSSInteger};
use style_traits::{CssWriter, ParseError, SpecifiedValueInfo, StyleParseErrorKind, ToCss};
use values::computed;
use values::specified::{Angle, Time};
use values::specified::length::{AbsoluteLength, FontRelativeLength, NoCalcLength};
use values::specified::length::ViewportPercentageLength;
use values::specified::length::{AbsoluteLength, FontRelativeLength, NoCalcLength};
use values::specified::{Angle, Time};
use values::{CSSFloat, CSSInteger};
/// A node inside a `Calc` expression's AST.
#[derive(Clone, Debug)]

Some files were not shown because too many files have changed in this diff Show more