Files
sousa-gecko/testing/web-platform/tests/css/css-fonts/font-feature-values-sameobject.tentative.html
T
Rune Lillesveen 388efbdd97 Bug 2042968 [wpt PR 60199] - Make readonly attributes on CSSFontFeatureValuesRule [SameObject], a=testonly
Automatic update from web-platform-tests
Make readonly attributes on CSSFontFeatureValuesRule [SameObject]

This is based on the proposal in [1] and makes it straightforward to
keep the CSSOM wrappers work for setting/getting including wrapper
reattachments that happen when shared stylesheets are decoupled on
modifications.

[1] https://github.com/w3c/csswg-drafts/issues/13953

Bug: 514445398, 515494291
Change-Id: I5436e4feeff3935f1999630d775ad34a8a26194f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7865910
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1636821}

--

wpt-commits: 3a700f08f0a91d685305e5306c7d6ef180cc964f
wpt-pr: 60199
2026-05-29 16:01:01 +00:00

41 lines
1.2 KiB
HTML

<!DOCTYPE html>
<title>CSS Fonts Test: CSSFontFeatureValuesRule SameObject test</title>
<link rel="help" href="https://drafts.csswg.org/css-fonts/#om-fontfeaturevalues">
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/13953">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style id="style">
@font-feature-values TestFont {
@annotation { a: 1; }
@ornaments { b: 2; }
@stylistic { c: 3; }
@swash { d: 4; }
@character-variant { e: 5; }
@styleset { f: 6; }
}
</style>
<script>
test(() => {
const style = document.getElementById('style');
const rule = style.sheet.cssRules[0];
assert_true(rule instanceof CSSFontFeatureValuesRule, "Should be CSSFontFeatureValuesRule");
const attributes = [
'annotation',
'ornaments',
'stylistic',
'swash',
'characterVariant',
'styleset'
];
for (const attr of attributes) {
const map1 = rule[attr];
const map2 = rule[attr];
assert_equals(map1, map2, `${attr} should return the same object`);
}
}, "CSSFontFeatureValuesMap attributes in CSSFontFeatureValuesRule should be [SameObject]");
</script>