Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
font-variant-alternates: historical-forms
doesn't reflect properly …
…via StylePropertyMap https://bugs.webkit.org/show_bug.cgi?id=249337 Reviewed by Tim Nguyen. `font-variant-alternates: historical-forms` doesn't reflect properly via StylePropertyMap. Even though `historical-forms` is a supported keyword for this CSS property [1], we wouldn't get a CSSKeywordValue when reading the property value back. The issue is that we convert to a FontVariantAlternates internally and then back to a CSSValue. The function to convert back to a CSSValue (fontVariantAlternatesPropertyValue) was only handling the `normal` keyword but not the `historical-forms` one. [1] https://w3c.github.io/csswg-drafts/css-fonts/#font-variant-alternates-prop * LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/font-variant-alternates-expected.txt: * Source/WebCore/css/ComputedStyleExtractor.cpp: (WebCore::fontVariantAlternatesPropertyValue): Canonical link: https://commits.webkit.org/257955@main
- Loading branch information
Showing
4 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Testing for the font-variant-alternates computed values | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
target.style.fontVariantAlternates = 'historical-forms swash(flowing)'; | ||
PASS getComputedStyle(target).fontVariantAlternates is "historical-forms swash(flowing)" | ||
target.style.fontVariantAlternates = 'historical-forms'; | ||
PASS getComputedStyle(target).fontVariantAlternates is "historical-forms" | ||
target.style.fontVariantAlternates = 'normal'; | ||
PASS getComputedStyle(target).fontVariantAlternates is "normal" | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="../../resources/js-test.js"></script> | ||
</head> | ||
<body> | ||
<div id="target"></div> | ||
<script> | ||
description("Testing for the font-variant-alternates computed values"); | ||
|
||
const target = document.getElementById("target"); | ||
evalAndLog("target.style.fontVariantAlternates = 'historical-forms swash(flowing)';"); | ||
shouldBeEqualToString("getComputedStyle(target).fontVariantAlternates", "historical-forms swash(flowing)"); | ||
|
||
evalAndLog("target.style.fontVariantAlternates = 'historical-forms';"); | ||
shouldBeEqualToString("getComputedStyle(target).fontVariantAlternates", "historical-forms"); | ||
|
||
evalAndLog("target.style.fontVariantAlternates = 'normal';"); | ||
shouldBeEqualToString("getComputedStyle(target).fontVariantAlternates", "normal"); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters