aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/style/custom_properties.rs6
-rw-r--r--components/style/gecko/media_queries.rs17
-rw-r--r--components/style/gecko/wrapper.rs3
-rw-r--r--components/style/gecko_bindings/sugar/ns_style_coord.rs2
-rw-r--r--components/style/rule_tree/mod.rs8
-rw-r--r--components/style/stylesheets/origin.rs6
-rw-r--r--components/style/values/animated/svg.rs2
-rw-r--r--components/style/values/computed/mod.rs2
-rw-r--r--components/style/values/computed/svg.rs4
-rw-r--r--components/style/values/computed/text.rs2
-rw-r--r--components/style/values/computed/transform.rs4
-rw-r--r--components/style/values/generics/mod.rs14
-rw-r--r--components/style/values/generics/text.rs4
-rw-r--r--components/style/values/generics/transform.rs19
-rw-r--r--components/style/values/specified/mod.rs7
-rw-r--r--components/style/values/specified/svg.rs17
-rw-r--r--components/style_derive/cg.rs6
17 files changed, 70 insertions, 53 deletions
diff --git a/components/style/custom_properties.rs b/components/style/custom_properties.rs
index 93cd3488f53..0dbd611820d 100644
--- a/components/style/custom_properties.rs
+++ b/components/style/custom_properties.rs
@@ -515,11 +515,7 @@ impl<'a> CustomPropertiesBuilder<'a> {
}
/// Cascade a given custom property declaration.
- pub fn cascade(
- &mut self,
- declaration: &'a CustomDeclaration,
- origin: Origin,
- ) {
+ pub fn cascade(&mut self, declaration: &'a CustomDeclaration, origin: Origin) {
let CustomDeclaration {
ref name,
ref value,
diff --git a/components/style/gecko/media_queries.rs b/components/style/gecko/media_queries.rs
index 3fef4974c33..4c04d9573e5 100644
--- a/components/style/gecko/media_queries.rs
+++ b/components/style/gecko/media_queries.rs
@@ -116,10 +116,7 @@ impl Device {
};
unsafe {
- bindings::Gecko_AnimationNameMayBeReferencedFromStyle(
- pc,
- name.as_atom().as_ptr(),
- )
+ bindings::Gecko_AnimationNameMayBeReferencedFromStyle(pc, name.as_atom().as_ptr())
}
}
@@ -169,7 +166,12 @@ impl Device {
#[inline]
pub fn pres_context(&self) -> Option<&structs::nsPresContext> {
unsafe {
- self.document().mPresShell.as_ref()?.mPresContext.mRawPtr.as_ref()
+ self.document()
+ .mPresShell
+ .as_ref()?
+ .mPresContext
+ .mRawPtr
+ .as_ref()
}
}
@@ -268,9 +270,8 @@ impl Device {
if doc.mIsBeingUsedAsImage() {
return true;
}
- let document_color_use = unsafe {
- structs::StaticPrefs_sVarCache_browser_display_document_color_use
- };
+ let document_color_use =
+ unsafe { structs::StaticPrefs_sVarCache_browser_display_document_color_use };
let prefs = self.pref_sheet_prefs();
match document_color_use {
1 => true,
diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs
index f5bb7d8a94c..f5058fc63c4 100644
--- a/components/style/gecko/wrapper.rs
+++ b/components/style/gecko/wrapper.rs
@@ -1246,8 +1246,7 @@ impl<'le> TElement for GeckoElement<'le> {
}
fn owner_doc_matches_for_testing(&self, device: &Device) -> bool {
- self.as_node().owner_doc().0 as *const structs::Document ==
- device.document() as *const _
+ self.as_node().owner_doc().0 as *const structs::Document == device.document() as *const _
}
fn style_attribute(&self) -> Option<ArcBorrow<Locked<PropertyDeclarationBlock>>> {
diff --git a/components/style/gecko_bindings/sugar/ns_style_coord.rs b/components/style/gecko_bindings/sugar/ns_style_coord.rs
index 133ce4d9b7b..7c6612f35ef 100644
--- a/components/style/gecko_bindings/sugar/ns_style_coord.rs
+++ b/components/style/gecko_bindings/sugar/ns_style_coord.rs
@@ -5,8 +5,8 @@
//! Rust helpers for Gecko's `nsStyleCoord`.
use crate::gecko_bindings::bindings;
-use crate::gecko_bindings::structs::{nsStyleCoord, nsStyleCoord_Calc, nsStyleCoord_CalcValue};
use crate::gecko_bindings::structs::nsStyleSides;
+use crate::gecko_bindings::structs::{nsStyleCoord, nsStyleCoord_Calc, nsStyleCoord_CalcValue};
use crate::gecko_bindings::structs::{nsStyleUnion, nsStyleUnit, nscoord};
use std::mem;
diff --git a/components/style/rule_tree/mod.rs b/components/style/rule_tree/mod.rs
index 029e3d068f9..f165e1f455f 100644
--- a/components/style/rule_tree/mod.rs
+++ b/components/style/rule_tree/mod.rs
@@ -11,7 +11,7 @@ use crate::applicable_declarations::ApplicableDeclarationList;
use crate::gecko::selector_parser::PseudoElement;
use crate::properties::{Importance, LonghandIdSet, PropertyDeclarationBlock};
use crate::shared_lock::{Locked, SharedRwLockReadGuard, StylesheetGuards};
-use crate::stylesheets::{StyleRule, Origin};
+use crate::stylesheets::{Origin, StyleRule};
use crate::thread_state;
#[cfg(feature = "gecko")]
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
@@ -663,10 +663,8 @@ impl CascadeLevel {
#[inline]
pub fn origin(&self) -> Origin {
match *self {
- CascadeLevel::UAImportant |
- CascadeLevel::UANormal => Origin::UserAgent,
- CascadeLevel::UserImportant |
- CascadeLevel::UserNormal => Origin::User,
+ CascadeLevel::UAImportant | CascadeLevel::UANormal => Origin::UserAgent,
+ CascadeLevel::UserImportant | CascadeLevel::UserNormal => Origin::User,
CascadeLevel::PresHints |
CascadeLevel::InnerShadowNormal |
CascadeLevel::SameTreeAuthorNormal |
diff --git a/components/style/stylesheets/origin.rs b/components/style/stylesheets/origin.rs
index 4e4c304baeb..fc89260abd2 100644
--- a/components/style/stylesheets/origin.rs
+++ b/components/style/stylesheets/origin.rs
@@ -76,7 +76,11 @@ impl OriginSet {
/// See the `OriginSet` documentation for information about the order
/// origins are iterated.
pub fn iter(&self) -> OriginSetIterator {
- OriginSetIterator { set: *self, cur: 0, rev: false }
+ OriginSetIterator {
+ set: *self,
+ cur: 0,
+ rev: false,
+ }
}
}
diff --git a/components/style/values/animated/svg.rs b/components/style/values/animated/svg.rs
index 15c6580cd74..436bb73d658 100644
--- a/components/style/values/animated/svg.rs
+++ b/components/style/values/animated/svg.rs
@@ -8,7 +8,7 @@ use super::{Animate, Procedure, ToAnimatedZero};
use crate::properties::animated_properties::ListAnimation;
use crate::values::animated::color::Color as AnimatedColor;
use crate::values::computed::url::ComputedUrl;
-use crate::values::distance::{SquaredDistance, ComputeSquaredDistance};
+use crate::values::distance::{ComputeSquaredDistance, SquaredDistance};
use crate::values::generics::svg::{SVGPaint, SVGStrokeDashArray};
/// Animated SVGPaint.
diff --git a/components/style/values/computed/mod.rs b/components/style/values/computed/mod.rs
index 299b8bc1ead..1f7d1e3eddc 100644
--- a/components/style/values/computed/mod.rs
+++ b/components/style/values/computed/mod.rs
@@ -76,7 +76,7 @@ pub use self::svg::{SVGLength, SVGOpacity, SVGPaint, SVGPaintKind};
pub use self::svg::{SVGPaintOrder, SVGStrokeDashArray, SVGWidth};
pub use self::table::XSpan;
pub use self::text::{InitialLetter, LetterSpacing, LineHeight};
-pub use self::text::{OverflowWrap, TextOverflow, WordSpacing, WordBreak};
+pub use self::text::{OverflowWrap, TextOverflow, WordBreak, WordSpacing};
pub use self::text::{TextAlign, TextEmphasisPosition, TextEmphasisStyle};
pub use self::time::Time;
pub use self::transform::{Rotate, Scale, Transform, TransformOperation};
diff --git a/components/style/values/computed/svg.rs b/components/style/values/computed/svg.rs
index 27d4dd6adc3..f05e9f836da 100644
--- a/components/style/values/computed/svg.rs
+++ b/components/style/values/computed/svg.rs
@@ -57,9 +57,7 @@ impl SVGWidth {
/// `1px`.
pub fn one() -> Self {
use crate::values::generics::NonNegative;
- generic::SVGLength::LengthPercentage(
- NonNegative(LengthPercentage::one()),
- )
+ generic::SVGLength::LengthPercentage(NonNegative(LengthPercentage::one()))
}
}
diff --git a/components/style/values/computed/text.rs b/components/style/values/computed/text.rs
index 783e553d1ce..65b694c5057 100644
--- a/components/style/values/computed/text.rs
+++ b/components/style/values/computed/text.rs
@@ -18,9 +18,9 @@ use crate::Zero;
use std::fmt::{self, Write};
use style_traits::{CssWriter, ToCss};
-pub use crate::values::specified::{OverflowWrap, WordBreak};
pub use crate::values::specified::TextAlignKeyword as TextAlign;
pub use crate::values::specified::TextEmphasisPosition;
+pub use crate::values::specified::{OverflowWrap, WordBreak};
/// A computed value for the `initial-letter` property.
pub type InitialLetter = GenericInitialLetter<CSSFloat, CSSInteger>;
diff --git a/components/style/values/computed/transform.rs b/components/style/values/computed/transform.rs
index cdb7fb39b47..e23ec1524ff 100644
--- a/components/style/values/computed/transform.rs
+++ b/components/style/values/computed/transform.rs
@@ -592,9 +592,7 @@ impl Translate {
/// Convert Translate to TransformOperation.
pub fn from_transform_operation(operation: &TransformOperation) -> Translate {
match *operation {
- generic::TransformOperation::Translate(tx, ty) => {
- generic::Translate::Translate(tx, ty)
- },
+ generic::TransformOperation::Translate(tx, ty) => generic::Translate::Translate(tx, ty),
generic::TransformOperation::Translate3D(tx, ty, tz) => {
generic::Translate::Translate3D(tx, ty, tz)
},
diff --git a/components/style/values/generics/mod.rs b/components/style/values/generics/mod.rs
index 425ddf62dcf..e054db7281f 100644
--- a/components/style/values/generics/mod.rs
+++ b/components/style/values/generics/mod.rs
@@ -215,7 +215,19 @@ pub struct GreaterThanOrEqualToOne<T>(pub T);
/// A clip rect for clip and image-region
#[allow(missing_docs)]
-#[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToAnimatedZero, ToComputedValue, ToCss)]
+#[derive(
+ Clone,
+ ComputeSquaredDistance,
+ Copy,
+ Debug,
+ MallocSizeOf,
+ PartialEq,
+ SpecifiedValueInfo,
+ ToAnimatedValue,
+ ToAnimatedZero,
+ ToComputedValue,
+ ToCss,
+)]
#[css(function = "rect", comma)]
pub struct ClipRect<LengthOrAuto> {
pub top: LengthOrAuto,
diff --git a/components/style/values/generics/text.rs b/components/style/values/generics/text.rs
index f339bf83432..7dae932faac 100644
--- a/components/style/values/generics/text.rs
+++ b/components/style/values/generics/text.rs
@@ -29,9 +29,7 @@ impl<N, I> InitialLetter<N, I> {
}
/// A generic spacing value for the `letter-spacing` and `word-spacing` properties.
-#[derive(
- Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss,
-)]
+#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
pub enum Spacing<Value> {
/// `normal`
Normal,
diff --git a/components/style/values/generics/transform.rs b/components/style/values/generics/transform.rs
index 15e0ea2d274..3e091162b2e 100644
--- a/components/style/values/generics/transform.rs
+++ b/components/style/values/generics/transform.rs
@@ -137,7 +137,10 @@ where
SkewY(Angle),
/// translate(x, y) or translate(x)
#[css(comma, function)]
- Translate(LengthPercentage, #[css(skip_if = "Zero::is_zero")] LengthPercentage),
+ Translate(
+ LengthPercentage,
+ #[css(skip_if = "Zero::is_zero")] LengthPercentage,
+ ),
/// translateX(x)
#[css(function = "translateX")]
TranslateX(LengthPercentage),
@@ -637,7 +640,14 @@ impl<Number: ToCss + PartialEq> ToCss for Scale<Number> {
}
#[derive(
- Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToAnimatedZero, ToComputedValue, ToCss
+ Clone,
+ Debug,
+ MallocSizeOf,
+ PartialEq,
+ SpecifiedValueInfo,
+ ToAnimatedZero,
+ ToComputedValue,
+ ToCss,
)]
/// A value of the `translate` property
///
@@ -660,7 +670,10 @@ where
/// 'none'
None,
/// '<length-percentage>' or '<length-percentage> <length-percentage>'
- Translate(LengthPercentage, #[css(skip_if = "Zero::is_zero")] LengthPercentage),
+ Translate(
+ LengthPercentage,
+ #[css(skip_if = "Zero::is_zero")] LengthPercentage,
+ ),
/// '<length-percentage> <length-percentage> <length>'
Translate3D(LengthPercentage, LengthPercentage, Length),
}
diff --git a/components/style/values/specified/mod.rs b/components/style/values/specified/mod.rs
index 48bba0a5a77..7295f060697 100644
--- a/components/style/values/specified/mod.rs
+++ b/components/style/values/specified/mod.rs
@@ -652,7 +652,12 @@ impl ClipRect {
left = parse_argument(context, input, allow_quirks)?;
}
- Ok(ClipRect { top, right, bottom, left })
+ Ok(ClipRect {
+ top,
+ right,
+ bottom,
+ left,
+ })
})
}
}
diff --git a/components/style/values/specified/svg.rs b/components/style/values/specified/svg.rs
index fa54b5338b4..556e995c02f 100644
--- a/components/style/values/specified/svg.rs
+++ b/components/style/values/specified/svg.rs
@@ -6,9 +6,9 @@
use crate::parser::{Parse, ParserContext};
use crate::values::generics::svg as generic;
-use crate::values::specified::AllowQuirks;
use crate::values::specified::color::Color;
use crate::values::specified::url::SpecifiedUrl;
+use crate::values::specified::AllowQuirks;
use crate::values::specified::LengthPercentage;
use crate::values::specified::{NonNegativeLengthPercentage, Opacity};
use crate::values::CustomIdent;
@@ -52,10 +52,9 @@ macro_rules! parse_svg_length {
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>> {
- if let Ok(lp) = input.try(|i| {
- <$lp>::parse_quirky(context, i, AllowQuirks::Always)
- }) {
- return Ok(generic::SVGLength::LengthPercentage(lp))
+ if let Ok(lp) = input.try(|i| <$lp>::parse_quirky(context, i, AllowQuirks::Always))
+ {
+ return Ok(generic::SVGLength::LengthPercentage(lp));
}
try_match_ident_ignore_ascii_case! { input,
@@ -65,7 +64,7 @@ macro_rules! parse_svg_length {
}
}
}
- }
+ };
}
parse_svg_length!(SVGLength, LengthPercentage);
@@ -78,11 +77,7 @@ impl Parse for SVGStrokeDashArray {
) -> Result<Self, ParseError<'i>> {
if let Ok(values) = input.try(|i| {
CommaWithSpace::parse(i, |i| {
- NonNegativeLengthPercentage::parse_quirky(
- context,
- i,
- AllowQuirks::Always,
- )
+ NonNegativeLengthPercentage::parse_quirky(context, i, AllowQuirks::Always)
})
}) {
return Ok(generic::SVGStrokeDashArray::Values(values));
diff --git a/components/style_derive/cg.rs b/components/style_derive/cg.rs
index 880cb07378b..a5f15a0358e 100644
--- a/components/style_derive/cg.rs
+++ b/components/style_derive/cg.rs
@@ -70,9 +70,9 @@ pub fn propagate_clauses_to_output_type(
for bound in extra_bounds {
let ty = bound.bounded_ty;
let bounds = bound.bounds;
- where_clause.predicates.push(
- parse_quote!(<#ty as #trait_path>::#trait_output: #bounds),
- )
+ where_clause
+ .predicates
+ .push(parse_quote!(<#ty as #trait_path>::#trait_output: #bounds))
}
}