tor-browser

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

commit 123a6b978c196a5b2df2544f4007cad9f6cb9227
parent 72a543fee7d16f07f6f04bd6caf7c7692ed291bf
Author: Connor Pearson <connor.pearson@mailbox.org>
Date:   Sun, 11 Jan 2026 11:07:08 +0000

Bug 1957751 - Serialize background-size and mask-size as two values. r=firefox-style-system-reviewers,emilio

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

Diffstat:
Mservo/components/style/values/generics/background.rs | 7++++++-
Mtesting/web-platform/meta/css/css-backgrounds/parsing/background-shorthand-serialization.html.ini | 3---
Mtesting/web-platform/meta/css/css-backgrounds/parsing/background-size-computed.html.ini | 6------
Mtesting/web-platform/meta/css/css-masking/parsing/mask-size-computed.html.ini | 12------------
Dtesting/web-platform/meta/css/css-masking/parsing/mask-size-valid.html.ini | 3---
Mtesting/web-platform/tests/css/css-backgrounds/parsing/background-size-valid.html | 8++++----
Mtesting/web-platform/tests/css/css-masking/parsing/mask-size-valid.html | 2+-
7 files changed, 11 insertions(+), 30 deletions(-)

diff --git a/servo/components/style/values/generics/background.rs b/servo/components/style/values/generics/background.rs @@ -31,7 +31,7 @@ pub enum GenericBackgroundSize<LengthPercent> { /// Explicit width. width: GenericLengthPercentageOrAuto<LengthPercent>, /// Explicit height. - #[css(skip_if = "GenericLengthPercentageOrAuto::is_auto")] + #[css(contextual_skip_if = "width_and_height_are_auto")] height: GenericLengthPercentageOrAuto<LengthPercent>, }, /// `cover` @@ -42,6 +42,11 @@ pub enum GenericBackgroundSize<LengthPercent> { Contain, } +#[inline] +fn width_and_height_are_auto<LengthPercent>(width: &GenericLengthPercentageOrAuto<LengthPercent>, height: &GenericLengthPercentageOrAuto<LengthPercent>) -> bool { + width.is_auto() && height.is_auto() +} + pub use self::GenericBackgroundSize as BackgroundSize; impl<LengthPercentage> BackgroundSize<LengthPercentage> { diff --git a/testing/web-platform/meta/css/css-backgrounds/parsing/background-shorthand-serialization.html.ini b/testing/web-platform/meta/css/css-backgrounds/parsing/background-shorthand-serialization.html.ini @@ -1,7 +1,4 @@ [background-shorthand-serialization.html] - [background-size with non-initial background-position] - expected: FAIL - [multiple backgrounds with varying values] expected: FAIL diff --git a/testing/web-platform/meta/css/css-backgrounds/parsing/background-size-computed.html.ini b/testing/web-platform/meta/css/css-backgrounds/parsing/background-size-computed.html.ini @@ -3,9 +3,3 @@ if (os == "android") and fission: [OK, TIMEOUT] [Property background-size value 'auto 1px, 2% 3%, contain'] expected: FAIL - - [Property background-size value '1px'] - expected: FAIL - - [Property background-size value '1px auto'] - expected: FAIL diff --git a/testing/web-platform/meta/css/css-masking/parsing/mask-size-computed.html.ini b/testing/web-platform/meta/css/css-masking/parsing/mask-size-computed.html.ini @@ -1,15 +1,3 @@ [mask-size-computed.html] - [Property mask-size value '1px'] - expected: FAIL - - [Property mask-size value '1px auto'] - expected: FAIL - [Property mask-size value 'auto 1px, 2% 3%, contain'] expected: FAIL - - [Property mask-size value 'auto, 100%' multiple values] - expected: FAIL - - [Property mask-size value '100%' multiple values] - expected: FAIL diff --git a/testing/web-platform/meta/css/css-masking/parsing/mask-size-valid.html.ini b/testing/web-platform/meta/css/css-masking/parsing/mask-size-valid.html.ini @@ -1,3 +0,0 @@ -[mask-size-valid.html] - [e.style['mask-size'\] = "1px auto" should set the property value] - expected: FAIL diff --git a/testing/web-platform/tests/css/css-backgrounds/parsing/background-size-valid.html b/testing/web-platform/tests/css/css-backgrounds/parsing/background-size-valid.html @@ -12,11 +12,11 @@ </head> <body> <script> -test_valid_value("background-size", "1px", ["1px", "1px auto"]); -test_valid_value("background-size", "1px auto", ["1px", "1px auto"]); +test_valid_value("background-size", "1px", "1px auto"); +test_valid_value("background-size", "1px auto", "1px auto"); test_valid_value("background-size", "2% 3%"); -test_valid_value("background-size", "auto", ["auto", "auto auto"]); -test_valid_value("background-size", "auto auto", ["auto", "auto auto"]); +test_valid_value("background-size", "auto"); +test_valid_value("background-size", "auto auto", "auto"); test_valid_value("background-size", "auto 4%"); test_valid_value("background-size", "contain"); test_valid_value("background-size", "cover"); diff --git a/testing/web-platform/tests/css/css-masking/parsing/mask-size-valid.html b/testing/web-platform/tests/css/css-masking/parsing/mask-size-valid.html @@ -12,7 +12,7 @@ </head> <body> <script> -test_valid_value("mask-size", "1px"); +test_valid_value("mask-size", "1px", "1px auto"); test_valid_value("mask-size", "1px auto"); test_valid_value("mask-size", "2% 3%"); test_valid_value("mask-size", "auto");