Title: [282851] trunk
Revision
282851
Author
[email protected]
Date
2021-09-21 17:04:34 -0700 (Tue, 21 Sep 2021)

Log Message

Parsing support for font-palette
https://bugs.webkit.org/show_bug.cgi?id=230394

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

This is being upstreamed at https://github.com/web-platform-tests/wpt/pull/30845.

* web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* web-platform-tests/css/css-fonts/parsing/font-palette-computed-expected.txt: Added.
* web-platform-tests/css/css-fonts/parsing/font-palette-computed.html: Added.
* web-platform-tests/css/css-fonts/parsing/font-palette-invalid-expected.txt: Added.
* web-platform-tests/css/css-fonts/parsing/font-palette-invalid.html: Added.
* web-platform-tests/css/css-fonts/parsing/font-palette-valid-expected.txt: Added.
* web-platform-tests/css/css-fonts/parsing/font-palette-valid.html: Added.
* web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
* web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:

Source/WebCore:

This is a pretty straightforward parsing patch. The grammar is just
font-palette: none | normal | light | dark | <palette-identifier>.
A <palette-identifier> is a <custom-ident>.

There is a choice to make about how to represent the parsed data:
Option 1:
class None {}; class Normal {}; class Light {}; class Dark {};
class Custom { String value; };
using FontPalette = Variant<None, Normal, Light, Dark, Custom>;

or,
Option 2:
struct FontPalette {
    enum class Type { None, Normal, Light, Dark, Custom } type;
    String value;
};

Upon advice from a trusted colleague, I chose option 2.

I'm implementing parsing support for @font-palette-values in
https://bugs.webkit.org/show_bug.cgi?id=230337.

Tests: imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-computed.html
       imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-invalid.html
       imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-valid.html

* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::fontPaletteFromStyle):
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontPalette):
(WebCore::CSSPropertyParser::parseSingleValue):
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKeyRareData::create):
(WebCore::FontDescriptionKeyRareData::featureSettings const):
(WebCore::FontDescriptionKeyRareData::variationSettings const):
(WebCore::FontDescriptionKeyRareData::fontPalette const):
(WebCore::FontDescriptionKeyRareData::operator== const):
(WebCore::FontDescriptionKeyRareData::FontDescriptionKeyRareData):
(WebCore::add):
(WebCore::FontDescriptionKey::FontDescriptionKey):
(WebCore::FontDescriptionKey::operator== const):
* platform/graphics/FontCascadeDescription.cpp:
* platform/graphics/FontCascadeDescription.h:
(WebCore::FontCascadeDescription::initialFontPalette):
* platform/graphics/FontDescription.cpp:
(WebCore::FontDescription::FontDescription):
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::fontPalette const):
(WebCore::FontDescription::setFontPalette):
(WebCore::FontDescription::operator== const):
(WebCore::FontDescription::encode const):
(WebCore::FontDescription::decode):
* platform/graphics/FontPalette.h: Added.
(WebCore::FontPaletteNone::operator== const):
(WebCore::FontPaletteNone::operator!= const):
(WebCore::add):
(WebCore::FontPaletteNormal::operator== const):
(WebCore::FontPaletteNormal::operator!= const):
(WebCore::FontPaletteLight::operator== const):
(WebCore::FontPaletteLight::operator!= const):
(WebCore::FontPaletteDark::operator== const):
(WebCore::FontPaletteDark::operator!= const):
(WebCore::FontPaletteCustom::operator== const):
(WebCore::FontPaletteCustom::operator!= const):
* style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertFontPalette):

LayoutTests:

* platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
* platform/ios/fast/css/getComputedStyle/computed-style-font-family-expected.txt:
* platform/mac/fast/css/getComputedStyle/computed-style-font-family-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (282850 => 282851)


--- trunk/LayoutTests/ChangeLog	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/LayoutTests/ChangeLog	2021-09-22 00:04:34 UTC (rev 282851)
@@ -1,3 +1,15 @@
+2021-09-21  Myles C. Maxfield  <[email protected]>
+
+        Parsing support for font-palette
+        https://bugs.webkit.org/show_bug.cgi?id=230394
+
+        Reviewed by Simon Fraser.
+
+        * platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
+        * platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
+        * platform/ios/fast/css/getComputedStyle/computed-style-font-family-expected.txt:
+        * platform/mac/fast/css/getComputedStyle/computed-style-font-family-expected.txt:
+
 2021-09-21  Brent Fulgham  <[email protected]>
 
         Remove XSS Auditor: Part 2 (Remove engine support)

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (282850 => 282851)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-09-22 00:04:34 UTC (rev 282851)
@@ -1,3 +1,22 @@
+2021-09-21  Myles C. Maxfield  <[email protected]>
+
+        Parsing support for font-palette
+        https://bugs.webkit.org/show_bug.cgi?id=230394
+
+        Reviewed by Simon Fraser.
+
+        This is being upstreamed at https://github.com/web-platform-tests/wpt/pull/30845.
+
+        * web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
+        * web-platform-tests/css/css-fonts/parsing/font-palette-computed-expected.txt: Added.
+        * web-platform-tests/css/css-fonts/parsing/font-palette-computed.html: Added.
+        * web-platform-tests/css/css-fonts/parsing/font-palette-invalid-expected.txt: Added.
+        * web-platform-tests/css/css-fonts/parsing/font-palette-invalid.html: Added.
+        * web-platform-tests/css/css-fonts/parsing/font-palette-valid-expected.txt: Added.
+        * web-platform-tests/css/css-fonts/parsing/font-palette-valid.html: Added.
+        * web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
+        * web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
+
 2021-09-21  Joonghun Park  <[email protected]>
 
         Fix the behavior that 3d translation's second value is serialized to 0px regardless of its specified unit if it is zero value.

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt (282850 => 282851)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt	2021-09-22 00:04:34 UTC (rev 282851)
@@ -120,6 +120,7 @@
 PASS font-family
 PASS font-feature-settings
 PASS font-optical-sizing
+PASS font-palette
 PASS font-size
 PASS font-stretch
 PASS font-style

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-computed-expected.txt (0 => 282851)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-computed-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-computed-expected.txt	2021-09-22 00:04:34 UTC (rev 282851)
@@ -0,0 +1,7 @@
+
+PASS Property font-palette value 'none'
+PASS Property font-palette value 'normal'
+PASS Property font-palette value 'light'
+PASS Property font-palette value 'dark'
+PASS Property font-palette value 'pitchfork'
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-computed.html (0 => 282851)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-computed.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-computed.html	2021-09-22 00:04:34 UTC (rev 282851)
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Fonts Module Level 4: getComputedStyle().fontPalette</title>
+<link rel="help" href=""
+<meta name="assert" content="font-palette computed value is as specified.">
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<div id="target"></div>
+<script>
+test_computed_value('font-palette', 'none');
+test_computed_value('font-palette', 'normal');
+test_computed_value('font-palette', 'light');
+test_computed_value('font-palette', 'dark');
+test_computed_value('font-palette', 'pitchfork');
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-invalid-expected.txt (0 => 282851)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-invalid-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-invalid-expected.txt	2021-09-22 00:04:34 UTC (rev 282851)
@@ -0,0 +1,4 @@
+
+PASS e.style['font-palette'] = "normal none" should not set the property value
+PASS e.style['font-palette'] = "none, light" should not set the property value
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-invalid.html (0 => 282851)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-invalid.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-invalid.html	2021-09-22 00:04:34 UTC (rev 282851)
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Fonts Module Level 4: parsing font-palette with invalid values</title>
+<link rel="help" href=""
+<meta name="assert" content="font-palette supports only the grammar 'none | normal | light | dark | <palette-identifier>'.">
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<script>
+test_invalid_value('font-palette', 'normal none');
+test_invalid_value('font-palette', 'none, light');
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-valid-expected.txt (0 => 282851)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-valid-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-valid-expected.txt	2021-09-22 00:04:34 UTC (rev 282851)
@@ -0,0 +1,7 @@
+
+PASS e.style['font-palette'] = "none" should set the property value
+PASS e.style['font-palette'] = "normal" should set the property value
+PASS e.style['font-palette'] = "light" should set the property value
+PASS e.style['font-palette'] = "dark" should set the property value
+PASS e.style['font-palette'] = "pitchfork" should set the property value
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-valid.html (0 => 282851)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-valid.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-valid.html	2021-09-22 00:04:34 UTC (rev 282851)
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Fonts Module Level 4: parsing font-palette with valid values</title>
+<link rel="help" href=""
+<meta name="assert" content="font-palette supports the full grammar 'none | normal | light | dark | <palette-identifier>'.">
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<script>
+test_valid_value('font-palette', 'none');
+test_valid_value('font-palette', 'normal');
+test_valid_value('font-palette', 'light');
+test_valid_value('font-palette', 'dark');
+test_valid_value('font-palette', 'pitchfork');
+</script>
+</body>
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt (282850 => 282851)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt	2021-09-22 00:04:34 UTC (rev 282851)
@@ -9,5 +9,5 @@
 PASS invalid property does not appear
 FAIL Shorthands aren't serialized if there are other properties with different logical groups in between assert_equals: expected "margin-top: 10px; margin-right: 10px; margin-left: 10px; margin-inline-start: 10px; margin-block: 10px; margin-inline-end: 10px; margin-bottom: 10px;" but got "margin: 10px; margin-inline: 10px; margin-block: 10px;"
 PASS Shorthands _are_ serialized if there are no other properties with different logical groups in between
