tor-browser

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

commit c29a4b75c2a9b6bd101a7ee16ea7a1e618f70656
parent f04bdbe632dd6c596bce383ddc76e2b26ef0c3f9
Author: eri <eri@igalia.com>
Date:   Wed, 12 Nov 2025 13:06:55 +0000

Bug 1997564 - Make `math-depth` animate like an integer r=emilio,fredw,firefox-style-system-reviewers

Change the animation type for `math-depth` from discrete to integer,
as specified by the MathML Core specification:
https://w3c.github.io/mathml-core/#propdef-math-depth

Update the test that I added to remove the unnecessary and incorrect
case that I added checking `add` and `auto-add`. Those are already
covered by checking the parsing of computed values and the integer
animation testing is enough.

Differential Revision: https://phabricator.services.mozilla.com/D270840

Diffstat:
Mdevtools/server/actors/animation-type-longhand.js | 2+-
Mservo/components/style/properties/longhands/font.mako.rs | 1-
Mservo/components/style/values/computed/font.rs | 16++++++++++++++++
Mtesting/web-platform/meta/web-animations/animation-model/animation-types/accumulation-per-property-002.html.ini | 3---
Mtesting/web-platform/meta/web-animations/animation-model/animation-types/addition-per-property-002.html.ini | 3---
Mtesting/web-platform/meta/web-animations/animation-model/animation-types/interpolation-per-property-002.html.ini | 3---
Mtesting/web-platform/tests/web-animations/animation-model/animation-types/property-list.js | 6+-----
7 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/devtools/server/actors/animation-type-longhand.js b/devtools/server/actors/animation-type-longhand.js @@ -117,7 +117,6 @@ exports.ANIMATION_TYPE_FOR_LONGHANDS = [ "mask-repeat", "mask-type", "masonry-auto-flow", - "math-depth", "math-shift", "math-style", "mix-blend-mode", @@ -326,6 +325,7 @@ exports.ANIMATION_TYPE_FOR_LONGHANDS = [ "mask-position-x", "mask-position-y", "mask-size", + "math-depth", "object-position", "offset-anchor", "offset-path", diff --git a/servo/components/style/properties/longhands/font.mako.rs b/servo/components/style/properties/longhands/font.mako.rs @@ -308,7 +308,6 @@ ${helpers.predefined_type( "MathDepth", "0", engines="gecko", - animation_type="discrete", spec="https://mathml-refresh.github.io/mathml-core/#the-math-script-level-property", affects="", )} diff --git a/servo/components/style/values/computed/font.rs b/servo/components/style/values/computed/font.rs @@ -19,6 +19,7 @@ use crate::values::specified::font::{ self as specified, KeywordInfo, MAX_FONT_WEIGHT, MIN_FONT_WEIGHT, }; use crate::values::specified::length::{FontBaseSize, LineHeightBase, NoCalcLength}; +use crate::values::CSSInteger; use crate::Atom; use cssparser::{serialize_identifier, CssStringWriter, Parser}; use malloc_size_of::{MallocSizeOf, MallocSizeOfOps}; @@ -1100,6 +1101,21 @@ impl ToComputedValue for specified::MathDepth { } } +impl ToAnimatedValue for MathDepth { + type AnimatedValue = CSSInteger; + + #[inline] + fn to_animated_value(self, _: &crate::values::animated::Context) -> Self::AnimatedValue { + self.into() + } + + #[inline] + fn from_animated_value(animated: Self::AnimatedValue) -> Self { + use std::{cmp, i8}; + cmp::min(animated, i8::MAX as i32) as i8 + } +} + /// - Use a signed 8.8 fixed-point value (representable range -128.0..128) /// /// Values of <angle> below -90 or above 90 are not permitted, so we use an out diff --git a/testing/web-platform/meta/web-animations/animation-model/animation-types/accumulation-per-property-002.html.ini b/testing/web-platform/meta/web-animations/animation-model/animation-types/accumulation-per-property-002.html.ini @@ -7,6 +7,3 @@ [text-decoration: "underline" onto "overline"] expected: FAIL - - [math-depth: integer] - expected: FAIL diff --git a/testing/web-platform/meta/web-animations/animation-model/animation-types/addition-per-property-002.html.ini b/testing/web-platform/meta/web-animations/animation-model/animation-types/addition-per-property-002.html.ini @@ -7,6 +7,3 @@ [text-decoration: "underline" onto "overline"] expected: FAIL - - [math-depth: integer] - expected: FAIL diff --git a/testing/web-platform/meta/web-animations/animation-model/animation-types/interpolation-per-property-002.html.ini b/testing/web-platform/meta/web-animations/animation-model/animation-types/interpolation-per-property-002.html.ini @@ -16,6 +16,3 @@ [text-decoration uses discrete animation when animating between "underline" and "overline" with keyframe easing] expected: FAIL - - [math-depth supports animating as an integer] - expected: FAIL diff --git a/testing/web-platform/tests/web-animations/animation-model/animation-types/property-list.js b/testing/web-platform/tests/web-animations/animation-model/animation-types/property-list.js @@ -907,11 +907,7 @@ const gCSSProperties2 = { }, "math-depth": { // https://w3c.github.io/mathml-core/#propdef-math-depth - types: [ - "integer", - { type: "discrete", options: [ [ "auto-add", "1", "0", "1" ], - [ "add(1)", "2", "1", "2" ] ] }, - ], + types: [ "integer" ], }, "math-shift": { // https://w3c.github.io/mathml-core/#propdef-math-shift