tor-browser

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

commit 093fd1b8d1ef2ff5b46908bdf7c3d4013e7ae579
parent 067b8e963928a39eadca429969ae77edc8b01f29
Author: Jan Varga <jvarga@igalia.com>
Date:   Tue, 18 Nov 2025 11:55:59 +0000

Bug 1990419 - Add WPT for rejecting CSSStyleValue with mismatched associated property; r=emilio

Add a new Web Platform Test verifying that StylePropertyMap.set() throws a
TypeError when a CSSStyleValue with an existing [[associatedProperty]] does
not match the property being assigned to.

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

Diffstat:
Mtesting/web-platform/meta/css/css-typed-om/the-stylepropertymap/declared/set.tentative.html.ini | 3+++
Mtesting/web-platform/meta/css/css-typed-om/the-stylepropertymap/inline/set.tentative.html.ini | 3+++
Mtesting/web-platform/tests/css/css-typed-om/the-stylepropertymap/declared/set.tentative.html | 11+++++++++++
Mtesting/web-platform/tests/css/css-typed-om/the-stylepropertymap/inline/set.tentative.html | 11+++++++++++
4 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/testing/web-platform/meta/css/css-typed-om/the-stylepropertymap/declared/set.tentative.html.ini b/testing/web-platform/meta/css/css-typed-om/the-stylepropertymap/declared/set.tentative.html.ini @@ -31,3 +31,6 @@ [StylePropertyMap.set is case-insensitive] expected: FAIL + + [Setting a property with a CSSStyleValue whose associated property does not match throws TypeError] + expected: FAIL diff --git a/testing/web-platform/meta/css/css-typed-om/the-stylepropertymap/inline/set.tentative.html.ini b/testing/web-platform/meta/css/css-typed-om/the-stylepropertymap/inline/set.tentative.html.ini @@ -31,3 +31,6 @@ [StylePropertyMap.set is case-insensitive] expected: FAIL + + [Setting a property with a CSSStyleValue whose associated property does not match throws TypeError] + expected: FAIL diff --git a/testing/web-platform/tests/css/css-typed-om/the-stylepropertymap/declared/set.tentative.html b/testing/web-platform/tests/css/css-typed-om/the-stylepropertymap/declared/set.tentative.html @@ -95,4 +95,15 @@ test(t => { assert_style_value_array_equals(result, [CSS.s(1), CSS.s(2)]); }, 'StylePropertyMap.set is case-insensitive'); +test(t => { + let styleMap = createDeclaredStyleMap(t, 'margin: 10px'); + + const result = styleMap.get('margin'); + assert_equals(result.constructor.name, 'CSSStyleValue'); + + assert_throws_js(TypeError, () => { + styleMap.set('padding', result); + }); +}, 'Setting a property with a CSSStyleValue whose associated property does not match throws TypeError'); + </script> diff --git a/testing/web-platform/tests/css/css-typed-om/the-stylepropertymap/inline/set.tentative.html b/testing/web-platform/tests/css/css-typed-om/the-stylepropertymap/inline/set.tentative.html @@ -95,4 +95,15 @@ test(t => { assert_style_value_array_equals(result, [CSS.s(1), CSS.s(2)]); }, 'StylePropertyMap.set is case-insensitive'); +test(t => { + let styleMap = createInlineStyleMap(t, 'margin: 10px'); + + const result = styleMap.get('margin'); + assert_equals(result.constructor.name, 'CSSStyleValue'); + + assert_throws_js(TypeError, () => { + styleMap.set('padding', result); + }); +}, 'Setting a property with a CSSStyleValue whose associated property does not match throws TypeError'); + </script>