-FAIL cssText on computed style declaration returns the empty string assert_equals: cssText is empty expected "" but got "align-content: normal; align-items: normal; align-self: auto; alignment-baseline: auto; all: ; alt: \"\"; animation-delay: 0s; animation-direction: normal; animation-duration: 0s; animation-fill-mode: none; animation-iteration-count: 1; animation-name: none; animation-play-state: running; animation-timing-function: ease; aspect-ratio: auto; backface-visibility: visible; background-attachment: scroll; background-blend-mode: normal; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; baseline-shift: baseline; block-size: 0px; border-block-end-color: rgb(255, 0, 0); border-block-end-style: none; border-block-end-width: 0px; border-block-start-color: rgb(255, 0,
  0); border-block-start-style: none; border-block-start-width: 0px; border-bottom-color: rgb(255, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-bottom-style: none; border-bottom-width: 0px; border-collapse: separate; border-end-end-radius: 0px; border-end-start-radius: 0px; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; border-inline-end-color: rgb(255, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(255, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(255, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(255, 0, 0); border-right-style: none; border-right-width: 0px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-color: rgb(255, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-style: none;
  border-top-width: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; break-after: auto; break-before: auto; break-inside: auto; buffered-rendering: auto; caption-side: top; caret-color: rgb(255, 0, 0); clear: none; clip: auto; clip-path: none; clip-rule: nonzero; color: rgb(255, 0, 0); color-interpolation: sRGB; color-interpolation-filters: linearRGB; color-rendering: auto; color-scheme: auto; column-count: auto; column-fill: balance; column-gap: normal; column-rule-color: rgb(255, 0, 0); column-rule-style: none; column-rule-width: 0px; column-span: none; column-width: auto; contain: none; content: ; counter-increment: none; counter-reset: none; cursor: auto; cx: 0px; cy: 0px; direction: ltr; display: block; dominant-baseline: auto; empty-cells: show; fill: rgb(0, 0, 0); fill-opacity: 1; fill-rule: nonzero; filter: none; flex-basis: auto; flex-direction: row; flex-grow: 0; flex-shrink: 1; flex-wrap: nowrap; float: none; flood-color: rgb(0, 0, 0); flood-opacity: 1; font-f
 amily: -webkit-standard; font-feature-settings: normal; font-optical-sizing: auto; font-size: 13.333333015441895px; font-stretch: normal; font-style: normal; font-synthesis: style weight small-caps; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; font-weight: 400; glyph-orientation-horizontal: 0deg; glyph-orientation-vertical: auto; grid-auto-columns: auto; grid-auto-flow: row; grid-auto-rows: auto; grid-column-end: auto; grid-column-start: auto; grid-row-end: auto; grid-row-start: auto; grid-template-areas: none; grid-template-columns: none; grid-template-rows: none; hanging-punctuation: none; height: 0px; image-orientation: from-image; image-rendering: auto; inline-size: 784px; input-security: auto; inset-block-end: auto; inset-block-start: auto; inset-inline-end: auto; inset-inline-start: auto; isolation: auto; 
 justify-content: normal; justify-items: normal; justify-self: auto; kerning: 0; left: auto; letter-spacing: normal; lighting-color: rgb(255, 255, 255); line-break: auto; line-height: normal; list-style-image: none; list-style-position: outside; list-style-type: disc; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; marker-end: none; marker-mid: none; marker-start: none; mask: none; mask-type: luminance; math-style: normal; max-block-size: none; max-height: none; max-inline-size: none; max-width: none; min-block-size: 0px; min-height: 0px; min-inline-size: 0px; min-width: 0px; mix-blend-mode: normal; object-fit: fill; object-position: 50% 50%; opacity: 1; order: 0; orphans: auto; outline-color: rgb(255, 0, 0); outline-offset: 0px; outline-style: none; outline-width: 0px; overflow-wrap: normal; overflow-x: visible; overflow-y: visible; overscroll-behavior-x: auto;
  overscroll-behavior-y: auto; padding-block-end: 0px; padding-block-start: 0px; padding-bottom: 0px; padding-inline-end: 0px; padding-inline-start: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; page-break-after: auto; page-break-before: auto; page-break-inside: auto; paint-order: normal; perspective: none; perspective-origin-x: ; perspective-origin-y: ; pointer-events: auto; position: static; quotes: auto; r: 0px; resize: none; right: auto; rotate: none; row-gap: normal; rx: auto; ry: auto; scale: none; scroll-behavior: auto; scroll-margin-block: 0px; scroll-margin-bottom: 0px; scroll-margin-inline: 0px; scroll-margin-left: 0px; scroll-margin-right: 0px; scroll-margin-top: 0px; scroll-padding-block: auto; scroll-padding-bottom: auto; scroll-padding-inline: auto; scroll-padding-left: auto; scroll-padding-right: auto; scroll-padding-top: auto; scroll-snap-align: none; scroll-snap-stop: normal; scroll-snap-type: none; shape-image-threshold: 0; shape-margin: 0px; shape-o
 utside: none; shape-rendering: auto; size: ; speak-as: normal; stop-color: rgb(0, 0, 0); stop-opacity: 1; stroke: none; stroke-color: rgba(0, 0, 0, 0); stroke-dasharray: none; stroke-dashoffset: 0px; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; stroke-opacity: 1; stroke-width: 1px; tab-size: 8; table-layout: auto; text-align: start; text-anchor: start; text-decoration: none; text-decoration-color: rgb(255, 0, 0); text-decoration-line: none; text-decoration-skip: auto; text-decoration-skip-ink: auto; text-decoration-style: solid; text-decoration-thickness: auto; text-indent: 0px; text-orientation: mixed; text-overflow: clip; text-rendering: auto; text-shadow: none; text-transform: none; text-underline-offset: auto; text-underline-position: auto; top: auto; touch-action: auto; transform: none; transform-box: view-box; transform-origin-x: ; transform-origin-y: ; transform-origin-z: ; transform-style: flat; transition-delay: 0s; transition-duration: 0s; transition
 -property: all; transition-timing-function: ease; translate: none; unicode-bidi: normal; vector-effect: none; vertical-align: baseline; visibility: visible; white-space: normal; widows: auto; width: 784px; will-change: auto; word-break: normal; word-spacing: 0px; word-wrap: normal; writing-mode: horizontal-tb; x: 0px; y: 0px; z-index: auto; zoom: 1; -apple-color-filter: none; -apple-pay-button-style: black; -apple-pay-button-type: plain; -apple-trailing-word: auto; -webkit-appearance: none; -webkit-backdrop-filter: none; -webkit-background-clip: border-box; -webkit-background-composite: source-over; -webkit-background-origin: padding-box; -webkit-background-size: auto; -webkit-border-fit: border; -webkit-border-horizontal-spacing: 0px; -webkit-border-image: none; -webkit-border-vertical-spacing: 0px; -webkit-box-align: stretch; -webkit-box-decoration-break: slice; -webkit-box-direction: normal; -webkit-box-flex: 0; -webkit-box-flex-group: 1; -webkit-box-lines: single; -webkit-box-or
 dinal-group: 1; -webkit-box-orient: horizontal; -webkit-box-pack: start; -webkit-box-reflect: none; -webkit-box-shadow: none; -webkit-column-axis: auto; -webkit-column-break-after: auto; -webkit-column-break-before: auto; -webkit-column-break-inside: auto; -webkit-column-progression: normal; -webkit-cursor-visibility: auto; -webkit-font-kerning: auto; -webkit-font-smoothing: auto; -webkit-hyphenate-character: auto; -webkit-hyphenate-limit-after: auto; -webkit-hyphenate-limit-before: auto; -webkit-hyphenate-limit-lines: no-limit; -webkit-hyphens: manual; -webkit-initial-letter: normal; -webkit-line-align: none; -webkit-line-box-contain: block inline replaced; -webkit-line-clamp: none; -webkit-line-grid: none; -webkit-line-snap: none; -webkit-locale: auto; -webkit-margin-after-collapse: collapse; -webkit-margin-before-collapse: collapse; -webkit-margin-bottom-collapse: collapse; -webkit-margin-top-collapse: collapse; -webkit-mask-box-image: none; -webkit-mask-box-image-outset: 0; -web
 kit-mask-box-image-repeat: stretch; -webkit-mask-box-image-slice: 0 fill; -webkit-mask-box-image-source: none; -webkit-mask-box-image-width: auto; -webkit-mask-clip: border-box; -webkit-mask-composite: source-over; -webkit-mask-image: none; -webkit-mask-mode: match-source; -webkit-mask-origin: border-box; -webkit-mask-position-x: 0%; -webkit-mask-position-y: 0%; -webkit-mask-repeat: repeat; -webkit-mask-size: auto; -webkit-mask-source-type: alpha; -webkit-nbsp-mode: normal; -webkit-print-color-adjust: economy; -webkit-rtl-ordering: logical; -webkit-ruby-position: before; -webkit-text-combine: none; -webkit-text-emphasis-color: rgb(255, 0, 0); -webkit-text-emphasis-position: over right; -webkit-text-emphasis-style: none; -webkit-text-fill-color: rgb(255, 0, 0); -webkit-text-orientation: mixed; -webkit-text-security: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-color: rgb(255, 0, 0); -webkit-text-stroke-width: 0px; -webkit-text-zoom: normal; -webkit-transform-style: flat;
  -webkit-user-drag: auto; -webkit-user-modify: read-only; -webkit-user-select: text;"
+FAIL cssText on computed style declaration returns the empty string assert_equals: cssText is empty expected "" but got "align-content: normal; align-items: normal; align-self: auto; alignment-baseline: auto; all: ; alt: \"\"; animation-delay: 0s; animation-direction: normal; animation-duration: 0s; animation-fill-mode: none; animation-iteration-count: 1; animation-name: none; animation-play-state: running; animation-timing-function: ease; aspect-ratio: auto; backface-visibility: visible; background-attachment: scroll; background-blend-mode: normal; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; baseline-shift: baseline; block-size: 0px; border-block-end-color: rgb(255, 0, 0); border-block-end-style: none; border-block-end-width: 0px; border-block-start-color: rgb(255, 0, 
 0); border-block-start-style: none; border-block-start-width: 0px; border-bottom-color: rgb(255, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-bottom-style: none; border-bottom-width: 0px; border-collapse: separate; border-end-end-radius: 0px; border-end-start-radius: 0px; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; border-inline-end-color: rgb(255, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(255, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(255, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(255, 0, 0); border-right-style: none; border-right-width: 0px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-color: rgb(255, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-style: none; 
 border-top-width: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; break-after: auto; break-before: auto; break-inside: auto; buffered-rendering: auto; caption-side: top; caret-color: rgb(255, 0, 0); clear: none; clip: auto; clip-path: none; clip-rule: nonzero; color: rgb(255, 0, 0); color-interpolation: sRGB; color-interpolation-filters: linearRGB; color-rendering: auto; color-scheme: auto; column-count: auto; column-fill: balance; column-gap: normal; column-rule-color: rgb(255, 0, 0); column-rule-style: none; column-rule-width: 0px; column-span: none; column-width: auto; contain: none; content: ; counter-increment: none; counter-reset: none; cursor: auto; cx: 0px; cy: 0px; direction: ltr; display: block; dominant-baseline: auto; empty-cells: show; fill: rgb(0, 0, 0); fill-opacity: 1; fill-rule: nonzero; filter: none; flex-basis: auto; flex-direction: row; flex-grow: 0; flex-shrink: 1; flex-wrap: nowrap; float: none; flood-color: rgb(0, 0, 0); flood-opacity: 1; font-fa
 mily: -webkit-standard; font-feature-settings: normal; font-optical-sizing: auto; font-palette: normal; font-size: 13.333333015441895px; font-stretch: normal; font-style: normal; font-synthesis: style weight small-caps; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; font-weight: 400; glyph-orientation-horizontal: 0deg; glyph-orientation-vertical: auto; grid-auto-columns: auto; grid-auto-flow: row; grid-auto-rows: auto; grid-column-end: auto; grid-column-start: auto; grid-row-end: auto; grid-row-start: auto; grid-template-areas: none; grid-template-columns: none; grid-template-rows: none; hanging-punctuation: none; height: 0px; image-orientation: from-image; image-rendering: auto; inline-size: 784px; input-security: auto; inset-block-end: auto; inset-block-start: auto; inset-inline-end: auto; inset-inline-start: au
 to; isolation: auto; justify-content: normal; justify-items: normal; justify-self: auto; kerning: 0; left: auto; letter-spacing: normal; lighting-color: rgb(255, 255, 255); line-break: auto; line-height: normal; list-style-image: none; list-style-position: outside; list-style-type: disc; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; marker-end: none; marker-mid: none; marker-start: none; mask: none; mask-type: luminance; math-style: normal; max-block-size: none; max-height: none; max-inline-size: none; max-width: none; min-block-size: 0px; min-height: 0px; min-inline-size: 0px; min-width: 0px; mix-blend-mode: normal; object-fit: fill; object-position: 50% 50%; opacity: 1; order: 0; orphans: auto; outline-color: rgb(255, 0, 0); outline-offset: 0px; outline-style: none; outline-width: 0px; overflow-wrap: normal; overflow-x: visible; overflow-y: visible; overscr
 oll-behavior-x: auto; overscroll-behavior-y: auto; padding-block-end: 0px; padding-block-start: 0px; padding-bottom: 0px; padding-inline-end: 0px; padding-inline-start: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; page-break-after: auto; page-break-before: auto; page-break-inside: auto; paint-order: normal; perspective: none; perspective-origin-x: ; perspective-origin-y: ; pointer-events: auto; position: static; quotes: auto; r: 0px; resize: none; right: auto; rotate: none; row-gap: normal; rx: auto; ry: auto; scale: none; scroll-behavior: auto; scroll-margin-block: 0px; scroll-margin-bottom: 0px; scroll-margin-inline: 0px; scroll-margin-left: 0px; scroll-margin-right: 0px; scroll-margin-top: 0px; scroll-padding-block: auto; scroll-padding-bottom: auto; scroll-padding-inline: auto; scroll-padding-left: auto; scroll-padding-right: auto; scroll-padding-top: auto; scroll-snap-align: none; scroll-snap-stop: normal; scroll-snap-type: none; shape-image-threshold: 0; shape
 -margin: 0px; shape-outside: none; shape-rendering: auto; size: ; speak-as: normal; stop-color: rgb(0, 0, 0); stop-opacity: 1; stroke: none; stroke-color: rgba(0, 0, 0, 0); stroke-dasharray: none; stroke-dashoffset: 0px; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; stroke-opacity: 1; stroke-width: 1px; tab-size: 8; table-layout: auto; text-align: start; text-anchor: start; text-decoration: none; text-decoration-color: rgb(255, 0, 0); text-decoration-line: none; text-decoration-skip: auto; text-decoration-skip-ink: auto; text-decoration-style: solid; text-decoration-thickness: auto; text-indent: 0px; text-orientation: mixed; text-overflow: clip; text-rendering: auto; text-shadow: none; text-transform: none; text-underline-offset: auto; text-underline-position: auto; top: auto; touch-action: auto; transform: none; transform-box: view-box; transform-origin-x: ; transform-origin-y: ; transform-origin-z: ; transform-style: flat; transition-delay: 0s; transition-dur
 ation: 0s; transition-property: all; transition-timing-function: ease; translate: none; unicode-bidi: normal; vector-effect: none; vertical-align: baseline; visibility: visible; white-space: normal; widows: auto; width: 784px; will-change: auto; word-break: normal; word-spacing: 0px; word-wrap: normal; writing-mode: horizontal-tb; x: 0px; y: 0px; z-index: auto; zoom: 1; -apple-color-filter: none; -apple-pay-button-style: black; -apple-pay-button-type: plain; -apple-trailing-word: auto; -webkit-appearance: none; -webkit-backdrop-filter: none; -webkit-background-clip: border-box; -webkit-background-composite: source-over; -webkit-background-origin: padding-box; -webkit-background-size: auto; -webkit-border-fit: border; -webkit-border-horizontal-spacing: 0px; -webkit-border-image: none; -webkit-border-vertical-spacing: 0px; -webkit-box-align: stretch; -webkit-box-decoration-break: slice; -webkit-box-direction: normal; -webkit-box-flex: 0; -webkit-box-flex-group: 1; -webkit-box-lines: s
 ingle; -webkit-box-ordinal-group: 1; -webkit-box-orient: horizontal; -webkit-box-pack: start; -webkit-box-reflect: none; -webkit-box-shadow: none; -webkit-column-axis: auto; -webkit-column-break-after: auto; -webkit-column-break-before: auto; -webkit-column-break-inside: auto; -webkit-column-progression: normal; -webkit-cursor-visibility: auto; -webkit-font-kerning: auto; -webkit-font-smoothing: auto; -webkit-hyphenate-character: auto; -webkit-hyphenate-limit-after: auto; -webkit-hyphenate-limit-before: auto; -webkit-hyphenate-limit-lines: no-limit; -webkit-hyphens: manual; -webkit-initial-letter: normal; -webkit-line-align: none; -webkit-line-box-contain: block inline replaced; -webkit-line-clamp: none; -webkit-line-grid: none; -webkit-line-snap: none; -webkit-locale: auto; -webkit-margin-after-collapse: collapse; -webkit-margin-before-collapse: collapse; -webkit-margin-bottom-collapse: collapse; -webkit-margin-top-collapse: collapse; -webkit-mask-box-image: none; -webkit-mask-box-
 image-outset: 0; -webkit-mask-box-image-repeat: stretch; -webkit-mask-box-image-slice: 0 fill; -webkit-mask-box-image-source: none; -webkit-mask-box-image-width: auto; -webkit-mask-clip: border-box; -webkit-mask-composite: source-over; -webkit-mask-image: none; -webkit-mask-mode: match-source; -webkit-mask-origin: border-box; -webkit-mask-position-x: 0%; -webkit-mask-position-y: 0%; -webkit-mask-repeat: repeat; -webkit-mask-size: auto; -webkit-mask-source-type: alpha; -webkit-nbsp-mode: normal; -webkit-print-color-adjust: economy; -webkit-rtl-ordering: logical; -webkit-ruby-position: before; -webkit-text-combine: none; -webkit-text-emphasis-color: rgb(255, 0, 0); -webkit-text-emphasis-position: over right; -webkit-text-emphasis-style: none; -webkit-text-fill-color: rgb(255, 0, 0); -webkit-text-orientation: mixed; -webkit-text-security: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-color: rgb(255, 0, 0); -webkit-text-stroke-width: 0px; -webkit-text-zoom: normal; -webkit-t
 ransform-style: flat; -webkit-user-drag: auto; -webkit-user-modify: read-only; -webkit-user-select: text;"
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt (282850 => 282851)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt	2021-09-22 00:04:34 UTC (rev 282851)
@@ -1,8 +1,8 @@
 
 PASS getComputedStyle returns no style for detached element
-FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 393
-FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 393
-FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 393
-FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 393
+FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 394
+FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 394
+FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 394
+FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 394
 PASS getComputedStyle returns no style for shadow tree outside of flattened tree
 

Modified: trunk/LayoutTests/platform/ios/fast/css/getComputedStyle/computed-style-font-family-expected.txt (282850 => 282851)


--- trunk/LayoutTests/platform/ios/fast/css/getComputedStyle/computed-style-font-family-expected.txt	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/LayoutTests/platform/ios/fast/css/getComputedStyle/computed-style-font-family-expected.txt	2021-09-22 00:04:34 UTC (rev 282851)
@@ -3,6 +3,7 @@
 font-family: monospace, "Lucida Grande", sans-serif;
 font-feature-settings: normal;
 font-optical-sizing: auto;
+font-palette: normal;
 font-size: 16px;
 font-stretch: normal;
 font-style: normal;

Modified: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt (282850 => 282851)


--- trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt	2021-09-22 00:04:34 UTC (rev 282851)
@@ -9,5 +9,5 @@
 PASS invalid property does not appear
 FAIL Shorthands aren't serialized if there are other properties with different logical groups in between assert_equals: expected "margin-top: 10px; margin-right: 10px; margin-left: 10px; margin-inline-start: 10px; margin-block: 10px; margin-inline-end: 10px; margin-bottom: 10px;" but got "margin: 10px; margin-inline: 10px; margin-block: 10px;"
 PASS Shorthands _are_ serialized if there are no other properties with different logical groups in between
-FAIL cssText on computed style declaration returns the empty string assert_equals: cssText is empty expected "" but got "align-content: normal; align-items: normal; align-self: auto; alignment-baseline: auto; all: ; alt: \"\"; animation-delay: 0s; animation-direction: normal; animation-duration: 0s; animation-fill-mode: none; animation-iteration-count: 1; animation-name: none; animation-play-state: running; animation-timing-function: ease; aspect-ratio: auto; backface-visibility: visible; background-attachment: scroll; background-blend-mode: normal; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; baseline-shift: baseline; block-size: 0px; border-block-end-color: rgb(255, 0, 0); border-block-end-style: none; border-block-end-width: 0px; border-block-start-color: rgb(255, 0,
  0); border-block-start-style: none; border-block-start-width: 0px; border-bottom-color: rgb(255, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-bottom-style: none; border-bottom-width: 0px; border-collapse: separate; border-end-end-radius: 0px; border-end-start-radius: 0px; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; border-inline-end-color: rgb(255, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(255, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(255, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(255, 0, 0); border-right-style: none; border-right-width: 0px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-color: rgb(255, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-style: none;
  border-top-width: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; break-after: auto; break-before: auto; break-inside: auto; buffered-rendering: auto; caption-side: top; caret-color: rgb(255, 0, 0); clear: none; clip: auto; clip-path: none; clip-rule: nonzero; color: rgb(255, 0, 0); color-interpolation: sRGB; color-interpolation-filters: linearRGB; color-rendering: auto; color-scheme: auto; column-count: auto; column-fill: balance; column-gap: normal; column-rule-color: rgb(255, 0, 0); column-rule-style: none; column-rule-width: 0px; column-span: none; column-width: auto; contain: none; content: ; counter-increment: none; counter-reset: none; cursor: auto; cx: 0px; cy: 0px; direction: ltr; display: block; dominant-baseline: auto; empty-cells: show; fill: rgb(0, 0, 0); fill-opacity: 1; fill-rule: nonzero; filter: none; flex-basis: auto; flex-direction: row; flex-grow: 0; flex-shrink: 1; flex-wrap: nowrap; float: none; flood-color: rgb(0, 0, 0); flood-opacity: 1; font-f
 amily: -webkit-standard; font-feature-settings: normal; font-optical-sizing: auto; font-size: 13.333333015441895px; font-stretch: normal; font-style: normal; font-synthesis: style weight small-caps; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; font-weight: 400; glyph-orientation-horizontal: 0deg; glyph-orientation-vertical: auto; grid-auto-columns: auto; grid-auto-flow: row; grid-auto-rows: auto; grid-column-end: auto; grid-column-start: auto; grid-row-end: auto; grid-row-start: auto; grid-template-areas: none; grid-template-columns: none; grid-template-rows: none; hanging-punctuation: none; height: 0px; image-orientation: from-image; image-rendering: auto; inline-size: 784px; input-security: auto; inset-block-end: auto; inset-block-start: auto; inset-inline-end: auto; inset-inline-start: auto; isolation: auto; 
 justify-content: normal; justify-items: normal; justify-self: auto; kerning: 0; left: auto; letter-spacing: normal; lighting-color: rgb(255, 255, 255); line-break: auto; line-height: normal; list-style-image: none; list-style-position: outside; list-style-type: disc; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; marker-end: none; marker-mid: none; marker-start: none; mask: none; mask-type: luminance; math-style: normal; max-block-size: none; max-height: none; max-inline-size: none; max-width: none; min-block-size: 0px; min-height: 0px; min-inline-size: 0px; min-width: 0px; mix-blend-mode: normal; object-fit: fill; object-position: 50% 50%; opacity: 1; order: 0; orphans: auto; outline-color: rgb(255, 0, 0); outline-offset: 0px; outline-style: none; outline-width: 0px; overflow-wrap: normal; overflow-x: visible; overflow-y: visible; overscroll-behavior-x: auto;
  overscroll-behavior-y: auto; padding-block-end: 0px; padding-block-start: 0px; padding-bottom: 0px; padding-inline-end: 0px; padding-inline-start: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; page-break-after: auto; page-break-before: auto; page-break-inside: auto; paint-order: normal; perspective: none; perspective-origin-x: ; perspective-origin-y: ; pointer-events: auto; position: static; quotes: auto; r: 0px; resize: none; right: auto; rotate: none; row-gap: normal; rx: auto; ry: auto; scale: none; scroll-behavior: auto; scroll-margin-block: 0px; scroll-margin-bottom: 0px; scroll-margin-inline: 0px; scroll-margin-left: 0px; scroll-margin-right: 0px; scroll-margin-top: 0px; scroll-padding-block: auto; scroll-padding-bottom: auto; scroll-padding-inline: auto; scroll-padding-left: auto; scroll-padding-right: auto; scroll-padding-top: auto; scroll-snap-align: none; scroll-snap-stop: normal; scroll-snap-type: none; shape-image-threshold: 0; shape-margin: 0px; shape-o
 utside: none; shape-rendering: auto; size: ; speak-as: normal; stop-color: rgb(0, 0, 0); stop-opacity: 1; stroke: none; stroke-color: rgba(0, 0, 0, 0); stroke-dasharray: none; stroke-dashoffset: 0px; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; stroke-opacity: 1; stroke-width: 1px; tab-size: 8; table-layout: auto; text-align: start; text-anchor: start; text-decoration: none; text-decoration-color: rgb(255, 0, 0); text-decoration-line: none; text-decoration-skip: auto; text-decoration-skip-ink: auto; text-decoration-style: solid; text-decoration-thickness: auto; text-indent: 0px; text-orientation: mixed; text-overflow: clip; text-rendering: auto; text-shadow: none; text-transform: none; text-underline-offset: auto; text-underline-position: auto; top: auto; touch-action: auto; transform: none; transform-box: view-box; transform-origin-x: ; transform-origin-y: ; transform-origin-z: ; transform-style: flat; transition-delay: 0s; transition-duration: 0s; transition
 -property: all; transition-timing-function: ease; translate: none; unicode-bidi: normal; vector-effect: none; vertical-align: baseline; visibility: visible; white-space: normal; widows: auto; width: 784px; will-change: auto; word-break: normal; word-spacing: 0px; word-wrap: normal; writing-mode: horizontal-tb; x: 0px; y: 0px; z-index: auto; zoom: 1; -apple-color-filter: none; -apple-pay-button-style: black; -apple-pay-button-type: plain; -apple-trailing-word: auto; -webkit-appearance: none; -webkit-backdrop-filter: none; -webkit-background-clip: border-box; -webkit-background-composite: source-over; -webkit-background-origin: padding-box; -webkit-background-size: auto; -webkit-border-fit: border; -webkit-border-horizontal-spacing: 0px; -webkit-border-image: none; -webkit-border-vertical-spacing: 0px; -webkit-box-align: stretch; -webkit-box-decoration-break: slice; -webkit-box-direction: normal; -webkit-box-flex: 0; -webkit-box-flex-group: 1; -webkit-box-lines: single; -webkit-box-or
 dinal-group: 1; -webkit-box-orient: horizontal; -webkit-box-pack: start; -webkit-box-reflect: none; -webkit-box-shadow: none; -webkit-column-axis: auto; -webkit-column-break-after: auto; -webkit-column-break-before: auto; -webkit-column-break-inside: auto; -webkit-column-progression: normal; -webkit-cursor-visibility: auto; -webkit-font-kerning: auto; -webkit-font-smoothing: auto; -webkit-hyphenate-character: auto; -webkit-hyphenate-limit-after: auto; -webkit-hyphenate-limit-before: auto; -webkit-hyphenate-limit-lines: no-limit; -webkit-hyphens: manual; -webkit-initial-letter: normal; -webkit-line-align: none; -webkit-line-box-contain: block inline replaced; -webkit-line-clamp: none; -webkit-line-grid: none; -webkit-line-snap: none; -webkit-locale: auto; -webkit-margin-after-collapse: collapse; -webkit-margin-before-collapse: collapse; -webkit-margin-bottom-collapse: collapse; -webkit-margin-top-collapse: collapse; -webkit-mask-box-image: none; -webkit-mask-box-image-outset: 0; -web
 kit-mask-box-image-repeat: stretch; -webkit-mask-box-image-slice: 0 fill; -webkit-mask-box-image-source: none; -webkit-mask-box-image-width: auto; -webkit-mask-clip: border-box; -webkit-mask-composite: source-over; -webkit-mask-image: none; -webkit-mask-mode: match-source; -webkit-mask-origin: border-box; -webkit-mask-position-x: 0%; -webkit-mask-position-y: 0%; -webkit-mask-repeat: repeat; -webkit-mask-size: auto; -webkit-mask-source-type: alpha; -webkit-nbsp-mode: normal; -webkit-overflow-scrolling: auto; -webkit-print-color-adjust: economy; -webkit-rtl-ordering: logical; -webkit-ruby-position: before; -webkit-text-combine: none; -webkit-text-emphasis-color: rgb(255, 0, 0); -webkit-text-emphasis-position: over right; -webkit-text-emphasis-style: none; -webkit-text-fill-color: rgb(255, 0, 0); -webkit-text-orientation: mixed; -webkit-text-security: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-color: rgb(255, 0, 0); -webkit-text-stroke-width: 0px; -webkit-text-zoom: norm
 al; -webkit-touch-callout: default; -webkit-transform-style: flat; -webkit-user-drag: auto; -webkit-user-modify: read-only; -webkit-user-select: text;"
+FAIL cssText on computed style declaration returns the empty string assert_equals: cssText is empty expected "" but got "align-content: normal; align-items: normal; align-self: auto; alignment-baseline: auto; all: ; alt: \"\"; animation-delay: 0s; animation-direction: normal; animation-duration: 0s; animation-fill-mode: none; animation-iteration-count: 1; animation-name: none; animation-play-state: running; animation-timing-function: ease; aspect-ratio: auto; backface-visibility: visible; background-attachment: scroll; background-blend-mode: normal; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; baseline-shift: baseline; block-size: 0px; border-block-end-color: rgb(255, 0, 0); border-block-end-style: none; border-block-end-width: 0px; border-block-start-color: rgb(255, 0, 
 0); border-block-start-style: none; border-block-start-width: 0px; border-bottom-color: rgb(255, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-bottom-style: none; border-bottom-width: 0px; border-collapse: separate; border-end-end-radius: 0px; border-end-start-radius: 0px; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; border-inline-end-color: rgb(255, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(255, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(255, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(255, 0, 0); border-right-style: none; border-right-width: 0px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-color: rgb(255, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-style: none; 
 border-top-width: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; break-after: auto; break-before: auto; break-inside: auto; buffered-rendering: auto; caption-side: top; caret-color: rgb(255, 0, 0); clear: none; clip: auto; clip-path: none; clip-rule: nonzero; color: rgb(255, 0, 0); color-interpolation: sRGB; color-interpolation-filters: linearRGB; color-rendering: auto; color-scheme: auto; column-count: auto; column-fill: balance; column-gap: normal; column-rule-color: rgb(255, 0, 0); column-rule-style: none; column-rule-width: 0px; column-span: none; column-width: auto; contain: none; content: ; counter-increment: none; counter-reset: none; cursor: auto; cx: 0px; cy: 0px; direction: ltr; display: block; dominant-baseline: auto; empty-cells: show; fill: rgb(0, 0, 0); fill-opacity: 1; fill-rule: nonzero; filter: none; flex-basis: auto; flex-direction: row; flex-grow: 0; flex-shrink: 1; flex-wrap: nowrap; float: none; flood-color: rgb(0, 0, 0); flood-opacity: 1; font-fa
 mily: -webkit-standard; font-feature-settings: normal; font-optical-sizing: auto; font-palette: normal; font-size: 13.333333015441895px; font-stretch: normal; font-style: normal; font-synthesis: style weight small-caps; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; font-weight: 400; glyph-orientation-horizontal: 0deg; glyph-orientation-vertical: auto; grid-auto-columns: auto; grid-auto-flow: row; grid-auto-rows: auto; grid-column-end: auto; grid-column-start: auto; grid-row-end: auto; grid-row-start: auto; grid-template-areas: none; grid-template-columns: none; grid-template-rows: none; hanging-punctuation: none; height: 0px; image-orientation: from-image; image-rendering: auto; inline-size: 784px; input-security: auto; inset-block-end: auto; inset-block-start: auto; inset-inline-end: auto; inset-inline-start: au
 to; isolation: auto; justify-content: normal; justify-items: normal; justify-self: auto; kerning: 0; left: auto; letter-spacing: normal; lighting-color: rgb(255, 255, 255); line-break: auto; line-height: normal; list-style-image: none; list-style-position: outside; list-style-type: disc; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; marker-end: none; marker-mid: none; marker-start: none; mask: none; mask-type: luminance; math-style: normal; max-block-size: none; max-height: none; max-inline-size: none; max-width: none; min-block-size: 0px; min-height: 0px; min-inline-size: 0px; min-width: 0px; mix-blend-mode: normal; object-fit: fill; object-position: 50% 50%; opacity: 1; order: 0; orphans: auto; outline-color: rgb(255, 0, 0); outline-offset: 0px; outline-style: none; outline-width: 0px; overflow-wrap: normal; overflow-x: visible; overflow-y: visible; overscr
 oll-behavior-x: auto; overscroll-behavior-y: auto; padding-block-end: 0px; padding-block-start: 0px; padding-bottom: 0px; padding-inline-end: 0px; padding-inline-start: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; page-break-after: auto; page-break-before: auto; page-break-inside: auto; paint-order: normal; perspective: none; perspective-origin-x: ; perspective-origin-y: ; pointer-events: auto; position: static; quotes: auto; r: 0px; resize: none; right: auto; rotate: none; row-gap: normal; rx: auto; ry: auto; scale: none; scroll-behavior: auto; scroll-margin-block: 0px; scroll-margin-bottom: 0px; scroll-margin-inline: 0px; scroll-margin-left: 0px; scroll-margin-right: 0px; scroll-margin-top: 0px; scroll-padding-block: auto; scroll-padding-bottom: auto; scroll-padding-inline: auto; scroll-padding-left: auto; scroll-padding-right: auto; scroll-padding-top: auto; scroll-snap-align: none; scroll-snap-stop: normal; scroll-snap-type: none; shape-image-threshold: 0; shape
 -margin: 0px; shape-outside: none; shape-rendering: auto; size: ; speak-as: normal; stop-color: rgb(0, 0, 0); stop-opacity: 1; stroke: none; stroke-color: rgba(0, 0, 0, 0); stroke-dasharray: none; stroke-dashoffset: 0px; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; stroke-opacity: 1; stroke-width: 1px; tab-size: 8; table-layout: auto; text-align: start; text-anchor: start; text-decoration: none; text-decoration-color: rgb(255, 0, 0); text-decoration-line: none; text-decoration-skip: auto; text-decoration-skip-ink: auto; text-decoration-style: solid; text-decoration-thickness: auto; text-indent: 0px; text-orientation: mixed; text-overflow: clip; text-rendering: auto; text-shadow: none; text-transform: none; text-underline-offset: auto; text-underline-position: auto; top: auto; touch-action: auto; transform: none; transform-box: view-box; transform-origin-x: ; transform-origin-y: ; transform-origin-z: ; transform-style: flat; transition-delay: 0s; transition-dur
 ation: 0s; transition-property: all; transition-timing-function: ease; translate: none; unicode-bidi: normal; vector-effect: none; vertical-align: baseline; visibility: visible; white-space: normal; widows: auto; width: 784px; will-change: auto; word-break: normal; word-spacing: 0px; word-wrap: normal; writing-mode: horizontal-tb; x: 0px; y: 0px; z-index: auto; zoom: 1; -apple-color-filter: none; -apple-pay-button-style: black; -apple-pay-button-type: plain; -apple-trailing-word: auto; -webkit-appearance: none; -webkit-backdrop-filter: none; -webkit-background-clip: border-box; -webkit-background-composite: source-over; -webkit-background-origin: padding-box; -webkit-background-size: auto; -webkit-border-fit: border; -webkit-border-horizontal-spacing: 0px; -webkit-border-image: none; -webkit-border-vertical-spacing: 0px; -webkit-box-align: stretch; -webkit-box-decoration-break: slice; -webkit-box-direction: normal; -webkit-box-flex: 0; -webkit-box-flex-group: 1; -webkit-box-lines: s
 ingle; -webkit-box-ordinal-group: 1; -webkit-box-orient: horizontal; -webkit-box-pack: start; -webkit-box-reflect: none; -webkit-box-shadow: none; -webkit-column-axis: auto; -webkit-column-break-after: auto; -webkit-column-break-before: auto; -webkit-column-break-inside: auto; -webkit-column-progression: normal; -webkit-cursor-visibility: auto; -webkit-font-kerning: auto; -webkit-font-smoothing: auto; -webkit-hyphenate-character: auto; -webkit-hyphenate-limit-after: auto; -webkit-hyphenate-limit-before: auto; -webkit-hyphenate-limit-lines: no-limit; -webkit-hyphens: manual; -webkit-initial-letter: normal; -webkit-line-align: none; -webkit-line-box-contain: block inline replaced; -webkit-line-clamp: none; -webkit-line-grid: none; -webkit-line-snap: none; -webkit-locale: auto; -webkit-margin-after-collapse: collapse; -webkit-margin-before-collapse: collapse; -webkit-margin-bottom-collapse: collapse; -webkit-margin-top-collapse: collapse; -webkit-mask-box-image: none; -webkit-mask-box-
 image-outset: 0; -webkit-mask-box-image-repeat: stretch; -webkit-mask-box-image-slice: 0 fill; -webkit-mask-box-image-source: none; -webkit-mask-box-image-width: auto; -webkit-mask-clip: border-box; -webkit-mask-composite: source-over; -webkit-mask-image: none; -webkit-mask-mode: match-source; -webkit-mask-origin: border-box; -webkit-mask-position-x: 0%; -webkit-mask-position-y: 0%; -webkit-mask-repeat: repeat; -webkit-mask-size: auto; -webkit-mask-source-type: alpha; -webkit-nbsp-mode: normal; -webkit-overflow-scrolling: auto; -webkit-print-color-adjust: economy; -webkit-rtl-ordering: logical; -webkit-ruby-position: before; -webkit-text-combine: none; -webkit-text-emphasis-color: rgb(255, 0, 0); -webkit-text-emphasis-position: over right; -webkit-text-emphasis-style: none; -webkit-text-fill-color: rgb(255, 0, 0); -webkit-text-orientation: mixed; -webkit-text-security: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-color: rgb(255, 0, 0); -webkit-text-stroke-width: 0px; -w
 ebkit-text-zoom: normal; -webkit-touch-callout: default; -webkit-transform-style: flat; -webkit-user-drag: auto; -webkit-user-modify: read-only; -webkit-user-select: text;"
 

Modified: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt (282850 => 282851)


--- trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt	2021-09-22 00:04:34 UTC (rev 282851)
@@ -1,8 +1,8 @@
 
 PASS getComputedStyle returns no style for detached element
-FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 395
-FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 395
-FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 395
-FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 395
+FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 396
+FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 396
+FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 396
+FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 396
 PASS getComputedStyle returns no style for shadow tree outside of flattened tree
 

Modified: trunk/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-font-family-expected.txt (282850 => 282851)


--- trunk/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-font-family-expected.txt	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-font-family-expected.txt	2021-09-22 00:04:34 UTC (rev 282851)
@@ -3,6 +3,7 @@
 font-family: monospace, "Lucida Grande", sans-serif;
 font-feature-settings: normal;
 font-optical-sizing: auto;
+font-palette: normal;
 font-size: 16px;
 font-stretch: normal;
 font-style: normal;

Modified: trunk/Source/WebCore/ChangeLog (282850 => 282851)


--- trunk/Source/WebCore/ChangeLog	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/Source/WebCore/ChangeLog	2021-09-22 00:04:34 UTC (rev 282851)
@@ -1,3 +1,82 @@
+2021-09-21  Myles C. Maxfield  <[email protected]>
+
+        Parsing support for font-palette
+        https://bugs.webkit.org/show_bug.cgi?id=230394
+
+        Reviewed by Simon Fraser.
+
+        This is a pretty straightforward parsing patch. The grammar is just
+        font-palette: none | normal | light | dark | <palette-identifier>.
+        A <palette-identifier> is a <custom-ident>.
+
+        There is a choice to make about how to represent the parsed data:
+        Option 1:
+        class None {}; class Normal {}; class Light {}; class Dark {};
+        class Custom { String value; };
+        using FontPalette = Variant<None, Normal, Light, Dark, Custom>;
+
+        or,
+        Option 2:
+        struct FontPalette {
+            enum class Type { None, Normal, Light, Dark, Custom } type;
+            String value;
+        };
+
+        Upon advice from a trusted colleague, I chose option 2.
+
+        I'm implementing parsing support for @font-palette-values in
+        https://bugs.webkit.org/show_bug.cgi?id=230337.
+
+        Tests: imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-computed.html
+               imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-invalid.html
+               imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-valid.html
+
+        * Headers.cmake:
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::fontPaletteFromStyle):
+        (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
+        * css/CSSProperties.json:
+        * css/CSSValueKeywords.in:
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::consumeFontPalette):
+        (WebCore::CSSPropertyParser::parseSingleValue):
+        * platform/graphics/FontCache.h:
+        (WebCore::FontDescriptionKeyRareData::create):
+        (WebCore::FontDescriptionKeyRareData::featureSettings const):
+        (WebCore::FontDescriptionKeyRareData::variationSettings const):
+        (WebCore::FontDescriptionKeyRareData::fontPalette const):
+        (WebCore::FontDescriptionKeyRareData::operator== const):
+        (WebCore::FontDescriptionKeyRareData::FontDescriptionKeyRareData):
+        (WebCore::add):
+        (WebCore::FontDescriptionKey::FontDescriptionKey):
+        (WebCore::FontDescriptionKey::operator== const):
+        * platform/graphics/FontCascadeDescription.cpp:
+        * platform/graphics/FontCascadeDescription.h:
+        (WebCore::FontCascadeDescription::initialFontPalette):
+        * platform/graphics/FontDescription.cpp:
+        (WebCore::FontDescription::FontDescription):
+        * platform/graphics/FontDescription.h:
+        (WebCore::FontDescription::fontPalette const):
+        (WebCore::FontDescription::setFontPalette):
+        (WebCore::FontDescription::operator== const):
+        (WebCore::FontDescription::encode const):
+        (WebCore::FontDescription::decode):
+        * platform/graphics/FontPalette.h: Added.
+        (WebCore::FontPaletteNone::operator== const):
+        (WebCore::FontPaletteNone::operator!= const):
+        (WebCore::add):
+        (WebCore::FontPaletteNormal::operator== const):
+        (WebCore::FontPaletteNormal::operator!= const):
+        (WebCore::FontPaletteLight::operator== const):
+        (WebCore::FontPaletteLight::operator!= const):
+        (WebCore::FontPaletteDark::operator== const):
+        (WebCore::FontPaletteDark::operator!= const):
+        (WebCore::FontPaletteCustom::operator== const):
+        (WebCore::FontPaletteCustom::operator!= const):
+        * style/StyleBuilderConverter.h:
+        (WebCore::Style::BuilderConverter::convertFontPalette):
+
 2021-09-21  Brent Fulgham  <[email protected]>
 
         Remove XSS Auditor: Part 2 (Remove engine support)

Modified: trunk/Source/WebCore/Headers.cmake (282850 => 282851)


--- trunk/Source/WebCore/Headers.cmake	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/Source/WebCore/Headers.cmake	2021-09-22 00:04:34 UTC (rev 282851)
@@ -1260,6 +1260,7 @@
     platform/graphics/FontFamilySpecificationNull.h
     platform/graphics/FontGenericFamilies.h
     platform/graphics/FontMetrics.h
+    platform/graphics/FontPalette.h
     platform/graphics/FontPaletteValues.h
     platform/graphics/FontPlatformData.h
     platform/graphics/FontRanges.h

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (282850 => 282851)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-09-22 00:04:34 UTC (rev 282851)
@@ -657,6 +657,7 @@
 		1C6626111C6E7CA600AB527C /* FontFace.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C66260F1C6E7CA600AB527C /* FontFace.h */; };
 		1C73A7132185757E004CCEA5 /* TextUnderlineOffset.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CB6B4FB217B83940093B9CD /* TextUnderlineOffset.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1C73A71521857587004CCEA5 /* TextDecorationThickness.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CB6B4F8217B83930093B9CD /* TextDecorationThickness.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		1C7A6EB526F5D8F50096D8C7 /* FontPalette.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C4674FD26F4843600B61273 /* FontPalette.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1C81B95A0E97330800266E07 /* InspectorController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C81B9560E97330800266E07 /* InspectorController.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1C81B95C0E97330800266E07 /* InspectorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C81B9580E97330800266E07 /* InspectorClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1CAF34810A6C405200ABE06E /* WebScriptObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CAF347E0A6C405200ABE06E /* WebScriptObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -7049,6 +7050,7 @@
 		1C3969CF1B74211E002BCFA7 /* FontCacheCoreText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontCacheCoreText.cpp; sourceTree = "<group>"; };
 		1C43DE6822AB4B8A001527D9 /* LocalCurrentTraitCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalCurrentTraitCollection.h; sourceTree = "<group>"; };
 		1C43DE6A22AB4B8A001527D9 /* LocalCurrentTraitCollection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LocalCurrentTraitCollection.mm; sourceTree = "<group>"; };
+		1C4674FD26F4843600B61273 /* FontPalette.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FontPalette.h; sourceTree = "<group>"; };
 		1C4D0DD124D9F0DB003D7498 /* GlyphBufferMembers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GlyphBufferMembers.h; sourceTree = "<group>"; };
 		1C50C49522C84F2400A6E4BE /* WHLSLStandardLibraryFunctionMap.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WHLSLStandardLibraryFunctionMap.cpp; sourceTree = "<group>"; };
 		1C5E1DA626F949B900E07AF1 /* FontPaletteValues.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FontPaletteValues.h; sourceTree = "<group>"; };
@@ -27004,6 +27006,7 @@
 				E44EE3A617576E5500EEE8CF /* FontGenericFamilies.cpp */,
 				E44EE3A717576E5500EEE8CF /* FontGenericFamilies.h */,
 				0845680712B90DA600960A9F /* FontMetrics.h */,
+				1C4674FD26F4843600B61273 /* FontPalette.h */,
 				1C5E1DA626F949B900E07AF1 /* FontPaletteValues.h */,
 				84B62684133138F90095A489 /* FontPlatformData.cpp */,
 				B5320D69122A24E9002D1440 /* FontPlatformData.h */,
@@ -32505,6 +32508,7 @@
 				658436860AE01B7400E53743 /* FontLoadRequest.h in Headers */,
 				BC4A532F256057CD0028C592 /* FontLoadTimingOverride.h in Headers */,
 				0845680812B90DA600960A9F /* FontMetrics.h in Headers */,
+				1C7A6EB526F5D8F50096D8C7 /* FontPalette.h in Headers */,
 				1C5E1DA826F94B9000E07AF1 /* FontPaletteValues.h in Headers */,
 				B5320D6B122A24E9002D1440 /* FontPlatformData.h in Headers */,
 				371F4FFC0D25E7F300ECE0D5 /* FontRanges.h in Headers */,

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (282850 => 282851)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2021-09-22 00:04:34 UTC (rev 282851)
@@ -1837,6 +1837,23 @@
     return zoomAdjustedPixelValue(style.fontDescription().computedSize(), style);
 }
 
+static Ref<CSSPrimitiveValue> fontPaletteFromStyle(const RenderStyle& style)
+{
+    auto fontPalette = style.fontDescription().fontPalette();
+    switch (fontPalette.type) {
+    case FontPalette::Type::None:
+        return CSSValuePool::singleton().createIdentifierValue(CSSValueNone);
+    case FontPalette::Type::Normal:
+        return CSSValuePool::singleton().createIdentifierValue(CSSValueNormal);
+    case FontPalette::Type::Light:
+        return CSSValuePool::singleton().createIdentifierValue(CSSValueLight);
+    case FontPalette::Type::Dark:
+        return CSSValuePool::singleton().createIdentifierValue(CSSValueDark);
+    case FontPalette::Type::Custom:
+        return CSSValuePool::singleton().createCustomIdent(fontPalette.identifier);
+    }
+}
+
 Ref<CSSPrimitiveValue> ComputedStyleExtractor::fontNonKeywordWeightFromStyleValue(FontSelectionValue weight)
 {
     return CSSValuePool::singleton().createValue(static_cast<float>(weight), CSSUnitType::CSS_NUMBER);
@@ -2940,6 +2957,8 @@
             return fontVariantFromStyle(style);
         case CSSPropertyFontWeight:
             return fontNonKeywordWeightFromStyle(style);
+        case CSSPropertyFontPalette:
+            return fontPaletteFromStyle(style);
         case CSSPropertyFontSynthesis:
             return fontSynthesisFromStyle(style);
         case CSSPropertyFontFeatureSettings: {

Modified: trunk/Source/WebCore/css/CSSProperties.json (282850 => 282851)


--- trunk/Source/WebCore/css/CSSProperties.json	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/Source/WebCore/css/CSSProperties.json	2021-09-22 00:04:34 UTC (rev 282851)
@@ -478,6 +478,18 @@
                 "url": "https://drafts.csswg.org/css-fonts-3/#font-kerning-prop"
             }
         },
+        "font-palette": {
+            "inherited": true,
+            "codegen-properties": {
+                "converter": "FontPalette",
+                "font-property": true,
+                "high-priority": true
+            },
+            "specification": {
+                "category": "css-fonts",
+                "url": "https://drafts.csswg.org/css-fonts/#font-palette-prop"
+            }
+        },
         "-webkit-font-smoothing": {
             "inherited": true,
             "values": [

Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (282850 => 282851)


--- trunk/Source/WebCore/css/CSSValueKeywords.in	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in	2021-09-22 00:04:34 UTC (rev 282851)
@@ -1484,11 +1484,11 @@
 less
 // no-preference
 
-#if defined(ENABLE_DARK_MODE_CSS) && ENABLE_DARK_MODE_CSS
-// prefers-color-scheme
+// prefers-color-scheme, font-palette
 light
 dark
 
+#if defined(ENABLE_DARK_MODE_CSS) && ENABLE_DARK_MODE_CSS
 // color-scheme
 only
 // light

Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (282850 => 282851)


--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2021-09-22 00:04:34 UTC (rev 282851)
@@ -927,6 +927,13 @@
     return nullptr;
 }
 
+static RefPtr<CSSPrimitiveValue> consumeFontPalette(CSSParserTokenRange& range)
+{
+    if (auto result = consumeIdent<CSSValueNone, CSSValueNormal, CSSValueLight, CSSValueDark>(range))
+        return result;
+    return consumeCustomIdent(range);
+}
+
 static RefPtr<CSSValue> consumeFamilyName(CSSParserTokenRange& range)
 {
     auto familyName = consumeFamilyNameRaw(range);
@@ -4017,6 +4024,8 @@
         return consumeFontFamily(m_range);
     case CSSPropertyFontWeight:
         return consumeFontWeight(m_range);
+    case CSSPropertyFontPalette:
+        return consumeFontPalette(m_range);
     case CSSPropertyFontStretch:
         return consumeFontStretch(m_range, CSSValuePool::singleton());
     case CSSPropertyFontStyle:

Modified: trunk/Source/WebCore/platform/graphics/FontCache.h (282850 => 282851)


--- trunk/Source/WebCore/platform/graphics/FontCache.h	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/Source/WebCore/platform/graphics/FontCache.h	2021-09-22 00:04:34 UTC (rev 282851)
@@ -37,9 +37,11 @@
 #include "Timer.h"
 #include <array>
 #include <limits.h>
+#include <wtf/FastMalloc.h>
 #include <wtf/Forward.h>
 #include <wtf/HashTraits.h>
 #include <wtf/ListHashSet.h>
+#include <wtf/PointerComparison.h>
 #include <wtf/RefPtr.h>
 #include <wtf/UniqueRef.h>
 #include <wtf/Vector.h>
@@ -78,6 +80,54 @@
 using IMLangFontLinkType = IMLangFontLink;
 #endif
 
+struct FontDescriptionKeyRareData : public RefCounted<FontDescriptionKeyRareData> {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    static Ref<FontDescriptionKeyRareData> create(FontFeatureSettings&& featureSettings, FontVariationSettings&& variationSettings, FontPalette&& fontPalette)
+    {
+        return adoptRef(*new FontDescriptionKeyRareData(WTFMove(featureSettings), WTFMove(variationSettings), WTFMove(fontPalette)));
+    }
+
+    const FontFeatureSettings& featureSettings() const
+    {
+        return m_featureSettings;
+    }
+
+    const FontVariationSettings& variationSettings() const
+    {
+        return m_variationSettings;
+    }
+
+    const FontPalette& fontPalette() const
+    {
+        return m_fontPalette;
+    }
+
+    bool operator==(const FontDescriptionKeyRareData& other) const
+    {
+        return m_featureSettings == other.m_featureSettings
+            && m_variationSettings == other.m_variationSettings
+            && m_fontPalette == other.m_fontPalette;
+    }
+
+private:
+    FontDescriptionKeyRareData(FontFeatureSettings&& featureSettings, FontVariationSettings&& variationSettings, FontPalette&& fontPalette)
+        : m_featureSettings(WTFMove(featureSettings))
+        , m_variationSettings(WTFMove(variationSettings))
+        , m_fontPalette(WTFMove(fontPalette))
+    {
+    }
+
+    FontFeatureSettings m_featureSettings;
+    FontVariationSettings m_variationSettings;
+    FontPalette m_fontPalette;
+};
+
+inline void add(Hasher& hasher, const FontDescriptionKeyRareData& key)
+{
+    add(hasher, key.featureSettings(), key.variationSettings(), key.fontPalette());
+}
+
 // This key contains the FontDescription fields other than family that matter when fetching FontDatas (platform fonts).
 struct FontDescriptionKey {
     FontDescriptionKey() = default;
@@ -87,9 +137,13 @@
         , m_fontSelectionRequest(description.fontSelectionRequest())
         , m_flags(makeFlagsKey(description))
         , m_locale(description.specifiedLocale())
-        , m_featureSettings(description.featureSettings())
-        , m_variationSettings(description.variationSettings())
-    { }
+    {
+        auto featureSettings = description.featureSettings();
+        auto variationSettings = description.variationSettings();
+        auto fontPalette = description.fontPalette();
+        if (!featureSettings.isEmpty() || !variationSettings.isEmpty() || fontPalette.type != FontPalette::Type::Normal)
+            m_rareData = FontDescriptionKeyRareData::create(WTFMove(featureSettings), WTFMove(variationSettings), WTFMove(fontPalette));
+    }
 
     explicit FontDescriptionKey(WTF::HashTableDeletedValueType)
         : m_isDeletedValue(true)
@@ -102,8 +156,7 @@
             && m_fontSelectionRequest == other.m_fontSelectionRequest
             && m_flags == other.m_flags
             && m_locale == other.m_locale
-            && m_variationSettings == other.m_variationSettings
-            && m_featureSettings == other.m_featureSettings;
+            && arePointingToEqualData(m_rareData, other.m_rareData);
     }
 
     bool operator!=(const FontDescriptionKey& other) const
@@ -152,13 +205,14 @@
     FontSelectionRequest m_fontSelectionRequest;
     std::array<unsigned, 2> m_flags {{ 0, 0 }};
     AtomString m_locale;
-    FontFeatureSettings m_featureSettings;
-    FontVariationSettings m_variationSettings;
+    RefPtr<FontDescriptionKeyRareData> m_rareData;
 };
 
 inline void add(Hasher& hasher, const FontDescriptionKey& key)
 {
-    add(hasher, key.m_size, key.m_fontSelectionRequest, key.m_flags, key.m_locale, key.m_featureSettings, key.m_variationSettings);
+    add(hasher, key.m_size, key.m_fontSelectionRequest, key.m_flags, key.m_locale);
+    if (key.m_rareData)
+        add(hasher, *key.m_rareData);
 }
 
 struct FontDescriptionKeyHash {

Modified: trunk/Source/WebCore/platform/graphics/FontCascadeDescription.cpp (282850 => 282851)


--- trunk/Source/WebCore/platform/graphics/FontCascadeDescription.cpp	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/Source/WebCore/platform/graphics/FontCascadeDescription.cpp	2021-09-22 00:04:34 UTC (rev 282851)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2007 Nicholas Shanks <[email protected]>
- * Copyright (C) 2008, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2008-2021 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -37,6 +37,7 @@
 struct SameSizeAsFontCascadeDescription {
     Vector<void*> vector;
     Vector<void*> vector2;
+    FontPalette palette;
     AtomString string;
     AtomString string2;
     int16_t fontSelectionRequest[3];

Modified: trunk/Source/WebCore/platform/graphics/FontCascadeDescription.h (282850 => 282851)


--- trunk/Source/WebCore/platform/graphics/FontCascadeDescription.h	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/Source/WebCore/platform/graphics/FontCascadeDescription.h	2021-09-22 00:04:34 UTC (rev 282851)
@@ -2,7 +2,7 @@
  * Copyright (C) 2000 Lars Knoll ([email protected])
  *           (C) 2000 Antti Koivisto ([email protected])
  *           (C) 2000 Dirk Mueller ([email protected])
- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2003-2021 Apple Inc. All rights reserved.
  * Copyright (C) 2007 Nicholas Shanks <[email protected]>
  *
  * This library is free software; you can redistribute it and/or
@@ -133,6 +133,7 @@
     static FontVariantAlternates initialVariantAlternates() { return FontVariantAlternates::Normal; }
     static FontOpticalSizing initialOpticalSizing() { return FontOpticalSizing::Enabled; }
     static const AtomString& initialSpecifiedLocale() { return nullAtom(); }
+    static FontPalette initialFontPalette() { return { FontPalette::Type::Normal, nullAtom() }; }
 
 private:
     RefCountedArray<AtomString> m_families { 1 };

Modified: trunk/Source/WebCore/platform/graphics/FontDescription.cpp (282850 => 282851)


--- trunk/Source/WebCore/platform/graphics/FontDescription.cpp	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/Source/WebCore/platform/graphics/FontDescription.cpp	2021-09-22 00:04:34 UTC (rev 282851)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2007 Nicholas Shanks <[email protected]>
- * Copyright (C) 2008, 2013 - 2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2013-2021 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -37,7 +37,8 @@
 namespace WebCore {
 
 FontDescription::FontDescription()
-    : m_fontSelectionRequest { FontCascadeDescription::initialWeight(), FontCascadeDescription::initialStretch(), FontCascadeDescription::initialItalic() }
+    : m_fontPalette({ FontPalette::Type::Normal, nullAtom() })
+    , m_fontSelectionRequest { FontCascadeDescription::initialWeight(), FontCascadeDescription::initialStretch(), FontCascadeDescription::initialItalic() }
     , m_orientation(static_cast<unsigned>(FontOrientation::Horizontal))
     , m_nonCJKGlyphOrientation(static_cast<unsigned>(NonCJKGlyphOrientation::Mixed))
     , m_widthVariant(static_cast<unsigned>(FontWidthVariant::RegularWidth))

Modified: trunk/Source/WebCore/platform/graphics/FontDescription.h (282850 => 282851)


--- trunk/Source/WebCore/platform/graphics/FontDescription.h	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/Source/WebCore/platform/graphics/FontDescription.h	2021-09-22 00:04:34 UTC (rev 282851)
@@ -2,7 +2,7 @@
  * Copyright (C) 2000 Lars Knoll ([email protected])
  *           (C) 2000 Antti Koivisto ([email protected])
  *           (C) 2000 Dirk Mueller ([email protected])
- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2003-2021 Apple Inc. All rights reserved.
  * Copyright (C) 2007 Nicholas Shanks <[email protected]>
  *
  * This library is free software; you can redistribute it and/or
@@ -24,6 +24,7 @@
 
 #pragma once
 
+#include "FontPalette.h"
 #include "FontRenderingMode.h"
 #include "FontSelectionAlgorithm.h"
 #include "FontTaggedSettings.h"
@@ -98,6 +99,7 @@
     FontStyleAxis fontStyleAxis() const { return m_fontStyleAxis ? FontStyleAxis::ital : FontStyleAxis::slnt; }
     AllowUserInstalledFonts shouldAllowUserInstalledFonts() const { return static_cast<AllowUserInstalledFonts>(m_shouldAllowUserInstalledFonts); }
     bool shouldDisableLigaturesForSpacing() const { return m_shouldDisableLigaturesForSpacing; }
+    FontPalette fontPalette() const { return m_fontPalette; }
 
     void setComputedSize(float s) { m_computedSize = clampToFloat(s); }
     void setItalic(std::optional<FontSelectionValue> italic) { m_fontSelectionRequest.slope = italic; }
@@ -132,6 +134,7 @@
     void setFontStyleAxis(FontStyleAxis axis) { m_fontStyleAxis = axis == FontStyleAxis::ital; }
     void setShouldAllowUserInstalledFonts(AllowUserInstalledFonts shouldAllowUserInstalledFonts) { m_shouldAllowUserInstalledFonts = static_cast<unsigned>(shouldAllowUserInstalledFonts); }
     void setShouldDisableLigaturesForSpacing(bool shouldDisableLigaturesForSpacing) { m_shouldDisableLigaturesForSpacing = shouldDisableLigaturesForSpacing; }
+    void setFontPalette(FontPalette fontPalette) { m_fontPalette = fontPalette; }
 
     static AtomString platformResolveGenericFamily(UScriptCode, const AtomString& locale, const AtomString& familyName);
 
@@ -145,6 +148,7 @@
     // FIXME: Investigate moving these into their own object on the heap (to save memory).
     FontFeatureSettings m_featureSettings;
     FontVariationSettings m_variationSettings;
+    FontPalette m_fontPalette;
     AtomString m_locale;
     AtomString m_specifiedLocale;
 
@@ -209,7 +213,8 @@
         && m_opticalSizing == other.m_opticalSizing
         && m_fontStyleAxis == other.m_fontStyleAxis
         && m_shouldAllowUserInstalledFonts == other.m_shouldAllowUserInstalledFonts
-        && m_shouldDisableLigaturesForSpacing == other.m_shouldDisableLigaturesForSpacing;
+        && m_shouldDisableLigaturesForSpacing == other.m_shouldDisableLigaturesForSpacing
+        && m_fontPalette == other.m_fontPalette;
 }
 
 template<class Encoder>
@@ -247,6 +252,7 @@
     encoder << fontStyleAxis();
     encoder << shouldAllowUserInstalledFonts();
     encoder << shouldDisableLigaturesForSpacing();
+    encoder << fontPalette();
 }
 
 template<class Decoder>
@@ -413,6 +419,11 @@
     if (!shouldDisableLigaturesForSpacing)
         return std::nullopt;
 
+    std::optional<FontPalette> fontPalette;
+    decoder >> fontPalette;
+    if (!fontPalette)
+        return std::nullopt;
+
     fontDescription.setFeatureSettings(WTFMove(*featureSettings));
     fontDescription.setVariationSettings(WTFMove(*variationSettings));
     fontDescription.setSpecifiedLocale(*locale);
@@ -445,6 +456,7 @@
     fontDescription.setFontStyleAxis(*fontStyleAxis);
     fontDescription.setShouldAllowUserInstalledFonts(*shouldAllowUserInstalledFonts);
     fontDescription.setShouldDisableLigaturesForSpacing(*shouldDisableLigaturesForSpacing);
+    fontDescription.setFontPalette(*fontPalette);
 
     return fontDescription;
 }

Added: trunk/Source/WebCore/platform/graphics/FontPalette.h (0 => 282851)


--- trunk/Source/WebCore/platform/graphics/FontPalette.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/FontPalette.h	2021-09-22 00:04:34 UTC (rev 282851)
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <wtf/Hasher.h>
+#include <wtf/Variant.h>
+#include <wtf/text/AtomString.h>
+
+namespace WebCore {
+
+struct FontPalette {
+    bool operator==(const FontPalette& other) const
+    {
+        if (type == Type::Custom)
+            return other.type == Type::Custom && identifier == other.identifier;
+        return type == other.type;
+    }
+
+    bool operator!=(const FontPalette& other) const
+    {
+        return !(*this == other);
+    }
+
+    enum class Type : uint8_t {
+        None,
+        Normal,
+        Light,
+        Dark,
+        Custom
+    } type;
+
+    AtomString identifier;
+};
+
+inline void add(Hasher& hasher, const FontPalette& request)
+{
+    add(hasher, request.type);
+    if (request.type == FontPalette::Type::Custom)
+        add(hasher, request.identifier);
+}
+
+}

Modified: trunk/Source/WebCore/style/StyleBuilderConverter.h (282850 => 282851)


--- trunk/Source/WebCore/style/StyleBuilderConverter.h	2021-09-22 00:00:07 UTC (rev 282850)
+++ trunk/Source/WebCore/style/StyleBuilderConverter.h	2021-09-22 00:04:34 UTC (rev 282851)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2013 Google Inc. All rights reserved.
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2021 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -44,6 +44,7 @@
 #include "CSSReflectValue.h"
 #include "CalcExpressionLength.h"
 #include "CalcExpressionOperation.h"
+#include "FontPalette.h"
 #include "FontSelectionValueInlines.h"
 #include "Frame.h"
 #include "GridPositionsResolver.h"
@@ -151,6 +152,7 @@
     static GlyphOrientation convertGlyphOrientationOrAuto(BuilderState&, const CSSValue&);
     static std::optional<Length> convertLineHeight(BuilderState&, const CSSValue&, float multiplier = 1.f);
     static FontSynthesis convertFontSynthesis(BuilderState&, const CSSValue&);
+    static FontPalette convertFontPalette(BuilderState&, const CSSValue&);
     
     static BreakBetween convertPageBreakBetween(BuilderState&, const CSSValue&);
     static BreakInside convertPageBreakInside(BuilderState&, const CSSValue&);
@@ -1547,6 +1549,28 @@
 
     return result;
 }
+
+inline FontPalette BuilderConverter::convertFontPalette(BuilderState&, const CSSValue& value)
+{
+    ASSERT(is<CSSPrimitiveValue>(value));
+    const auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
+    switch (primitiveValue.valueID()) {
+    case CSSValueNone:
+        return { FontPalette::Type::None, nullAtom() };
+    case CSSValueNormal:
+        return { FontPalette::Type::Normal, nullAtom() };
+    case CSSValueLight:
+        return { FontPalette::Type::Light, nullAtom() };
+    case CSSValueDark:
+        return { FontPalette::Type::Dark, nullAtom() };
+    case CSSValueInvalid:
+        ASSERT(primitiveValue.isCustomIdent());
+        return { FontPalette::Type::Custom, primitiveValue.stringValue() };
+    default:
+        ASSERT_NOT_REACHED();
+        return { FontPalette::Type::Normal, nullAtom() };
+    }
+}
     
 inline OptionSet<SpeakAs> BuilderConverter::convertSpeakAs(BuilderState&, const CSSValue& value)
 {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to