style: Some minor formatting nits.

This commit is contained in:
Emilio Cobos Álvarez 2018-11-08 01:03:45 +01:00
parent 2ea4af1171
commit 8cb5b149eb
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
11 changed files with 54 additions and 74 deletions

View file

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

View file

@ -3,29 +3,28 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* /*
* This file contains a helper macro includes all supported non-tree-structural * This file contains a helper macro includes all supported non-tree-structural
* pseudo-classes. * pseudo-classes.
* *
* FIXME: Find a way to autogenerate this file.
* FIXME: Find a way to autogenerate this file. *
* * Expected usage is as follows:
* Expected usage is as follows: * ```
* ``` * macro_rules! pseudo_class_macro{
* macro_rules! pseudo_class_macro{ * ([$(($css:expr, $name:ident, $gecko_type:tt, $state:tt, $flags:tt),)*]) => {
* ([$(($css:expr, $name:ident, $gecko_type:tt, $state:tt, $flags:tt),)*]) => { * // do stuff
* // do stuff * }
* } * }
* } * apply_non_ts_list!(pseudo_class_macro)
* apply_non_ts_list!(pseudo_class_macro) * ```
* ``` *
* * $gecko_type can be either "_" or an ident in Gecko's CSSPseudoClassType.
* $gecko_type can be either "_" or an ident in Gecko's CSSPseudoClassType. * $state can be either "_" or an expression of type ElementState. If present,
* $state can be either "_" or an expression of type ElementState. If present, * the semantics are that the pseudo-class matches if any of the bits in
* the semantics are that the pseudo-class matches if any of the bits in * $state are set on the element.
* $state are set on the element. * $flags can be either "_" or an expression of type NonTSPseudoClassFlag,
* $flags can be either "_" or an expression of type NonTSPseudoClassFlag, * see selector_parser.rs for more details.
* see selector_parser.rs for more details. */
*/
macro_rules! apply_non_ts_list { macro_rules! apply_non_ts_list {
($apply_macro:ident) => { ($apply_macro:ident) => {

View file

@ -17,13 +17,10 @@ use nsstring::{nsACString, nsCStr};
use std::cmp::max; use std::cmp::max;
use values::computed::basic_shape::ShapeRadius as ComputedShapeRadius; use values::computed::basic_shape::ShapeRadius as ComputedShapeRadius;
use values::computed::FlexBasis as ComputedFlexBasis; use values::computed::FlexBasis as ComputedFlexBasis;
use values::computed::{ use values::computed::{Angle, ExtremumLength, Length, LengthOrPercentage};
Angle, ExtremumLength, Length, LengthOrPercentage, LengthOrPercentageOrAuto, use values::computed::{LengthOrPercentageOrAuto, Percentage};
};
use values::computed::{LengthOrPercentageOrNone, Number, NumberOrPercentage}; use values::computed::{LengthOrPercentageOrNone, Number, NumberOrPercentage};
use values::computed::{ use values::computed::{MaxLength as ComputedMaxLength, MozLength as ComputedMozLength};
MaxLength as ComputedMaxLength, MozLength as ComputedMozLength, Percentage,
};
use values::computed::{NonNegativeLength, NonNegativeLengthOrPercentage, NonNegativeNumber}; use values::computed::{NonNegativeLength, NonNegativeLengthOrPercentage, NonNegativeNumber};
use values::generics::basic_shape::ShapeRadius; use values::generics::basic_shape::ShapeRadius;
use values::generics::box_::Perspective; use values::generics::box_::Perspective;

View file

@ -44,9 +44,6 @@ use gecko_bindings::bindings::Gecko_MatchLang;
use gecko_bindings::bindings::Gecko_UnsetDirtyStyleAttr; use gecko_bindings::bindings::Gecko_UnsetDirtyStyleAttr;
use gecko_bindings::bindings::Gecko_UpdateAnimations; use gecko_bindings::bindings::Gecko_UpdateAnimations;
use gecko_bindings::bindings::{Gecko_ElementState, Gecko_GetDocumentLWTheme}; 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::bindings::{Gecko_SetNodeFlags, Gecko_UnsetNodeFlags};
use gecko_bindings::structs; use gecko_bindings::structs;
use gecko_bindings::structs::nsChangeHint; use gecko_bindings::structs::nsChangeHint;
@ -384,12 +381,12 @@ impl<'ln> TNode for GeckoNode<'ln> {
#[inline] #[inline]
fn last_child(&self) -> Option<Self> { fn last_child(&self) -> Option<Self> {
unsafe { Gecko_GetLastChild(self.0).map(GeckoNode) } unsafe { bindings::Gecko_GetLastChild(self.0).map(GeckoNode) }
} }
#[inline] #[inline]
fn prev_sibling(&self) -> Option<Self> { fn prev_sibling(&self) -> Option<Self> {
unsafe { Gecko_GetPreviousSibling(self.0).map(GeckoNode) } unsafe { bindings::Gecko_GetPreviousSibling(self.0).map(GeckoNode) }
} }
#[inline] #[inline]
@ -506,7 +503,7 @@ impl<'a> Iterator for GeckoChildrenIterator<'a> {
// however we can't express this easily with bindgen, and it would // however we can't express this easily with bindgen, and it would
// introduce functions with two input lifetimes into bindgen, // introduce functions with two input lifetimes into bindgen,
// which would be out of scope for elision. // which would be out of scope for elision.
Gecko_GetNextStyleChild(&mut *(it as *mut _)).map(GeckoNode) bindings::Gecko_GetNextStyleChild(&mut *(it as *mut _)).map(GeckoNode)
}, },
} }
} }

