tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit a07353d8a79f4182e9e06b40f00908808539045c
parent 50f1ff7a942c161c5b4866b2f98f00b3ea0fa03b
Author: Atila Butkovits <abutkovits@mozilla.com>
Date:   Tue,  7 Oct 2025 18:21:55 +0300

Revert "Bug 1992880 - Add method to obtain TextTransformCase from TextTransform. r=firefox-style-system-reviewers,emilio" for causing failures at test_bug877690.html.

This reverts commit 351bcb391f295e719e0300b746444936991cfcac.

Revert "Bug 1992880 - Fixups to allow Servo to compile. r=firefox-style-system-reviewers,emilio"

This reverts commit b528dd56433537d7fb5e4d86ab2fd730e904f1ac.

Revert "Bug 1992880 - Enable :state pseudo-class for Servo. r=firefox-style-system-reviewers,emilio"

This reverts commit 3c3da3086d1bd30865eac10add51ac9cc49d19a5.

Revert "Bug 1992880 - Enable font-synthesis-weight for Servo. r=firefox-style-system-reviewers,emilio"

This reverts commit 93c3b64965bc2996c7a1a57fbcb5405f91860c77.

Revert "Bug 1992880 - Remove unused imports. r=firefox-style-system-reviewers,emilio"

This reverts commit 6f4e967deb346554f8137f46adecf5f59cc2507f.

Revert "Bug 1992880 - Enable -webkit-fill-available for Servo. r=firefox-style-system-reviewers,emilio"

This reverts commit 07721ce260c71d0a5d99564b0e0d376d7ee8e2be.

Revert "Bug 1992880 - Restrict `font-family: math` to Gecko. r=firefox-style-system-reviewers,emilio"

This reverts commit 4e67436c44ad073c265d105fa94beb78dfd23f47.

Diffstat:
Mservo/components/style/lib.rs | 1+
Mservo/components/style/matching.rs | 2+-
Mservo/components/style/properties/cascade.rs | 1+
Mservo/components/style/properties/longhands/font.mako.rs | 2+-
Mservo/components/style/properties/properties.mako.rs | 1-
Mservo/components/style/servo/animation.rs | 2+-
Mservo/components/style/servo/selector_parser.rs | 14+++-----------
Mservo/components/style/stylist.rs | 1-
Mservo/components/style/values/computed/font.rs | 8++------
Mservo/components/style/values/generics/length.rs | 32++++++++++++++++----------------
Mservo/components/style/values/specified/font.rs | 2--
Mservo/components/style/values/specified/length.rs | 13+++++++++++++
Mservo/components/style/values/specified/text.rs | 12------------
13 files changed, 39 insertions(+), 52 deletions(-)

diff --git a/servo/components/style/lib.rs b/servo/components/style/lib.rs @@ -48,6 +48,7 @@ extern crate malloc_size_of; #[macro_use] extern crate malloc_size_of_derive; #[cfg(feature = "servo")] +#[macro_use] extern crate web_atoms; #[allow(unused_extern_crates)] #[macro_use] diff --git a/servo/components/style/matching.rs b/servo/components/style/matching.rs @@ -691,7 +691,7 @@ trait PrivateMatchMethods: TElement { new_values: &Arc<ComputedValues>, pseudo_element: Option<PseudoElement>, ) -> bool { - use crate::animation::{AnimationSetKey, AnimationState}; + use crate::animation::{self, AnimationSetKey, AnimationState}; // We need to call this before accessing the `ElementAnimationSet` from the // map because this call will do a RwLock::read(). diff --git a/servo/components/style/properties/cascade.rs b/servo/components/style/properties/cascade.rs @@ -1074,6 +1074,7 @@ impl<'b> Cascade<'b> { builder.add_flags(ComputedValueFlags::HAS_AUTHOR_SPECIFIED_WORD_SPACING); } + #[cfg(feature = "gecko")] if self .author_specified .contains(LonghandId::FontSynthesisWeight) diff --git a/servo/components/style/properties/longhands/font.mako.rs b/servo/components/style/properties/longhands/font.mako.rs @@ -87,7 +87,7 @@ ${helpers.predefined_type( ${helpers.predefined_type( "font-synthesis-weight", "FontSynthesis", - engines="gecko servo", + engines="gecko", initial_value="computed::FontSynthesis::Auto", initial_specified_value="specified::FontSynthesis::Auto", gecko_ffi_name="mFont.synthesisWeight", diff --git a/servo/components/style/properties/properties.mako.rs b/servo/components/style/properties/properties.mako.rs @@ -2041,7 +2041,6 @@ impl ComputedValues { PropertyDeclarationId::Longhand(id) => { let context = resolved::Context { style: self, - for_property: id.into(), }; let mut s = String::new(); self.computed_or_resolved_value( diff --git a/servo/components/style/servo/animation.rs b/servo/components/style/servo/animation.rs @@ -1495,7 +1495,7 @@ pub fn maybe_start_animations<E>( continue; } - let keyframe_animation = match context.stylist.lookup_keyframes(name, element) { + let keyframe_animation = match context.stylist.get_animation(name, element) { Some(animation) => animation, None => continue, }; diff --git a/servo/components/style/servo/selector_parser.rs b/servo/components/style/servo/selector_parser.rs @@ -380,11 +380,6 @@ impl ToCss for NonTSPseudoClass { Self::AnyLink => ":any-link", Self::Autofill => ":autofill", Self::Checked => ":checked", - Self::CustomState(ref state) => { - dest.write_str(":state(")?; - state.0.to_css(dest)?; - return dest.write_char(')'); - }, Self::Default => ":default", Self::Defined => ":defined", Self::Disabled => ":disabled", @@ -415,7 +410,7 @@ impl ToCss for NonTSPseudoClass { Self::UserValid => ":user-valid", Self::Valid => ":valid", Self::Visited => ":visited", - Self::Lang(_) => unreachable!(), + Self::Lang(_) | Self::CustomState(_) => unreachable!(), }) } } @@ -602,13 +597,10 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> { parser: &mut CssParser<'i, 't>, after_part: bool, ) -> Result<NonTSPseudoClass, ParseError<'i>> { + use self::NonTSPseudoClass::*; let pseudo_class = match_ignore_ascii_case! { &name, "lang" if !after_part => { - NonTSPseudoClass::Lang(parser.expect_ident_or_string()?.as_ref().into()) - }, - "state" => { - let result = AtomIdent::from(parser.expect_ident()?.as_ref()); - NonTSPseudoClass::CustomState(CustomState(result)) + Lang(parser.expect_ident_or_string()?.as_ref().into()) }, _ => return Err(parser.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(name.clone()))), }; diff --git a/servo/components/style/stylist.rs b/servo/components/style/stylist.rs @@ -1618,7 +1618,6 @@ impl Stylist { /// Returns the registered `@position-try-rule` animation for the specified name. #[inline] - #[cfg(feature = "gecko")] fn lookup_position_try<'a, E>( &'a self, name: &Atom, diff --git a/servo/components/style/values/computed/font.rs b/servo/components/style/values/computed/font.rs @@ -420,7 +420,6 @@ impl FontFamily { generic_font_family!(MONOSPACE, Monospace); generic_font_family!(CURSIVE, Cursive); generic_font_family!(FANTASY, Fantasy); - #[cfg(feature = "gecko")] generic_font_family!(MATH, Math); #[cfg(feature = "gecko")] generic_font_family!(MOZ_EMOJI, MozEmoji); @@ -436,7 +435,6 @@ impl FontFamily { GenericFontFamily::Monospace => &*MONOSPACE, GenericFontFamily::Cursive => &*CURSIVE, GenericFontFamily::Fantasy => &*FANTASY, - #[cfg(feature = "gecko")] GenericFontFamily::Math => &*MATH, #[cfg(feature = "gecko")] GenericFontFamily::MozEmoji => &*MOZ_EMOJI, @@ -579,7 +577,6 @@ fn system_ui_enabled(_: &ParserContext) -> bool { static_prefs::pref!("layout.css.system-ui.enabled") } -#[cfg(feature = "gecko")] fn math_enabled(context: &ParserContext) -> bool { context.chrome_rules_enabled() || static_prefs::pref!("mathml.font_family_math.enabled") } @@ -622,7 +619,6 @@ pub enum GenericFontFamily { Monospace, Cursive, Fantasy, - #[cfg(feature = "gecko")] #[parse(condition = "math_enabled")] Math, #[parse(condition = "system_ui_enabled")] @@ -639,9 +635,9 @@ impl GenericFontFamily { /// the user. See bug 789788 and bug 1730098. pub(crate) fn valid_for_user_font_prioritization(self) -> bool { match self { - Self::None | Self::Cursive | Self::Fantasy | Self::SystemUi => false, + Self::None | Self::Cursive | Self::Fantasy | Self::Math | Self::SystemUi => false, #[cfg(feature = "gecko")] - Self::Math | Self::MozEmoji => false, + Self::MozEmoji => false, Self::Serif | Self::SansSerif | Self::Monospace => true, } } diff --git a/servo/components/style/values/generics/length.rs b/servo/components/style/values/generics/length.rs @@ -166,6 +166,7 @@ pub enum GenericSize<LengthPercent> { #[cfg(feature = "gecko")] #[animation(error)] MozAvailable, + #[cfg(feature = "gecko")] #[animation(error)] WebkitFillAvailable, #[animation(error)] @@ -183,15 +184,14 @@ where { fn collect_completion_keywords(f: style_traits::KeywordsCollectFn) { LengthPercent::collect_completion_keywords(f); - f(&["auto", "fit-content", "max-content", "min-content"]); + f(&["auto", "stretch", "fit-content"]); if cfg!(feature = "gecko") { - f(&["-moz-available"]); - } - if static_prefs::pref!("layout.css.stretch-size-keyword.enabled") { - f(&["stretch"]); - } - if static_prefs::pref!("layout.css.webkit-fill-available.enabled") { - f(&["-webkit-fill-available"]); + f(&[ + "max-content", + "min-content", + "-moz-available", + "-webkit-fill-available", + ]); } if static_prefs::pref!("layout.css.anchor-positioning.enabled") { f(&["anchor-size"]); @@ -245,6 +245,7 @@ pub enum GenericMaxSize<LengthPercent> { #[cfg(feature = "gecko")] #[animation(error)] MozAvailable, + #[cfg(feature = "gecko")] #[animation(error)] WebkitFillAvailable, #[animation(error)] @@ -262,15 +263,14 @@ where { fn collect_completion_keywords(f: style_traits::KeywordsCollectFn) { LP::collect_completion_keywords(f); - f(&["none", "fit-content", "max-content", "min-content"]); + f(&["none", "stretch", "fit-content"]); if cfg!(feature = "gecko") { - f(&["-moz-available"]); - } - if static_prefs::pref!("layout.css.stretch-size-keyword.enabled") { - f(&["stretch"]); - } - if static_prefs::pref!("layout.css.webkit-fill-available.enabled") { - f(&["-webkit-fill-available"]); + f(&[ + "max-content", + "min-content", + "-moz-available", + "-webkit-fill-available", + ]); } if static_prefs::pref!("layout.css.anchor-positioning.enabled") { f(&["anchor-size"]); diff --git a/servo/components/style/values/specified/font.rs b/servo/components/style/values/specified/font.rs @@ -1526,7 +1526,6 @@ impl Parse for FontLanguageOverride { Copy, Debug, Eq, - Hash, MallocSizeOf, Parse, PartialEq, @@ -1537,7 +1536,6 @@ impl Parse for FontLanguageOverride { ToShmem, ToTyped, )] -#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] pub enum FontSynthesis { /// This attribute may be synthesized if not supported by a face. Auto, diff --git a/servo/components/style/values/specified/length.rs b/servo/components/style/values/specified/length.rs @@ -2057,6 +2057,7 @@ macro_rules! parse_size_non_length { "fit-content" | "-moz-fit-content" => $size::FitContent, #[cfg(feature = "gecko")] "-moz-available" => $size::MozAvailable, + #[cfg(feature = "gecko")] "-webkit-fill-available" if $allow_webkit_fill_available => $size::WebkitFillAvailable, "stretch" if is_stretch_enabled() => $size::Stretch, $auto_or_none => $size::$auto_or_none_ident, @@ -2068,10 +2069,12 @@ macro_rules! parse_size_non_length { }}; } +#[cfg(feature = "gecko")] fn is_webkit_fill_available_enabled_in_width_and_height() -> bool { static_prefs::pref!("layout.css.webkit-fill-available.enabled") } +#[cfg(feature = "gecko")] fn is_webkit_fill_available_enabled_in_all_size_properties() -> bool { // For convenience at the callsites, we check both prefs here, // since both must be 'true' in order for the keyword to be @@ -2080,6 +2083,16 @@ fn is_webkit_fill_available_enabled_in_all_size_properties() -> bool { && static_prefs::pref!("layout.css.webkit-fill-available.all-size-properties.enabled") } +#[cfg(feature = "servo")] +fn is_webkit_fill_available_enabled_in_width_and_height() -> bool { + false +} + +#[cfg(feature = "servo")] +fn is_webkit_fill_available_enabled_in_all_size_properties() -> bool { + false +} + fn is_stretch_enabled() -> bool { static_prefs::pref!("layout.css.stretch-size-keyword.enabled") } diff --git a/servo/components/style/values/specified/text.rs b/servo/components/style/values/specified/text.rs @@ -453,18 +453,6 @@ impl TextTransform { // Case bits are exclusive with each other. case.is_empty() || case.bits().is_power_of_two() } - - /// Returns the corresponding TextTransformCase. - pub fn case(&self) -> TextTransformCase { - match *self & Self::CASE_TRANSFORMS { - Self::NONE => TextTransformCase::None, - Self::UPPERCASE => TextTransformCase::Uppercase, - Self::LOWERCASE => TextTransformCase::Lowercase, - Self::CAPITALIZE => TextTransformCase::Capitalize, - Self::MATH_AUTO => TextTransformCase::MathAuto, - _ => unreachable!("Case bits are exclusive with each other"), - } - } } /// Specified and computed value of text-align-last.