style: Manually extinguish multi-line use statements.

This commit is contained in:
Emilio Cobos Álvarez 2018-11-10 21:26:46 +01:00
parent 212b3e1311
commit bd9c53c5da
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
19 changed files with 46 additions and 67 deletions

View file

@ -14,12 +14,12 @@ use crate::shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
use crate::str::CssStringWriter; use crate::str::CssStringWriter;
use crate::values::computed::font::FamilyName; use crate::values::computed::font::FamilyName;
use crate::values::generics::font::FontStyle as GenericFontStyle; use crate::values::generics::font::FontStyle as GenericFontStyle;
use crate::values::specified::font::SpecifiedFontStyle;
use crate::values::specified::font::{AbsoluteFontWeight, FontStretch};
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]
use crate::values::specified::font::{ use crate::values::specified::font::SpecifiedFontFeatureSettings;
SpecifiedFontFeatureSettings, SpecifiedFontVariationSettings, 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::url::SpecifiedUrl;
use crate::values::specified::Angle; use crate::values::specified::Angle;
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]

View file

@ -38,9 +38,8 @@ use crate::rule_tree::StrongRuleNode;
use crate::shared_lock::Locked; use crate::shared_lock::Locked;
use crate::stylesheets::keyframes_rule::Keyframe; use crate::stylesheets::keyframes_rule::Keyframe;
use crate::stylesheets::{CounterStyleRule, CssRules, FontFaceRule, FontFeatureValuesRule}; use crate::stylesheets::{CounterStyleRule, CssRules, FontFaceRule, FontFeatureValuesRule};
use crate::stylesheets::{ use crate::stylesheets::{DocumentRule, ImportRule, KeyframesRule, MediaRule};
DocumentRule, ImportRule, KeyframesRule, MediaRule, NamespaceRule, PageRule, use crate::stylesheets::{NamespaceRule, PageRule};
};
use crate::stylesheets::{StyleRule, StylesheetContents, SupportsRule}; use crate::stylesheets::{StyleRule, StylesheetContents, SupportsRule};
use servo_arc::{Arc, ArcBorrow}; use servo_arc::{Arc, ArcBorrow};
use std::{mem, ptr}; use std::{mem, ptr};

View file

@ -18,9 +18,8 @@ use crate::stylesheets::{Origin, RulesMutateError};
use crate::values::computed::image::LineDirection; use crate::values::computed::image::LineDirection;
use crate::values::computed::url::ComputedImageUrl; use crate::values::computed::url::ComputedImageUrl;
use crate::values::computed::{Angle, CalcLengthOrPercentage, Gradient, Image}; use crate::values::computed::{Angle, CalcLengthOrPercentage, Gradient, Image};
use crate::values::computed::{ use crate::values::computed::{Integer, LengthOrPercentage};
Integer, LengthOrPercentage, LengthOrPercentageOrAuto, NonNegativeLengthOrPercentageOrAuto, use crate::values::computed::{LengthOrPercentageOrAuto, NonNegativeLengthOrPercentageOrAuto};
};
use crate::values::computed::{Percentage, TextAlign}; use crate::values::computed::{Percentage, TextAlign};
use crate::values::generics::box_::VerticalAlign; use crate::values::generics::box_::VerticalAlign;
use crate::values::generics::grid::{TrackListValue, TrackSize}; use crate::values::generics::grid::{TrackListValue, TrackSize};

View file

