mirror of
https://github.com/servo/servo.git
synced 2025-08-23 22:35:33 +01:00
Reorder imports
This commit is contained in:
parent
4a947dd719
commit
9e92eb205a
546 changed files with 1968 additions and 1536 deletions
|
@ -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]) => {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue