-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CSS] @font-palette-values family-name supports multiple values
https://bugs.webkit.org/show_bug.cgi?id=252569 rdar://105975619 Reviewed by Tim Nguyen. This patch allows @font-palette-values family-name descriptor to have a list of family names (per spec). https://drafts.csswg.org/css-fonts-4/#family-name-syntax * LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/font-palette-36-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/font-palette-36-ref.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/font-palette-36.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-values-invalid-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-values-valid-expected.txt: * Source/WebCore/css/CSSFontPaletteValuesRule.cpp: (WebCore::CSSFontPaletteValuesRule::fontFamily const): (WebCore::CSSFontPaletteValuesRule::cssText const): (WebCore::CSSFontPaletteValuesRule::~CSSFontPaletteValuesRule): Deleted. * Source/WebCore/css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::addFontPaletteValuesRule): * Source/WebCore/css/CSSProperties.json: * Source/WebCore/css/StyleRule.cpp: (WebCore::StyleRuleFontPaletteValues::create): (WebCore::StyleRuleFontPaletteValues::StyleRuleFontPaletteValues): * Source/WebCore/css/StyleRule.h: * Source/WebCore/css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::consumeFontFeatureValuesRule): (WebCore::CSSParserImpl::consumeFontPaletteValuesRule): * Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeFamilyNameListRaw): (WebCore::CSSPropertyParserHelpers::consumeFamilyNameList): * Source/WebCore/css/parser/CSSPropertyParserHelpers.h: Canonical link: https://commits.webkit.org/267411@main
- Loading branch information
Showing
13 changed files
with
136 additions
and
32 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/font-palette-36-expected.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<style> | ||
@font-face { | ||
font-family: "COLR-test-font"; | ||
src: url("resources/COLR-palettes-test-font.ttf") format("truetype"); | ||
} | ||
|
||
@font-palette-values --MyPalette { | ||
font-family: "COLR-test-font"; | ||
base-palette: 2; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div style="font: 48px 'COLR-test-font'; font-palette: --MyPalette">A</div> | ||
<div style="font: 48px 'COLR-test-font'; font-palette: --MyPalette">A</div> | ||
<div style="font: 48px 'COLR-test-font'; font-palette: --MyPalette">A</div> | ||
</body> | ||
</html> |
22 changes: 22 additions & 0 deletions
22
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/font-palette-36-ref.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<style> | ||
@font-face { | ||
font-family: "COLR-test-font"; | ||
src: url("resources/COLR-palettes-test-font.ttf") format("truetype"); | ||
} | ||
|
||
@font-palette-values --MyPalette { | ||
font-family: "COLR-test-font"; | ||
base-palette: 2; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div style="font: 48px 'COLR-test-font'; font-palette: --MyPalette">A</div> | ||
<div style="font: 48px 'COLR-test-font'; font-palette: --MyPalette">A</div> | ||
<div style="font: 48px 'COLR-test-font'; font-palette: --MyPalette">A</div> | ||
</body> | ||
</html> |
33 changes: 33 additions & 0 deletions
33
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/font-palette-36.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>font-palette multiple family-name and @font-palette-values</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-fonts/#font-palette-prop"> | ||
<link rel="help" href="https://drafts.csswg.org/css-fonts-4/#font-palette-values"> | ||
<link rel="match" href="font-palette-36-ref.html"> | ||
<style> | ||
@font-face { | ||
font-family: "COLR-test-font"; | ||
src: url("resources/COLR-palettes-test-font.ttf") format("truetype"); | ||
} | ||
@font-face { | ||
font-family: "foo bar"; | ||
src: url("resources/COLR-palettes-test-font.ttf") format("truetype"); | ||
} | ||
@font-face { | ||
font-family: foo; | ||
src: url("resources/COLR-palettes-test-font.ttf") format("truetype"); | ||
} | ||
@font-palette-values --MyPalette { | ||
font-family: "COLR-test-font", "foo bar", foo; | ||
base-palette: light; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div style="font: 48px 'COLR-test-font'; font-palette: --MyPalette;">A</div> | ||
<div style="font: 48px foo; font-palette: --MyPalette;">A</div> | ||
<div style="font: 48px 'foo bar'; font-palette: --MyPalette;">A</div> | ||
</body> | ||
</html> |
2 changes: 1 addition & 1 deletion
2
...ted/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-values-invalid-expected.txt
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
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
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
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
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