diff --git a/servo/components/style/font_face.rs b/servo/components/style/font_face.rs index 8b3e3c865cbe..c434e0957c67 100644 --- a/servo/components/style/font_face.rs +++ b/servo/components/style/font_face.rs @@ -14,12 +14,12 @@ use crate::shared_lock::{SharedRwLockReadGuard, ToCssWithGuard}; use crate::str::CssStringWriter; use crate::values::computed::font::FamilyName; use crate::values::generics::font::FontStyle as GenericFontStyle; -use crate::values::specified::font::SpecifiedFontStyle; -use crate::values::specified::font::{AbsoluteFontWeight, FontStretch}; #[cfg(feature = "gecko")] -use crate::values::specified::font::{ - SpecifiedFontFeatureSettings, SpecifiedFontVariationSettings, -}; +use crate::values::specified::font::SpecifiedFontFeatureSettings; +use crate::values::specified::font::SpecifiedFontStyle; +#[cfg(feature = "gecko")] +use crate::values::specified::font::SpecifiedFontVariationSettings; +use crate::values::specified::font::{AbsoluteFontWeight, FontStretch}; use crate::values::specified::url::SpecifiedUrl; use crate::values::specified::Angle; #[cfg(feature = "gecko")] diff --git a/servo/components/style/gecko/arc_types.rs b/servo/components/style/gecko/arc_types.rs index 5ce096270f20..b2f86f477e0d 100644 --- a/servo/components/style/gecko/arc_types.rs +++ b/servo/components/style/gecko/arc_types.rs @@ -38,9 +38,8 @@ use crate::rule_tree::StrongRuleNode; use crate::shared_lock::Locked; use crate::stylesheets::keyframes_rule::Keyframe; use crate::stylesheets::{CounterStyleRule, CssRules, FontFaceRule, FontFeatureValuesRule}; -use crate::stylesheets::{ - DocumentRule, ImportRule, KeyframesRule, MediaRule, NamespaceRule, PageRule, -}; +use crate::stylesheets::{DocumentRule, ImportRule, KeyframesRule, MediaRule}; +use crate::stylesheets::{NamespaceRule, PageRule}; use crate::stylesheets::{StyleRule, StylesheetContents, SupportsRule}; use servo_arc::{Arc, ArcBorrow}; use std::{mem, ptr}; diff --git a/servo/components/style/gecko/conversions.rs b/servo/components/style/gecko/conversions.rs index 1611e286e6e1..cf8c1de1ba1c 100644 --- a/servo/components/style/gecko/conversions.rs +++ b/servo/components/style/gecko/conversions.rs @@ -18,9 +18,8 @@ use crate::stylesheets::{Origin, RulesMutateError}; use crate::values::computed::image::LineDirection; use crate::values::computed::url::ComputedImageUrl; use crate::values::computed::{Angle, CalcLengthOrPercentage, Gradient, Image}; -use crate::values::computed::{ - Integer, LengthOrPercentage, LengthOrPercentageOrAuto, NonNegativeLengthOrPercentageOrAuto, -}; +use crate::values::computed::{Integer, LengthOrPercentage}; +use crate::values::computed::{LengthOrPercentageOrAuto, NonNegativeLengthOrPercentageOrAuto}; use crate::values::computed::{Percentage, TextAlign}; use crate::values::generics::box_::VerticalAlign; use crate::values::generics::grid::{TrackListValue, TrackSize}; diff --git a/servo/components/style/gecko/global_style_data.rs b/servo/components/style/gecko/global_style_data.rs index 70cd452f9040..7e40d12e5f63 100644 --- a/servo/components/style/gecko/global_style_data.rs +++ b/servo/components/style/gecko/global_style_data.rs @@ -5,10 +5,7 @@ //! Global style data use crate::context::StyleSystemOptions; -use crate::gecko_bindings::bindings::Gecko_SetJemallocThreadLocalArena; -use crate::gecko_bindings::bindings::{ - Gecko_RegisterProfilerThread, Gecko_UnregisterProfilerThread, -}; +use crate::gecko_bindings::bindings; use crate::parallel::STYLE_THREAD_STACK_SIZE_KB; use crate::shared_lock::SharedRwLock; use crate::thread_state; @@ -43,20 +40,20 @@ fn thread_name(index: usize) -> String { fn thread_startup(index: usize) { thread_state::initialize_layout_worker_thread(); unsafe { - Gecko_SetJemallocThreadLocalArena(true); + bindings::Gecko_SetJemallocThreadLocalArena(true); } let name = thread_name(index); let name = CString::new(name).unwrap(); unsafe { // Gecko_RegisterProfilerThread copies the passed name here. - Gecko_RegisterProfilerThread(name.as_ptr()); + bindings::Gecko_RegisterProfilerThread(name.as_ptr()); } } fn thread_shutdown(_: usize) { unsafe { - Gecko_UnregisterProfilerThread(); - Gecko_SetJemallocThreadLocalArena(false); + bindings::Gecko_UnregisterProfilerThread(); + bindings::Gecko_SetJemallocThreadLocalArena(false); } } diff --git a/servo/components/style/gecko/values.rs b/servo/components/style/gecko/values.rs index 16236b025c24..f7debc860f38 100644 --- a/servo/components/style/gecko/values.rs +++ b/servo/components/style/gecko/values.rs @@ -14,13 +14,12 @@ use crate::gecko_bindings::sugar::ns_style_coord::{CoordData, CoordDataMut, Coor use crate::media_queries::Device; use crate::values::computed::basic_shape::ShapeRadius as ComputedShapeRadius; use crate::values::computed::FlexBasis as ComputedFlexBasis; +use crate::values::computed::NonNegativeNumber; use crate::values::computed::{Angle, ExtremumLength, Length, LengthOrPercentage}; use crate::values::computed::{LengthOrPercentageOrAuto, Percentage}; use crate::values::computed::{LengthOrPercentageOrNone, Number, NumberOrPercentage}; use crate::values::computed::{MaxLength as ComputedMaxLength, MozLength as ComputedMozLength}; -use crate::values::computed::{ - NonNegativeLength, NonNegativeLengthOrPercentage, NonNegativeNumber, -}; +use crate::values::computed::{NonNegativeLength, NonNegativeLengthOrPercentage}; use crate::values::generics::basic_shape::ShapeRadius; use crate::values::generics::box_::Perspective; use crate::values::generics::flex::FlexBasis; diff --git a/servo/components/style/gecko_bindings/sugar/ns_style_coord.rs b/servo/components/style/gecko_bindings/sugar/ns_style_coord.rs index 90d2440010da..e4958999b286 100644 --- a/servo/components/style/gecko_bindings/sugar/ns_style_coord.rs +++ b/servo/components/style/gecko_bindings/sugar/ns_style_coord.rs @@ -6,9 +6,8 @@ use crate::gecko_bindings::bindings; use crate::gecko_bindings::structs::{nsStyleCoord, nsStyleCoord_Calc, nsStyleCoord_CalcValue}; -use crate::gecko_bindings::structs::{ - nsStyleCorners, nsStyleSides, nsStyleUnion, nsStyleUnit, nscoord, -}; +use crate::gecko_bindings::structs::{nsStyleCorners, nsStyleSides}; +use crate::gecko_bindings::structs::{nsStyleUnion, nsStyleUnit, nscoord}; use std::mem; impl nsStyleCoord { diff --git a/servo/components/style/servo/selector_parser.rs b/servo/components/style/servo/selector_parser.rs index a959a820edc3..b71d81c29782 100644 --- a/servo/components/style/servo/selector_parser.rs +++ b/servo/components/style/servo/selector_parser.rs @@ -13,9 +13,8 @@ use crate::invalidation::element::document_state::InvalidationMatchingData; use crate::invalidation::element::element_wrapper::ElementSnapshot; use crate::properties::longhands::display::computed_value::T as Display; use crate::properties::{ComputedValues, PropertyFlags}; -use crate::selector_parser::{ - AttrValue as SelectorAttrValue, PseudoElementCascadeType, SelectorParser, -}; +use crate::selector_parser::AttrValue as SelectorAttrValue; +use crate::selector_parser::{PseudoElementCascadeType, SelectorParser}; use crate::{Atom, CaseSensitivityExt, LocalName, Namespace, Prefix}; use cssparser::{serialize_identifier, CowRcStr, Parser as CssParser, SourceLocation, ToCss}; use fxhash::FxHashMap; diff --git a/servo/components/style/style_resolver.rs b/servo/components/style/style_resolver.rs index 515f9ad39a94..b96d6d871f4b 100644 --- a/servo/components/style/style_resolver.rs +++ b/servo/components/style/style_resolver.rs @@ -15,9 +15,8 @@ use crate::rule_tree::StrongRuleNode; use crate::selector_parser::{PseudoElement, SelectorImpl}; use crate::stylist::RuleInclusion; use log::Level::Trace; -use selectors::matching::{ - ElementSelectorFlags, MatchingContext, MatchingMode, VisitedHandlingMode, -}; +use selectors::matching::{ElementSelectorFlags, MatchingContext}; +use selectors::matching::{MatchingMode, VisitedHandlingMode}; use servo_arc::Arc; /// Whether pseudo-elements should be resolved or not. diff --git a/servo/components/style/stylesheets/stylesheet.rs b/servo/components/style/stylesheets/stylesheet.rs index 2749225f2aa7..81e42f3da7e3 100644 --- a/servo/components/style/stylesheets/stylesheet.rs +++ b/servo/components/style/stylesheets/stylesheet.rs @@ -7,9 +7,8 @@ use crate::error_reporting::{ContextualParseError, ParseErrorReporter}; use crate::invalidation::media_queries::{MediaListKey, ToMediaListKey}; use crate::media_queries::{Device, MediaList}; use crate::parser::ParserContext; -use crate::shared_lock::{ - DeepCloneParams, DeepCloneWithLock, Locked, SharedRwLock, SharedRwLockReadGuard, -}; +use crate::shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked}; +use crate::shared_lock::{SharedRwLock, SharedRwLockReadGuard}; use crate::stylesheets::loader::StylesheetLoader; use crate::stylesheets::rule_parser::{State, TopLevelRuleParser}; use crate::stylesheets::rules_iterator::{EffectiveRules, EffectiveRulesIterator}; diff --git a/servo/components/style/values/computed/font.rs b/servo/components/style/values/computed/font.rs index ec3305be277e..058c211a802c 100644 --- a/servo/components/style/values/computed/font.rs +++ b/servo/components/style/values/computed/font.rs @@ -13,9 +13,8 @@ use crate::gecko_bindings::{bindings, structs}; use crate::values::animated::{ToAnimatedValue, ToAnimatedZero}; use crate::values::computed::{Angle, Context, Integer, NonNegativeLength, NonNegativePercentage}; use crate::values::computed::{Number, Percentage, ToComputedValue}; -use crate::values::generics::font::{ - self as generics, FeatureTagValue, FontSettings, VariationValue, -}; +use crate::values::generics::font as generics; +use crate::values::generics::font::{FeatureTagValue, FontSettings, VariationValue}; use crate::values::specified::font::{self as specified, MAX_FONT_WEIGHT, MIN_FONT_WEIGHT}; use crate::values::specified::length::{FontBaseSize, NoCalcLength}; use crate::values::CSSFloat; @@ -30,9 +29,8 @@ use std::slice; use style_traits::{CssWriter, ParseError, ToCss}; pub use crate::values::computed::Length as MozScriptMinSize; -pub use crate::values::specified::font::{ - FontSynthesis, MozScriptSizeMultiplier, XLang, XTextZoom, -}; +pub use crate::values::specified::font::{FontSynthesis, MozScriptSizeMultiplier}; +pub use crate::values::specified::font::{XLang, XTextZoom}; /// A value for the font-weight property per: /// diff --git a/servo/components/style/values/computed/length.rs b/servo/components/style/values/computed/length.rs index 6e5488fd42f3..8060227d10e5 100644 --- a/servo/components/style/values/computed/length.rs +++ b/servo/components/style/values/computed/length.rs @@ -8,9 +8,8 @@ use super::{Context, Number, Percentage, ToComputedValue}; use app_units::Au; use crate::values::animated::{Animate, Procedure, ToAnimatedValue, ToAnimatedZero}; use crate::values::distance::{ComputeSquaredDistance, SquaredDistance}; -use crate::values::generics::length::{ - MaxLength as GenericMaxLength, MozLength as GenericMozLength, -}; +use crate::values::generics::length::MaxLength as GenericMaxLength; +use crate::values::generics::length::MozLength as GenericMozLength; use crate::values::generics::transform::IsZeroLength; use crate::values::generics::NonNegative; use crate::values::specified::length::ViewportPercentageLength; diff --git a/servo/components/style/values/computed/text.rs b/servo/components/style/values/computed/text.rs index 77bc6980f98b..40ac77b61351 100644 --- a/servo/components/style/values/computed/text.rs +++ b/servo/components/style/values/computed/text.rs @@ -12,9 +12,8 @@ use crate::values::generics::text::InitialLetter as GenericInitialLetter; use crate::values::generics::text::LineHeight as GenericLineHeight; use crate::values::generics::text::MozTabSize as GenericMozTabSize; use crate::values::generics::text::Spacing; -use crate::values::specified::text::{ - TextEmphasisFillMode, TextEmphasisShapeKeyword, TextOverflowSide, -}; +use crate::values::specified::text::TextOverflowSide; +use crate::values::specified::text::{TextEmphasisFillMode, TextEmphasisShapeKeyword}; use crate::values::{CSSFloat, CSSInteger}; use std::fmt::{self, Write}; use style_traits::{CssWriter, ToCss}; diff --git a/servo/components/style/values/specified/box.rs b/servo/components/style/values/specified/box.rs index d39aa547476c..a5761d3f9b23 100644 --- a/servo/components/style/values/specified/box.rs +++ b/servo/components/style/values/specified/box.rs @@ -6,9 +6,8 @@ use crate::custom_properties::Name as CustomPropertyName; use crate::parser::{Parse, ParserContext}; -use crate::properties::{ - LonghandId, PropertyDeclarationId, PropertyFlags, PropertyId, ShorthandId, -}; +use crate::properties::{LonghandId, PropertyDeclarationId, PropertyFlags}; +use crate::properties::{PropertyId, ShorthandId}; use crate::values::generics::box_::AnimationIterationCount as GenericAnimationIterationCount; use crate::values::generics::box_::Perspective as GenericPerspective; use crate::values::generics::box_::VerticalAlign as GenericVerticalAlign; diff --git a/servo/components/style/values/specified/effects.rs b/servo/components/style/values/specified/effects.rs index 6a6612e7a94a..bae46e70c884 100644 --- a/servo/components/style/values/specified/effects.rs +++ b/servo/components/style/values/specified/effects.rs @@ -7,9 +7,8 @@ use crate::parser::{Parse, ParserContext}; use crate::values::computed::effects::BoxShadow as ComputedBoxShadow; use crate::values::computed::effects::SimpleShadow as ComputedSimpleShadow; -use crate::values::computed::{ - Context, NonNegativeNumber as ComputedNonNegativeNumber, ToComputedValue, -}; +use crate::values::computed::NonNegativeNumber as ComputedNonNegativeNumber; +use crate::values::computed::{Context, ToComputedValue}; use crate::values::generics::effects::BoxShadow as GenericBoxShadow; use crate::values::generics::effects::Filter as GenericFilter; use crate::values::generics::effects::SimpleShadow as GenericSimpleShadow; diff --git a/servo/components/style/values/specified/font.rs b/servo/components/style/values/specified/font.rs index 2c0651bac4b4..467c7062bf3e 100644 --- a/servo/components/style/values/specified/font.rs +++ b/servo/components/style/values/specified/font.rs @@ -11,10 +11,9 @@ use crate::gecko_bindings::bindings; use crate::parser::{Parse, ParserContext}; use crate::properties::longhands::system_font::SystemFont; use crate::values::computed::font::{FamilyName, FontFamilyList, FontStyleAngle, SingleFontFamily}; -use crate::values::computed::{ - font as computed, Context, Length, NonNegativeLength, ToComputedValue, -}; +use crate::values::computed::{font as computed, Length, NonNegativeLength}; use crate::values::computed::{Angle as ComputedAngle, Percentage as ComputedPercentage}; +use crate::values::computed::{Context, ToComputedValue}; use crate::values::generics::font::{self as generics, FeatureTagValue, FontSettings, FontTag}; use crate::values::generics::font::{KeywordSize, VariationValue}; use crate::values::generics::NonNegative; diff --git a/servo/components/style/values/specified/length.rs b/servo/components/style/values/specified/length.rs index 2c8498e15bb8..942029440643 100644 --- a/servo/components/style/values/specified/length.rs +++ b/servo/components/style/values/specified/length.rs @@ -11,9 +11,8 @@ use app_units::Au; use crate::font_metrics::FontMetricsQueryResult; use crate::parser::{Parse, ParserContext}; use crate::values::computed::{self, CSSPixelLength, Context, ExtremumLength}; -use crate::values::generics::length::{ - MaxLength as GenericMaxLength, MozLength as GenericMozLength, -}; +use crate::values::generics::length::MaxLength as GenericMaxLength; +use crate::values::generics::length::MozLength as GenericMozLength; use crate::values::generics::transform::IsZeroLength; use crate::values::generics::NonNegative; use crate::values::specified::calc::CalcNode; diff --git a/servo/components/style/values/specified/position.rs b/servo/components/style/values/specified/position.rs index 62895e1ac9fd..ef0121607265 100644 --- a/servo/components/style/values/specified/position.rs +++ b/servo/components/style/values/specified/position.rs @@ -10,9 +10,8 @@ use crate::hash::FxHashMap; use crate::parser::{Parse, ParserContext}; use crate::str::HTML_SPACE_CHARACTERS; -use crate::values::computed::{ - CalcLengthOrPercentage, LengthOrPercentage as ComputedLengthOrPercentage, -}; +use crate::values::computed::CalcLengthOrPercentage; +use crate::values::computed::LengthOrPercentage as ComputedLengthOrPercentage; use crate::values::computed::{Context, Percentage, ToComputedValue}; use crate::values::generics::position::Position as GenericPosition; use crate::values::generics::position::ZIndex as GenericZIndex; diff --git a/servo/components/style/values/specified/svg.rs b/servo/components/style/values/specified/svg.rs index e1f62288c00a..4bdebc6426a6 100644 --- a/servo/components/style/values/specified/svg.rs +++ b/servo/components/style/values/specified/svg.rs @@ -8,9 +8,8 @@ use crate::parser::{Parse, ParserContext}; use crate::values::generics::svg as generic; use crate::values::specified::color::Color; use crate::values::specified::url::SpecifiedUrl; -use crate::values::specified::{ - LengthOrPercentage, NonNegativeLengthOrPercentage, NonNegativeNumber, -}; +use crate::values::specified::LengthOrPercentage; +use crate::values::specified::{NonNegativeLengthOrPercentage, NonNegativeNumber}; use crate::values::specified::{Number, Opacity}; use crate::values::CustomIdent; use cssparser::Parser; diff --git a/servo/components/style/values/specified/text.rs b/servo/components/style/values/specified/text.rs index c3f6289972cb..5ea323d59d19 100644 --- a/servo/components/style/values/specified/text.rs +++ b/servo/components/style/values/specified/text.rs @@ -15,9 +15,8 @@ use crate::values::generics::text::InitialLetter as GenericInitialLetter; use crate::values::generics::text::LineHeight as GenericLineHeight; use crate::values::generics::text::MozTabSize as GenericMozTabSize; use crate::values::generics::text::Spacing; -use crate::values::specified::length::{ - FontRelativeLength, Length, LengthOrPercentage, NoCalcLength, -}; +use crate::values::specified::length::{FontRelativeLength, Length}; +use crate::values::specified::length::{LengthOrPercentage, NoCalcLength}; use crate::values::specified::length::{NonNegativeLength, NonNegativeLengthOrPercentage}; use crate::values::specified::{AllowQuirks, Integer, NonNegativeNumber, Number}; use cssparser::{Parser, Token};