View file

@ -5,9 +5,8 @@
//! Animation implementation for various length-related types. //! Animation implementation for various length-related types.
use super::{Animate, Procedure, ToAnimatedValue, ToAnimatedZero}; use super::{Animate, Procedure, ToAnimatedValue, ToAnimatedZero};
use values::computed::length::{ use values::computed::length::{CalcLengthOrPercentage, Length};
CalcLengthOrPercentage, Length, LengthOrPercentageOrAuto, LengthOrPercentageOrNone, use values::computed::length::{LengthOrPercentageOrAuto, LengthOrPercentageOrNone};
};
use values::computed::MaxLength as ComputedMaxLength; use values::computed::MaxLength as ComputedMaxLength;
use values::computed::MozLength as ComputedMozLength; use values::computed::MozLength as ComputedMozLength;
use values::computed::Percentage; use values::computed::Percentage;

View file

@ -37,13 +37,11 @@ pub use self::angle::Angle;
pub use self::background::{BackgroundRepeat, BackgroundSize}; pub use self::background::{BackgroundRepeat, BackgroundSize};
pub use self::basic_shape::FillRule; pub use self::basic_shape::FillRule;
pub use self::border::{BorderCornerRadius, BorderRadius, BorderSpacing}; pub use self::border::{BorderCornerRadius, BorderRadius, BorderSpacing};
pub use self::border::{ pub use self::border::{BorderImageRepeat, BorderImageSideWidth};
BorderImageRepeat, BorderImageSideWidth, BorderImageSlice, BorderImageWidth, pub use self::border::{BorderImageSlice, BorderImageWidth};
}; pub use self::box_::{AnimationIterationCount, AnimationName, Contain};
pub use self::box_::{
AnimationIterationCount, AnimationName, Contain, Display, TransitionProperty,
};
pub use self::box_::{Appearance, Clear, Float}; pub use self::box_::{Appearance, Clear, Float};
pub use self::box_::{Display, TransitionProperty};
pub use self::box_::{OverflowClipBox, OverscrollBehavior, Perspective, Resize}; pub use self::box_::{OverflowClipBox, OverscrollBehavior, Perspective, Resize};
pub use self::box_::{ScrollSnapType, TouchAction, VerticalAlign, WillChange}; pub use self::box_::{ScrollSnapType, TouchAction, VerticalAlign, WillChange};
pub use self::color::{Color, ColorPropertyValue, RGBAColor}; pub use self::color::{Color, ColorPropertyValue, RGBAColor};
@ -52,13 +50,11 @@ pub use self::counters::{Content, ContentItem, CounterIncrement, CounterReset};
pub use self::easing::TimingFunction; pub use self::easing::TimingFunction;
pub use self::effects::{BoxShadow, Filter, SimpleShadow}; pub use self::effects::{BoxShadow, Filter, SimpleShadow};
pub use self::flex::FlexBasis; pub use self::flex::FlexBasis;
pub use self::font::{ pub use self::font::{FontFamily, FontLanguageOverride, FontStyle};
FontFamily, FontLanguageOverride, FontStyle, FontVariantEastAsian, FontVariationSettings,
};
pub use self::font::{FontFeatureSettings, FontVariantLigatures, FontVariantNumeric}; pub use self::font::{FontFeatureSettings, FontVariantLigatures, FontVariantNumeric};
pub use self::font::{ pub use self::font::{FontSize, FontSizeAdjust, FontStretch, FontSynthesis};
FontSize, FontSizeAdjust, FontStretch, FontSynthesis, FontVariantAlternates, FontWeight, pub use self::font::{FontVariantAlternates, FontWeight};
}; pub use self::font::{FontVariantEastAsian, FontVariationSettings};
pub use self::font::{MozScriptLevel, MozScriptMinSize, MozScriptSizeMultiplier, XLang, XTextZoom}; pub use self::font::{MozScriptLevel, MozScriptMinSize, MozScriptSizeMultiplier, XLang, XTextZoom};
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]
pub use self::gecko::ScrollSnapPoint; pub use self::gecko::ScrollSnapPoint;
@ -81,9 +77,8 @@ pub use self::svg::{SVGLength, SVGOpacity, SVGPaint, SVGPaintKind};
pub use self::svg::{SVGPaintOrder, SVGStrokeDashArray, SVGWidth}; pub use self::svg::{SVGPaintOrder, SVGStrokeDashArray, SVGWidth};
pub use self::table::XSpan; pub use self::table::XSpan;
pub use self::text::{InitialLetter, LetterSpacing, LineHeight, MozTabSize}; pub use self::text::{InitialLetter, LetterSpacing, LineHeight, MozTabSize};
pub use self::text::{ pub use self::text::{TextAlign, TextEmphasisPosition, TextEmphasisStyle};
TextAlign, TextEmphasisPosition, TextEmphasisStyle, TextOverflow, WordSpacing, pub use self::text::{TextOverflow, WordSpacing};
};
pub use self::time::Time; pub use self::time::Time;
pub use self::transform::{Rotate, Scale, Transform, TransformOperation}; pub use self::transform::{Rotate, Scale, Transform, TransformOperation};
pub use self::transform::{TransformOrigin, TransformStyle, Translate}; pub use self::transform::{TransformOrigin, TransformStyle, Translate};

View file

@ -6,9 +6,8 @@
use values::computed::color::Color; use values::computed::color::Color;
use values::computed::url::ComputedUrl; use values::computed::url::ComputedUrl;
use values::computed::{ use values::computed::{LengthOrPercentage, NonNegativeLengthOrPercentage};
LengthOrPercentage, NonNegativeLengthOrPercentage, NonNegativeNumber, Number, Opacity, use values::computed::{NonNegativeNumber, Number, Opacity};
};
use values::generics::svg as generic; use values::generics::svg as generic;
use values::RGBA; use values::RGBA;

View file

@ -8,9 +8,8 @@
#![deny(missing_docs)] #![deny(missing_docs)]
pub use cssparser::{ pub use cssparser::{serialize_identifier, serialize_name, CowRcStr, Parser};
serialize_identifier, serialize_name, CowRcStr, Parser, SourceLocation, Token, RGBA, pub use cssparser::{SourceLocation, Token, RGBA};
};
use parser::{Parse, ParserContext}; use parser::{Parse, ParserContext};
use selectors::parser::SelectorParseErrorKind; use selectors::parser::SelectorParseErrorKind;
use std::fmt::{self, Debug, Write}; use std::fmt::{self, Debug, Write};

View file

@ -10,9 +10,8 @@ use parser::{Parse, ParserContext};
use properties::{LonghandId, PropertyDeclarationId, PropertyFlags, PropertyId, ShorthandId}; use properties::{LonghandId, PropertyDeclarationId, PropertyFlags, PropertyId, ShorthandId};
use selectors::parser::SelectorParseErrorKind; use selectors::parser::SelectorParseErrorKind;
use std::fmt::{self, Write}; use std::fmt::{self, Write};
use style_traits::{ use style_traits::{CssWriter, KeywordsCollectFn, ParseError};
CssWriter, KeywordsCollectFn, ParseError, SpecifiedValueInfo, StyleParseErrorKind, ToCss, use style_traits::{SpecifiedValueInfo, StyleParseErrorKind, ToCss};
};
use values::generics::box_::AnimationIterationCount as GenericAnimationIterationCount; use values::generics::box_::AnimationIterationCount as GenericAnimationIterationCount;
use values::generics::box_::Perspective as GenericPerspective; use values::generics::box_::Perspective as GenericPerspective;
use values::generics::box_::VerticalAlign as GenericVerticalAlign; use values::generics::box_::VerticalAlign as GenericVerticalAlign;

View file

@ -24,9 +24,8 @@ use values::generics::font::{self as generics, FeatureTagValue, FontSettings, Fo
use values::generics::font::{KeywordSize, VariationValue}; use values::generics::font::{KeywordSize, VariationValue};
use values::generics::NonNegative; use values::generics::NonNegative;
use values::specified::length::{FontBaseSize, AU_PER_PT, AU_PER_PX}; use values::specified::length::{FontBaseSize, AU_PER_PT, AU_PER_PX};
use values::specified::{ use values::specified::{AllowQuirks, Angle, Integer, LengthOrPercentage};
AllowQuirks, Angle, Integer, LengthOrPercentage, NoCalcLength, Number, Percentage, use values::specified::{NoCalcLength, Number, Percentage};
};
use values::CustomIdent; use values::CustomIdent;
use Atom; use Atom;

View file

@ -43,13 +43,11 @@ pub use self::counters::{Content, ContentItem, CounterIncrement, CounterReset};
pub use self::easing::TimingFunction; pub use self::easing::TimingFunction;
pub use self::effects::{BoxShadow, Filter, SimpleShadow}; pub use self::effects::{BoxShadow, Filter, SimpleShadow};
pub use self::flex::FlexBasis; pub use self::flex::FlexBasis;
pub use self::font::{ pub use self::font::{FontFamily, FontLanguageOverride, FontStyle};
FontFamily, FontLanguageOverride, FontStyle, FontVariantEastAsian, FontVariationSettings,
};
pub use self::font::{FontFeatureSettings, FontVariantLigatures, FontVariantNumeric}; pub use self::font::{FontFeatureSettings, FontVariantLigatures, FontVariantNumeric};
pub use self::font::{ pub use self::font::{FontSize, FontSizeAdjust, FontStretch, FontSynthesis};
FontSize, FontSizeAdjust, FontStretch, FontSynthesis, FontVariantAlternates, FontWeight, pub use self::font::{FontVariantAlternates, FontWeight};
}; pub use self::font::{FontVariantEastAsian, FontVariationSettings};
pub use self::font::{MozScriptLevel, MozScriptMinSize, MozScriptSizeMultiplier, XLang, XTextZoom}; pub use self::font::{MozScriptLevel, MozScriptMinSize, MozScriptSizeMultiplier, XLang, XTextZoom};
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]
pub use self::gecko::ScrollSnapPoint; pub use self::gecko::ScrollSnapPoint;