Bug 1810717 - Test/metadata updates for corrected font-{feature,variation}-settings computed style and interpolation behaviors. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D167013
This commit is contained in:
Jonathan Kew 2023-01-19 16:17:29 +00:00
parent bf07f65e93
commit 7e4e37fd11
7 changed files with 15 additions and 29 deletions

View File

@ -3056,21 +3056,22 @@ function test_font_variations_transition(prop) {
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "\"wght\" 0, \"wdth\" 1.5", "");
is(cs.getPropertyValue(prop), "\"wght\" 0, \"wdth\" 1.5",
// Note that computed-style returns the tags in sorted order.
is(cs.getPropertyValue(prop), "\"wdth\" 1.5, \"wght\" 0",
"font-variation-settings property " + prop + ": computed value before transition");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "\"wght\" 2, \"wdth\" 0.5", "");
is(cs.getPropertyValue(prop), "\"wght\" 0.5, \"wdth\" 1.25",
is(cs.getPropertyValue(prop), "\"wdth\" 1.25, \"wght\" 0.5",
"font-variation-settings property " + prop + ": interpolation of font-variation-settings");
check_distance(prop, "\"wght\" 0, \"wdth\" 1.5", "\"wght\" 0.5, \"wdth\" 1.25", "\"wght\" 2, \"wdth\" 0.5");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "\"wght\" 2, \"wdth\" 0.5", "");
is(cs.getPropertyValue(prop), "\"wght\" 2, \"wdth\" 0.5",
is(cs.getPropertyValue(prop), "\"wdth\" 0.5, \"wght\" 2",
"font-variation-settings property " + prop + ": computed value before transition");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "\"wght\" 0, \"wdth\" 1.5", "");
is(cs.getPropertyValue(prop), "\"wght\" 1.5, \"wdth\" 0.75",
is(cs.getPropertyValue(prop), "\"wdth\" 0.75, \"wght\" 1.5",
"font-variation-settings property " + prop + ": interpolation of font-variation-settings");
check_distance(prop, "\"wght\" 2, \"wdth\" 0.5", "\"wght\" 1.5, \"wdth\" 0.75", "\"wght\" 0, \"wdth\" 1.5");
}

View File

@ -1,5 +0,0 @@
[font-variation-settings-serialization-001.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[font-feature-settings should be serialized to not include duplicates]
expected: FAIL

View File

@ -1,5 +0,0 @@
[font-variation-settings-computed.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[Property font-variation-settings value '"wght" 700, "wght" 500' duplicate values should be removed, keeping the rightmost occurrence.]
expected: FAIL

View File

@ -1,4 +0,0 @@
[accumulation-per-property-001.html]
[font-variation-settings: ""wdth" 1, "wght" 1.1" onto ""wdth" 5"]
expected: FAIL

View File

@ -1,5 +0,0 @@
[addition-per-property-001.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[font-variation-settings: ""wdth" 1, "wght" 1.1" onto ""wdth" 5"]
expected: FAIL

View File

@ -2,11 +2,11 @@
<html>
<head>
<meta charset="utf-8">
<title>CSS Test: font-feature-settings serialization</title>
<title>CSS Test: font-variation-settings serialization</title>
<link rel="author" title="Greg Whitworth" href="mailto:gwhit@microsoft.com">
<link rel="help" href="http://www.w3.org/TR/css-fonts-4/#propdef-font-variation-settings">
<link rel="issue" href="https://github.com/w3c/csswg-drafts/issues/1959#issuecomment-360864254">
<meta name="desctiption" content="It was decided in issue 1959 that font-variation-settings is a map, therefor duplicates should be removed">
<meta name="description" content="It was decided in issue 1959 that font-variation-settings is a map, therefore duplicates should be removed">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
@ -17,7 +17,7 @@
const test1_canEqual = ['"bldA" 2', "'bldA' 2"];
test(function() {
assert_in_array(getComputedStyle(document.getElementById('test1')).fontVariationSettings, test1_canEqual);
}, "font-feature-settings should be serialized to not include duplicates");
}, "font-variation-settings should be serialized to not include duplicates");
</script>
</body>
</html>

View File

@ -4,7 +4,9 @@
<meta charset="utf-8">
<title>CSS Fonts Module Level 3: getComputedStyle().fontFeatureSettings</title>
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-feature-settings-prop">
<meta name="assert" content="font-feature-settings computed value is as specified.">
<meta name="assert" content="The computed value of font-feature-settings is a map, so any duplicates in the specified value must not be preserved.">
<!-- Note that this conflicts with the computed value being "as specified", which the summary shows.
See https://github.com/w3c/csswg-drafts/issues/8296#issuecomment-1377622802 -->
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
@ -18,11 +20,13 @@ test_computed_value('font-feature-settings', '"dlig"');
test_computed_value('font-feature-settings', '"smcp"');
test_computed_value('font-feature-settings', '"c2sc"');
test_computed_value('font-feature-settings', '"liga" 0');
test_computed_value('font-feature-settings', '"tnum", "hist"');
test_computed_value('font-feature-settings', '"tnum", "hist"',
['"tnum", "hist"', '"hist", "tnum"']);
test_computed_value('font-feature-settings', '"PKRN"');
test_computed_value('font-feature-settings', '"dlig", "smcp", "dlig" 0');
test_computed_value('font-feature-settings', '"dlig", "smcp", "dlig" 0',
['"smcp", "dlig" 0', '"dlig" 0, "smcp"']);
</script>
</body>
</html>