@ -5,10 +5,7 @@
//! Global style data //! Global style data
use crate::context::StyleSystemOptions; use crate::context::StyleSystemOptions;
use crate::gecko_bindings::bindings::Gecko_SetJemallocThreadLocalArena; use crate::gecko_bindings::bindings;
use crate::gecko_bindings::bindings::{
Gecko_RegisterProfilerThread, Gecko_UnregisterProfilerThread,
};
use crate::parallel::STYLE_THREAD_STACK_SIZE_KB; use crate::parallel::STYLE_THREAD_STACK_SIZE_KB;
use crate::shared_lock::SharedRwLock; use crate::shared_lock::SharedRwLock;
use crate::thread_state; use crate::thread_state;
@ -43,20 +40,20 @@ fn thread_name(index: usize) -> String {
fn thread_startup(index: usize) { fn thread_startup(index: usize) {
thread_state::initialize_layout_worker_thread(); thread_state::initialize_layout_worker_thread();
unsafe { unsafe {
Gecko_SetJemallocThreadLocalArena(true); bindings::Gecko_SetJemallocThreadLocalArena(true);
} }
let name = thread_name(index); let name = thread_name(index);
let name = CString::new(name).unwrap(); let name = CString::new(name).unwrap();
unsafe { unsafe {
// Gecko_RegisterProfilerThread copies the passed name here. // Gecko_RegisterProfilerThread copies the passed name here.
Gecko_RegisterProfilerThread(name.as_ptr()); bindings::Gecko_RegisterProfilerThread(name.as_ptr());
} }
} }
fn thread_shutdown(_: usize) { fn thread_shutdown(_: usize) {
unsafe { unsafe {
Gecko_UnregisterProfilerThread(); bindings::Gecko_UnregisterProfilerThread();
Gecko_SetJemallocThreadLocalArena(false); bindings::Gecko_SetJemallocThreadLocalArena(false);
} }
} }

View file

@ -14,13 +14,12 @@ use crate::gecko_bindings::sugar::ns_style_coord::{CoordData, CoordDataMut, Coor
use crate::media_queries::Device; use crate::media_queries::Device;
use crate::values::computed::basic_shape::ShapeRadius as ComputedShapeRadius; use crate::values::computed::basic_shape::ShapeRadius as ComputedShapeRadius;
use crate::values::computed::FlexBasis as ComputedFlexBasis; use crate::values::computed::FlexBasis as ComputedFlexBasis;
use crate::values::computed::NonNegativeNumber;
use crate::values::computed::{Angle, ExtremumLength, Length, LengthOrPercentage}; use crate::values::computed::{Angle, ExtremumLength, Length, LengthOrPercentage};
use crate::values::computed::{LengthOrPercentageOrAuto, Percentage}; use crate::values::computed::{LengthOrPercentageOrAuto, Percentage};
use crate::values::computed::{LengthOrPercentageOrNone, Number, NumberOrPercentage}; use crate::values::computed::{LengthOrPercentageOrNone, Number, NumberOrPercentage};
use crate::values::computed::{MaxLength as ComputedMaxLength, MozLength as ComputedMozLength}; use crate::values::computed::{MaxLength as ComputedMaxLength, MozLength as ComputedMozLength};
use crate::values::computed::{ use crate::values::computed::{NonNegativeLength, NonNegativeLengthOrPercentage};
NonNegativeLength, NonNegativeLengthOrPercentage, NonNegativeNumber,
};
use crate::values::generics::basic_shape::ShapeRadius; use crate::values::generics::basic_shape::ShapeRadius;
use crate::values::generics::box_::Perspective; use crate::values::generics::box_::Perspective;
use crate::values::generics::flex::FlexBasis; use crate::values::generics::flex::FlexBasis;

View file

@ -6,9 +6,8 @@
use crate::gecko_bindings::bindings; use crate::gecko_bindings::bindings;
use crate::gecko_bindings::structs::{nsStyleCoord, nsStyleCoord_Calc, nsStyleCoord_CalcValue}; use crate::gecko_bindings::structs::{nsStyleCoord, nsStyleCoord_Calc, nsStyleCoord_CalcValue};
use crate::gecko_bindings::structs::{ use crate::gecko_bindings::structs::{nsStyleCorners, nsStyleSides};
nsStyleCorners, nsStyleSides, nsStyleUnion, nsStyleUnit, nscoord, use crate::gecko_bindings::structs::{nsStyleUnion, nsStyleUnit, nscoord};
};
use std::mem; use std::mem;
impl nsStyleCoord { impl nsStyleCoord {

View file

@ -13,9 +13,8 @@ use crate::invalidation::element::document_state::InvalidationMatchingData;
use crate::invalidation::element::element_wrapper::ElementSnapshot; use crate::invalidation::element::element_wrapper::ElementSnapshot;
use crate::properties::longhands::display::computed_value::T as Display; use crate::properties::longhands::display::computed_value::T as Display;
use crate::properties::{ComputedValues, PropertyFlags}; use crate::properties::{ComputedValues, PropertyFlags};
use crate::selector_parser::{ use crate::selector_parser::AttrValue as SelectorAttrValue;
AttrValue as SelectorAttrValue, PseudoElementCascadeType, SelectorParser, use crate::selector_parser::{PseudoElementCascadeType, SelectorParser};
};
use crate::{Atom, CaseSensitivityExt, LocalName, Namespace, Prefix}; use crate::{Atom, CaseSensitivityExt, LocalName, Namespace, Prefix};
use cssparser::{serialize_identifier, CowRcStr, Parser as CssParser, SourceLocation, ToCss}; use cssparser::{serialize_identifier, CowRcStr, Parser as CssParser, SourceLocation, ToCss};
use fxhash::FxHashMap; use fxhash::FxHashMap;

View file

@ -15,9 +15,8 @@ use crate::rule_tree::StrongRuleNode;
use crate::selector_parser::{PseudoElement, SelectorImpl}; use crate::selector_parser::{PseudoElement, SelectorImpl};
use crate::stylist::RuleInclusion; use crate::stylist::RuleInclusion;
use log::Level::Trace; use log::Level::Trace;
use selectors::matching::{ use selectors::matching::{ElementSelectorFlags, MatchingContext};
ElementSelectorFlags, MatchingContext, MatchingMode, VisitedHandlingMode, use selectors::matching::{MatchingMode, VisitedHandlingMode};
};
use servo_arc::Arc; use servo_arc::Arc;
/// Whether pseudo-elements should be resolved or not. /// Whether pseudo-elements should be resolved or not.

View file

@ -7,9 +7,8 @@ use crate::error_reporting::{ContextualParseError, ParseErrorReporter};
use crate::invalidation::media_queries::{MediaListKey, ToMediaListKey}; use crate::invalidation::media_queries::{MediaListKey, ToMediaListKey};
use crate::media_queries::{Device, MediaList}; use crate::media_queries::{Device, MediaList};
use crate::parser::ParserContext; use crate::parser::ParserContext;
use crate::shared_lock::{ use crate::shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked};
DeepCloneParams, DeepCloneWithLock, Locked, SharedRwLock, SharedRwLockReadGuard, use crate::shared_lock::{SharedRwLock, SharedRwLockReadGuard};
};
use crate::stylesheets::loader::StylesheetLoader; use crate::stylesheets::loader::StylesheetLoader;
use crate::stylesheets::rule_parser::{State, TopLevelRuleParser}; use crate::stylesheets::rule_parser::{State, TopLevelRuleParser};
use crate::stylesheets::rules_iterator::{EffectiveRules, EffectiveRulesIterator}; use crate::stylesheets::rules_iterator::{EffectiveRules, EffectiveRulesIterator};

View file

@ -13,9 +13,8 @@ use crate::gecko_bindings::{bindings, structs};
use crate::values::animated::{ToAnimatedValue, ToAnimatedZero}; use crate::values::animated::{ToAnimatedValue, ToAnimatedZero};
use crate::values::computed::{Angle, Context, Integer, NonNegativeLength, NonNegativePercentage}; use crate::values::computed::{Angle, Context, Integer, NonNegativeLength, NonNegativePercentage};
use crate::values::computed::{Number, Percentage, ToComputedValue}; use crate::values::computed::{Number, Percentage, ToComputedValue};
use crate::values::generics::font::{ use crate::values::generics::font as generics;
self as generics, FeatureTagValue, FontSettings, VariationValue, 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::font::{self as specified, MAX_FONT_WEIGHT, MIN_FONT_WEIGHT};
use crate::values::specified::length::{FontBaseSize, NoCalcLength}; use crate::values::specified::length::{FontBaseSize, NoCalcLength};
use crate::values::CSSFloat; use crate::values::CSSFloat;
@ -30,9 +29,8 @@ use std::slice;
use style_traits::{CssWriter, ParseError, ToCss}; use style_traits::{CssWriter, ParseError, ToCss};
pub use crate::values::computed::Length as MozScriptMinSize; pub use crate::values::computed::Length as MozScriptMinSize;
pub use crate::values::specified::font::{ pub use crate::values::specified::font::{FontSynthesis, MozScriptSizeMultiplier};
FontSynthesis, MozScriptSizeMultiplier, XLang, XTextZoom, pub use crate::values::specified::font::{XLang, XTextZoom};
};
/// A value for the font-weight property per: /// A value for the font-weight property per:
/// ///

View file

@ -8,9 +8,8 @@ use super::{Context, Number, Percentage, ToComputedValue};
use app_units::Au; use app_units::Au;
use crate::values::animated::{Animate, Procedure, ToAnimatedValue, ToAnimatedZero}; use crate::values::animated::{Animate, Procedure, ToAnimatedValue, ToAnimatedZero};
use crate::values::distance::{ComputeSquaredDistance, SquaredDistance}; use crate::values::distance::{ComputeSquaredDistance, SquaredDistance};
use crate::values::generics::length::{ use crate::values::generics::length::MaxLength as GenericMaxLength;
MaxLength as GenericMaxLength, MozLength as GenericMozLength, use crate::values::generics::length::MozLength as GenericMozLength;
};
use crate::values::generics::transform::IsZeroLength; use crate::values::generics::transform::IsZeroLength;
use crate::values::generics::NonNegative; use crate::values::generics::NonNegative;
use crate::values::specified::length::ViewportPercentageLength; use crate::values::specified::length::ViewportPercentageLength;

View file

@ -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::LineHeight as GenericLineHeight;
use crate::values::generics::text::MozTabSize as GenericMozTabSize; use crate::values::generics::text::MozTabSize as GenericMozTabSize;
use crate::values::generics::text::Spacing; use crate::values::generics::text::Spacing;
use crate::values::specified::text::{ use crate::values::specified::text::TextOverflowSide;
TextEmphasisFillMode, TextEmphasisShapeKeyword, TextOverflowSide, use crate::values::specified::text::{TextEmphasisFillMode, TextEmphasisShapeKeyword};
};
use crate::values::{CSSFloat, CSSInteger}; use crate::values::{CSSFloat, CSSInteger};
use std::fmt::{self, Write}; use std::fmt::{self, Write};
use style_traits::{CssWriter, ToCss}; use style_traits::{CssWriter, ToCss};

View file

@ -6,9 +6,8 @@
use crate::custom_properties::Name as CustomPropertyName; use crate::custom_properties::Name as CustomPropertyName;
use crate::parser::{Parse, ParserContext}; use crate::parser::{Parse, ParserContext};
use crate::properties::{ use crate::properties::{LonghandId, PropertyDeclarationId, PropertyFlags};
LonghandId, PropertyDeclarationId, PropertyFlags, PropertyId, ShorthandId, use crate::properties::{PropertyId, ShorthandId};
};
use crate::values::generics::box_::AnimationIterationCount as GenericAnimationIterationCount; use crate::values::generics::box_::AnimationIterationCount as GenericAnimationIterationCount;
use crate::values::generics::box_::Perspective as GenericPerspective; use crate::values::generics::box_::Perspective as GenericPerspective;
use crate::values::generics::box_::VerticalAlign as GenericVerticalAlign; use crate::values::generics::box_::VerticalAlign as GenericVerticalAlign;

View file

@ -7,9 +7,8 @@
use crate::parser::{Parse, ParserContext}; use crate::parser::{Parse, ParserContext};
use crate::values::computed::effects::BoxShadow as ComputedBoxShadow; use crate::values::computed::effects::BoxShadow as ComputedBoxShadow;
use crate::values::computed::effects::SimpleShadow as ComputedSimpleShadow; use crate::values::computed::effects::SimpleShadow as ComputedSimpleShadow;
use crate::values::computed::{ use crate::values::computed::NonNegativeNumber as ComputedNonNegativeNumber;
Context, NonNegativeNumber as ComputedNonNegativeNumber, ToComputedValue, use crate::values::computed::{Context, ToComputedValue};
};
use crate::values::generics::effects::BoxShadow as GenericBoxShadow; use crate::values::generics::effects::BoxShadow as GenericBoxShadow;
use crate::values::generics::effects::Filter as GenericFilter; use crate::values::generics::effects::Filter as GenericFilter;
use crate::values::generics::effects::SimpleShadow as GenericSimpleShadow; use crate::values::generics::effects::SimpleShadow as GenericSimpleShadow;

View file

@ -11,10 +11,9 @@ use crate::gecko_bindings::bindings;
use crate::parser::{Parse, ParserContext}; use crate::parser::{Parse, ParserContext};
use crate::properties::longhands::system_font::SystemFont; use crate::properties::longhands::system_font::SystemFont;
use crate::values::computed::font::{FamilyName, FontFamilyList, FontStyleAngle, SingleFontFamily}; use crate::values::computed::font::{FamilyName, FontFamilyList, FontStyleAngle, SingleFontFamily};
use crate::values::computed::{ use crate::values::computed::{font as computed, Length, NonNegativeLength};
font as computed, Context, Length, NonNegativeLength, ToComputedValue,
};
use crate::values::computed::{Angle as ComputedAngle, Percentage as ComputedPercentage}; 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::{self as generics, FeatureTagValue, FontSettings, FontTag};
use crate::values::generics::font::{KeywordSize, VariationValue}; use crate::values::generics::font::{KeywordSize, VariationValue};
use crate::values::generics::NonNegative; use crate::values::generics::NonNegative;

View file

@ -11,9 +11,8 @@ use app_units::Au;
use crate::font_metrics::FontMetricsQueryResult; use crate::font_metrics::FontMetricsQueryResult;
use crate::parser::{Parse, ParserContext}; use crate::parser::{Parse, ParserContext};
use crate::values::computed::{self, CSSPixelLength, Context, ExtremumLength}; use crate::values::computed::{self, CSSPixelLength, Context, ExtremumLength};
use crate::values::generics::length::{ use crate::values::generics::length::MaxLength as GenericMaxLength;
MaxLength as GenericMaxLength, MozLength as GenericMozLength, use crate::values::generics::length::MozLength as GenericMozLength;
};
use crate::values::generics::transform::IsZeroLength; use crate::values::generics::transform::IsZeroLength;
use crate::values::generics::NonNegative; use crate::values::generics::NonNegative;
use crate::values::specified::calc::CalcNode; use crate::values::specified::calc::CalcNode;

View file

@ -10,9 +10,8 @@
use crate::hash::FxHashMap; use crate::hash::FxHashMap;
use crate::parser::{Parse, ParserContext}; use crate::parser::{Parse, ParserContext};
use crate::str::HTML_SPACE_CHARACTERS; use crate::str::HTML_SPACE_CHARACTERS;
use crate::values::computed::{ use crate::values::computed::CalcLengthOrPercentage;
CalcLengthOrPercentage, LengthOrPercentage as ComputedLengthOrPercentage, use crate::values::computed::LengthOrPercentage as ComputedLengthOrPercentage;
};
use crate::values::computed::{Context, Percentage, ToComputedValue}; use crate::values::computed::{Context, Percentage, ToComputedValue};
use crate::values::generics::position::Position as GenericPosition; use crate::values::generics::position::Position as GenericPosition;
use crate::values::generics::position::ZIndex as GenericZIndex; use crate::values::generics::position::ZIndex as GenericZIndex;

View file

@ -8,9 +8,8 @@ use crate::parser::{Parse, ParserContext};
use crate::values::generics::svg as generic; use crate::values::generics::svg as generic;
use crate::values::specified::color::Color; use crate::values::specified::color::Color;
use crate::values::specified::url::SpecifiedUrl; use crate::values::specified::url::SpecifiedUrl;
use crate::values::specified::{ use crate::values::specified::LengthOrPercentage;
LengthOrPercentage, NonNegativeLengthOrPercentage, NonNegativeNumber, use crate::values::specified::{NonNegativeLengthOrPercentage, NonNegativeNumber};
};
use crate::values::specified::{Number, Opacity}; use crate::values::specified::{Number, Opacity};
use crate::values::CustomIdent; use crate::values::CustomIdent;
use cssparser::Parser; use cssparser::Parser;

View file

@ -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::LineHeight as GenericLineHeight;
use crate::values::generics::text::MozTabSize as GenericMozTabSize; use crate::values::generics::text::MozTabSize as GenericMozTabSize;
use crate::values::generics::text::Spacing; use crate::values::generics::text::Spacing;
use crate::values::specified::length::{ use crate::values::specified::length::{FontRelativeLength, Length};
FontRelativeLength, Length, LengthOrPercentage, NoCalcLength, use crate::values::specified::length::{LengthOrPercentage, NoCalcLength};
};
use crate::values::specified::length::{NonNegativeLength, NonNegativeLengthOrPercentage}; use crate::values::specified::length::{NonNegativeLength, NonNegativeLengthOrPercentage};
use crate::values::specified::{AllowQuirks, Integer, NonNegativeNumber, Number}; use crate::values::specified::{AllowQuirks, Integer, NonNegativeNumber, Number};
use cssparser::{Parser, Token}; use cssparser::{Parser, Token};