Changeset 282851 in webkit


Ignore:
Timestamp:
Sep 21, 2021 5:04:34 PM (10 months ago)
Author:
mmaxfield@apple.com
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:
Location:
trunk
Files:
7 added
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r282847 r282851  
     12021-09-21  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Parsing support for font-palette
     4        https://bugs.webkit.org/show_bug.cgi?id=230394
     5
     6        Reviewed by Simon Fraser.
     7
     8        * platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
     9        * platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
     10        * platform/ios/fast/css/getComputedStyle/computed-style-font-family-expected.txt:
     11        * platform/mac/fast/css/getComputedStyle/computed-style-font-family-expected.txt:
     12
    1132021-09-21  Brent Fulgham  <bfulgham@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r282830 r282851  
     12021-09-21  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Parsing support for font-palette
     4        https://bugs.webkit.org/show_bug.cgi?id=230394
     5
     6        Reviewed by Simon Fraser.
     7
     8        This is being upstreamed at https://github.com/web-platform-tests/wpt/pull/30845.
     9
     10        * web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
     11        * web-platform-tests/css/css-fonts/parsing/font-palette-computed-expected.txt: Added.
     12        * web-platform-tests/css/css-fonts/parsing/font-palette-computed.html: Added.
     13        * web-platform-tests/css/css-fonts/parsing/font-palette-invalid-expected.txt: Added.
     14        * web-platform-tests/css/css-fonts/parsing/font-palette-invalid.html: Added.
     15        * web-platform-tests/css/css-fonts/parsing/font-palette-valid-expected.txt: Added.
     16        * web-platform-tests/css/css-fonts/parsing/font-palette-valid.html: Added.
     17        * web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
     18        * web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
     19
    1202021-09-21  Joonghun Park  <pjh0718@gmail.com>
    221
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt

    r282750 r282851  
    121121PASS font-feature-settings
    122122PASS font-optical-sizing
     123PASS font-palette
    123124PASS font-size
    124125PASS font-stretch
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt

    r282750 r282851  
    1010FAIL 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;"
    1111PASS Shorthands _are_ serialized if there are no other properties with different logical groups in between
    12 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-family: -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-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-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-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-transform-style: flat; -webkit-user-drag: auto; -webkit-user-modify: read-only; -webkit-user-select: text;"
     12FAIL 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-family: -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: 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-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-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-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-transform-style: flat; -webkit-user-drag: auto; -webkit-user-modify: read-only; -webkit-user-select: text;"
    1313
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt

    r282750 r282851  
    11
    22PASS getComputedStyle returns no style for detached element
    3 FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 393
    4 FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 393
    5 FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 393
    6 FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 393
     3FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 394
     4FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 394
     5FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 394
     6FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 394
    77PASS getComputedStyle returns no style for shadow tree outside of flattened tree
    88
  • trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt

    r282750 r282851  
    1010FAIL 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;"
    1111PASS Shorthands _are_ serialized if there are no other properties with different logical groups in between
    12 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-family: -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-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-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-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; -webkit-text-zoom: normal; -webkit-touch-callout: default; -webkit-transform-style: flat; -webkit-user-drag: auto; -webkit-user-modify: read-only; -webkit-user-select: text;"
     12FAIL 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-family: -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: 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-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-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-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; -webkit-text-zoom: normal; -webkit-touch-callout: default; -webkit-transform-style: flat; -webkit-user-drag: auto; -webkit-user-modify: read-only; -webkit-user-select: text;"
    1313
  • trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt

    r282750 r282851  
    11
    22PASS getComputedStyle returns no style for detached element
    3 FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 395
    4 FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 395
    5 FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 395
    6 FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 395
     3FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 396
     4FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 396
     5FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 396
     6FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 396
    77PASS getComputedStyle returns no style for shadow tree outside of flattened tree
    88
  • trunk/LayoutTests/platform/ios/fast/css/getComputedStyle/computed-style-font-family-expected.txt

    r282545 r282851  
    44font-feature-settings: normal;
    55font-optical-sizing: auto;
     6font-palette: normal;
    67font-size: 16px;
    78font-stretch: normal;
  • trunk/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-font-family-expected.txt

    r282545 r282851  
    44font-feature-settings: normal;
    55font-optical-sizing: auto;
     6font-palette: normal;
    67font-size: 16px;
    78font-stretch: normal;
  • trunk/Source/WebCore/ChangeLog

    r282847 r282851  
     12021-09-21  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Parsing support for font-palette
     4        https://bugs.webkit.org/show_bug.cgi?id=230394
     5
     6        Reviewed by Simon Fraser.
     7
     8        This is a pretty straightforward parsing patch. The grammar is just
     9        font-palette: none | normal | light | dark | <palette-identifier>.
     10        A <palette-identifier> is a <custom-ident>.
     11
     12        There is a choice to make about how to represent the parsed data:
     13        Option 1:
     14        class None {}; class Normal {}; class Light {}; class Dark {};
     15        class Custom { String value; };
     16        using FontPalette = Variant<None, Normal, Light, Dark, Custom>;
     17
     18        or,
     19        Option 2:
     20        struct FontPalette {
     21            enum class Type { None, Normal, Light, Dark, Custom } type;
     22            String value;
     23        };
     24
     25        Upon advice from a trusted colleague, I chose option 2.
     26
     27        I'm implementing parsing support for @font-palette-values in
     28        https://bugs.webkit.org/show_bug.cgi?id=230337.
     29
     30        Tests: imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-computed.html
     31               imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-invalid.html
     32               imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-valid.html
     33
     34        * Headers.cmake:
     35        * WebCore.xcodeproj/project.pbxproj:
     36        * css/CSSComputedStyleDeclaration.cpp:
     37        (WebCore::fontPaletteFromStyle):
     38        (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
     39        * css/CSSProperties.json:
     40        * css/CSSValueKeywords.in:
     41        * css/parser/CSSPropertyParser.cpp:
     42        (WebCore::consumeFontPalette):
     43        (WebCore::CSSPropertyParser::parseSingleValue):
     44        * platform/graphics/FontCache.h:
     45        (WebCore::FontDescriptionKeyRareData::create):
     46        (WebCore::FontDescriptionKeyRareData::featureSettings const):
     47        (WebCore::FontDescriptionKeyRareData::variationSettings const):
     48        (WebCore::FontDescriptionKeyRareData::fontPalette const):
     49        (WebCore::FontDescriptionKeyRareData::operator== const):
     50        (WebCore::FontDescriptionKeyRareData::FontDescriptionKeyRareData):
     51        (WebCore::add):
     52        (WebCore::FontDescriptionKey::FontDescriptionKey):
     53        (WebCore::FontDescriptionKey::operator== const):
     54        * platform/graphics/FontCascadeDescription.cpp:
     55        * platform/graphics/FontCascadeDescription.h:
     56        (WebCore::FontCascadeDescription::initialFontPalette):
     57        * platform/graphics/FontDescription.cpp:
     58        (WebCore::FontDescription::FontDescription):
     59        * platform/graphics/FontDescription.h:
     60        (WebCore::FontDescription::fontPalette const):
     61        (WebCore::FontDescription::setFontPalette):
     62        (WebCore::FontDescription::operator== const):
     63        (WebCore::FontDescription::encode const):
     64        (WebCore::FontDescription::decode):
     65        * platform/graphics/FontPalette.h: Added.
     66        (WebCore::FontPaletteNone::operator== const):
     67        (WebCore::FontPaletteNone::operator!= const):
     68        (WebCore::add):
     69        (WebCore::FontPaletteNormal::operator== const):
     70        (WebCore::FontPaletteNormal::operator!= const):
     71        (WebCore::FontPaletteLight::operator== const):
     72        (WebCore::FontPaletteLight::operator!= const):
     73        (WebCore::FontPaletteDark::operator== const):
     74        (WebCore::FontPaletteDark::operator!= const):
     75        (WebCore::FontPaletteCustom::operator== const):
     76        (WebCore::FontPaletteCustom::operator!= const):
     77        * style/StyleBuilderConverter.h:
     78        (WebCore::Style::BuilderConverter::convertFontPalette):
     79
    1802021-09-21  Brent Fulgham  <bfulgham@apple.com>
    281
  • trunk/Source/WebCore/Headers.cmake

    r282806 r282851  
    12611261    platform/graphics/FontGenericFamilies.h
    12621262    platform/graphics/FontMetrics.h
     1263    platform/graphics/FontPalette.h
    12631264    platform/graphics/FontPaletteValues.h
    12641265    platform/graphics/FontPlatformData.h
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r282847 r282851  
    658658                1C73A7132185757E004CCEA5 /* TextUnderlineOffset.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CB6B4FB217B83940093B9CD /* TextUnderlineOffset.h */; settings = {ATTRIBUTES = (Private, ); }; };
    659659                1C73A71521857587004CCEA5 /* TextDecorationThickness.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CB6B4F8217B83930093B9CD /* TextDecorationThickness.h */; settings = {ATTRIBUTES = (Private, ); }; };
     660                1C7A6EB526F5D8F50096D8C7 /* FontPalette.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C4674FD26F4843600B61273 /* FontPalette.h */; settings = {ATTRIBUTES = (Private, ); }; };
    660661                1C81B95A0E97330800266E07 /* InspectorController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C81B9560E97330800266E07 /* InspectorController.h */; settings = {ATTRIBUTES = (Private, ); }; };
    661662                1C81B95C0E97330800266E07 /* InspectorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C81B9580E97330800266E07 /* InspectorClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    70507051                1C43DE6822AB4B8A001527D9 /* LocalCurrentTraitCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalCurrentTraitCollection.h; sourceTree = "<group>"; };
    70517052                1C43DE6A22AB4B8A001527D9 /* LocalCurrentTraitCollection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LocalCurrentTraitCollection.mm; sourceTree = "<group>"; };
     7053                1C4674FD26F4843600B61273 /* FontPalette.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FontPalette.h; sourceTree = "<group>"; };
    70527054                1C4D0DD124D9F0DB003D7498 /* GlyphBufferMembers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GlyphBufferMembers.h; sourceTree = "<group>"; };
    70537055                1C50C49522C84F2400A6E4BE /* WHLSLStandardLibraryFunctionMap.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WHLSLStandardLibraryFunctionMap.cpp; sourceTree = "<group>"; };
     
    2700527007                                E44EE3A717576E5500EEE8CF /* FontGenericFamilies.h */,
    2700627008                                0845680712B90DA600960A9F /* FontMetrics.h */,
     27009                                1C4674FD26F4843600B61273 /* FontPalette.h */,
    2700727010                                1C5E1DA626F949B900E07AF1 /* FontPaletteValues.h */,
    2700827011                                84B62684133138F90095A489 /* FontPlatformData.cpp */,
     
    3250632509                                BC4A532F256057CD0028C592 /* FontLoadTimingOverride.h in Headers */,
    3250732510                                0845680812B90DA600960A9F /* FontMetrics.h in Headers */,
     32511                                1C7A6EB526F5D8F50096D8C7 /* FontPalette.h in Headers */,
    3250832512                                1C5E1DA826F94B9000E07AF1 /* FontPaletteValues.h in Headers */,
    3250932513                                B5320D6B122A24E9002D1440 /* FontPlatformData.h in Headers */,
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r282826 r282851  
    18361836{
    18371837    return zoomAdjustedPixelValue(style.fontDescription().computedSize(), style);
     1838}
     1839
     1840static Ref<CSSPrimitiveValue> fontPaletteFromStyle(const RenderStyle& style)
     1841{
     1842    auto fontPalette = style.fontDescription().fontPalette();
     1843    switch (fontPalette.type) {
     1844    case FontPalette::Type::None:
     1845        return CSSValuePool::singleton().createIdentifierValue(CSSValueNone);
     1846    case FontPalette::Type::Normal:
     1847        return CSSValuePool::singleton().createIdentifierValue(CSSValueNormal);
     1848    case FontPalette::Type::Light:
     1849        return CSSValuePool::singleton().createIdentifierValue(CSSValueLight);
     1850    case FontPalette::Type::Dark:
     1851        return CSSValuePool::singleton().createIdentifierValue(CSSValueDark);
     1852    case FontPalette::Type::Custom:
     1853        return CSSValuePool::singleton().createCustomIdent(fontPalette.identifier);
     1854    }
    18381855}
    18391856
     
    29412958        case CSSPropertyFontWeight:
    29422959            return fontNonKeywordWeightFromStyle(style);
     2960        case CSSPropertyFontPalette:
     2961            return fontPaletteFromStyle(style);
    29432962        case CSSPropertyFontSynthesis:
    29442963            return fontSynthesisFromStyle(style);
  • trunk/Source/WebCore/css/CSSProperties.json

    r282806 r282851  
    479479            }
    480480        },
     481        "font-palette": {
     482            "inherited": true,
     483            "codegen-properties": {
     484                "converter": "FontPalette",
     485                "font-property": true,
     486                "high-priority": true
     487            },
     488            "specification": {
     489                "category": "css-fonts",
     490                "url": "https://drafts.csswg.org/css-fonts/#font-palette-prop"
     491            }
     492        },
    481493        "-webkit-font-smoothing": {
    482494            "inherited": true,
  • trunk/Source/WebCore/css/CSSValueKeywords.in

    r282795 r282851  
    14851485// no-preference
    14861486
    1487 #if defined(ENABLE_DARK_MODE_CSS) && ENABLE_DARK_MODE_CSS
    1488 // prefers-color-scheme
     1487// prefers-color-scheme, font-palette
    14891488light
    14901489dark
    14911490
     1491#if defined(ENABLE_DARK_MODE_CSS) && ENABLE_DARK_MODE_CSS
    14921492// color-scheme
    14931493only
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r282830 r282851  
    928928}
    929929
     930static RefPtr<CSSPrimitiveValue> consumeFontPalette(CSSParserTokenRange& range)
     931{
     932    if (auto result = consumeIdent<CSSValueNone, CSSValueNormal, CSSValueLight, CSSValueDark>(range))
     933        return result;
     934    return consumeCustomIdent(range);
     935}
     936
    930937static RefPtr<CSSValue> consumeFamilyName(CSSParserTokenRange& range)
    931938{
     
    40184025    case CSSPropertyFontWeight:
    40194026        return consumeFontWeight(m_range);
     4027    case CSSPropertyFontPalette:
     4028        return consumeFontPalette(m_range);
    40204029    case CSSPropertyFontStretch:
    40214030        return consumeFontStretch(m_range, CSSValuePool::singleton());
  • trunk/Source/WebCore/platform/graphics/FontCache.h

    r278253 r282851  
    3838#include <array>
    3939#include <limits.h>
     40#include <wtf/FastMalloc.h>
    4041#include <wtf/Forward.h>
    4142#include <wtf/HashTraits.h>
    4243#include <wtf/ListHashSet.h>
     44#include <wtf/PointerComparison.h>
    4345#include <wtf/RefPtr.h>
    4446#include <wtf/UniqueRef.h>
     
    7981#endif
    8082
     83struct FontDescriptionKeyRareData : public RefCounted<FontDescriptionKeyRareData> {
     84    WTF_MAKE_FAST_ALLOCATED;
     85public:
     86    static Ref<FontDescriptionKeyRareData> create(FontFeatureSettings&& featureSettings, FontVariationSettings&& variationSettings, FontPalette&& fontPalette)
     87    {
     88        return adoptRef(*new FontDescriptionKeyRareData(WTFMove(featureSettings), WTFMove(variationSettings), WTFMove(fontPalette)));
     89    }
     90
     91    const FontFeatureSettings& featureSettings() const
     92    {
     93        return m_featureSettings;
     94    }
     95
     96    const FontVariationSettings& variationSettings() const
     97    {
     98        return m_variationSettings;
     99    }
     100
     101    const FontPalette& fontPalette() const
     102    {
     103        return m_fontPalette;
     104    }
     105
     106    bool operator==(const FontDescriptionKeyRareData& other) const
     107    {
     108        return m_featureSettings == other.m_featureSettings
     109            && m_variationSettings == other.m_variationSettings
     110            && m_fontPalette == other.m_fontPalette;
     111    }
     112
     113private:
     114    FontDescriptionKeyRareData(FontFeatureSettings&& featureSettings, FontVariationSettings&& variationSettings, FontPalette&& fontPalette)
     115        : m_featureSettings(WTFMove(featureSettings))
     116        , m_variationSettings(WTFMove(variationSettings))
     117        , m_fontPalette(WTFMove(fontPalette))
     118    {
     119    }
     120
     121    FontFeatureSettings m_featureSettings;
     122    FontVariationSettings m_variationSettings;
     123    FontPalette m_fontPalette;
     124};
     125
     126inline void add(Hasher& hasher, const FontDescriptionKeyRareData& key)
     127{
     128    add(hasher, key.featureSettings(), key.variationSettings(), key.fontPalette());
     129}
     130
    81131// This key contains the FontDescription fields other than family that matter when fetching FontDatas (platform fonts).
    82132struct FontDescriptionKey {
     
    88138        , m_flags(makeFlagsKey(description))
    89139        , m_locale(description.specifiedLocale())
    90         , m_featureSettings(description.featureSettings())
    91         , m_variationSettings(description.variationSettings())
    92     { }
     140    {
     141        auto featureSettings = description.featureSettings();
     142        auto variationSettings = description.variationSettings();
     143        auto fontPalette = description.fontPalette();
     144        if (!featureSettings.isEmpty() || !variationSettings.isEmpty() || fontPalette.type != FontPalette::Type::Normal)
     145            m_rareData = FontDescriptionKeyRareData::create(WTFMove(featureSettings), WTFMove(variationSettings), WTFMove(fontPalette));
     146    }
    93147
    94148    explicit FontDescriptionKey(WTF::HashTableDeletedValueType)
     
    103157            && m_flags == other.m_flags
    104158            && m_locale == other.m_locale
    105             && m_variationSettings == other.m_variationSettings
    106             && m_featureSettings == other.m_featureSettings;
     159            && arePointingToEqualData(m_rareData, other.m_rareData);
    107160    }
    108161
     
    153206    std::array<unsigned, 2> m_flags {{ 0, 0 }};
    154207    AtomString m_locale;
    155     FontFeatureSettings m_featureSettings;
    156     FontVariationSettings m_variationSettings;
     208    RefPtr<FontDescriptionKeyRareData> m_rareData;
    157209};
    158210
    159211inline void add(Hasher& hasher, const FontDescriptionKey& key)
    160212{
    161     add(hasher, key.m_size, key.m_fontSelectionRequest, key.m_flags, key.m_locale, key.m_featureSettings, key.m_variationSettings);
     213    add(hasher, key.m_size, key.m_fontSelectionRequest, key.m_flags, key.m_locale);
     214    if (key.m_rareData)
     215        add(hasher, *key.m_rareData);
    162216}
    163217
  • trunk/Source/WebCore/platform/graphics/FontCascadeDescription.cpp

    r266686 r282851  
    11/*
    22 * Copyright (C) 2007 Nicholas Shanks <contact@nickshanks.com>
    3  * Copyright (C) 2008, 2013 Apple Inc. All rights reserved.
     3 * Copyright (C) 2008-2021 Apple Inc. All rights reserved.
    44 *
    55 * Redistribution and use in source and binary forms, with or without
     
    3838    Vector<void*> vector;
    3939    Vector<void*> vector2;
     40    FontPalette palette;
    4041    AtomString string;
    4142    AtomString string2;
  • trunk/Source/WebCore/platform/graphics/FontCascadeDescription.h

    r278253 r282851  
    33 *           (C) 2000 Antti Koivisto (koivisto@kde.org)
    44 *           (C) 2000 Dirk Mueller (mueller@kde.org)
    5  * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights reserved.
     5 * Copyright (C) 2003-2021 Apple Inc. All rights reserved.
    66 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
    77 *
     
    134134    static FontOpticalSizing initialOpticalSizing() { return FontOpticalSizing::Enabled; }
    135135    static const AtomString& initialSpecifiedLocale() { return nullAtom(); }
     136    static FontPalette initialFontPalette() { return { FontPalette::Type::Normal, nullAtom() }; }
    136137
    137138private:
  • trunk/Source/WebCore/platform/graphics/FontDescription.cpp

    r266683 r282851  
    11/*
    22 * Copyright (C) 2007 Nicholas Shanks <contact@nickshanks.com>
    3  * Copyright (C) 2008, 2013 - 2020 Apple Inc. All rights reserved.
     3 * Copyright (C) 2008, 2013-2021 Apple Inc. All rights reserved.
    44 *
    55 * Redistribution and use in source and binary forms, with or without
     
    3838
    3939FontDescription::FontDescription()
    40     : m_fontSelectionRequest { FontCascadeDescription::initialWeight(), FontCascadeDescription::initialStretch(), FontCascadeDescription::initialItalic() }
     40    : m_fontPalette({ FontPalette::Type::Normal, nullAtom() })
     41    , m_fontSelectionRequest { FontCascadeDescription::initialWeight(), FontCascadeDescription::initialStretch(), FontCascadeDescription::initialItalic() }
    4142    , m_orientation(static_cast<unsigned>(FontOrientation::Horizontal))
    4243    , m_nonCJKGlyphOrientation(static_cast<unsigned>(NonCJKGlyphOrientation::Mixed))
  • trunk/Source/WebCore/platform/graphics/FontDescription.h

    r278253 r282851  
    33 *           (C) 2000 Antti Koivisto (koivisto@kde.org)
    44 *           (C) 2000 Dirk Mueller (mueller@kde.org)
    5  * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights reserved.
     5 * Copyright (C) 2003-2021 Apple Inc. All rights reserved.
    66 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
    77 *
     
    2525#pragma once
    2626
     27#include "FontPalette.h"
    2728#include "FontRenderingMode.h"
    2829#include "FontSelectionAlgorithm.h"
     
    99100    AllowUserInstalledFonts shouldAllowUserInstalledFonts() const { return static_cast<AllowUserInstalledFonts>(m_shouldAllowUserInstalledFonts); }
    100101    bool shouldDisableLigaturesForSpacing() const { return m_shouldDisableLigaturesForSpacing; }
     102    FontPalette fontPalette() const { return m_fontPalette; }
    101103
    102104    void setComputedSize(float s) { m_computedSize = clampToFloat(s); }
     
    133135    void setShouldAllowUserInstalledFonts(AllowUserInstalledFonts shouldAllowUserInstalledFonts) { m_shouldAllowUserInstalledFonts = static_cast<unsigned>(shouldAllowUserInstalledFonts); }
    134136    void setShouldDisableLigaturesForSpacing(bool shouldDisableLigaturesForSpacing) { m_shouldDisableLigaturesForSpacing = shouldDisableLigaturesForSpacing; }
     137    void setFontPalette(FontPalette fontPalette) { m_fontPalette = fontPalette; }
    135138
    136139    static AtomString platformResolveGenericFamily(UScriptCode, const AtomString& locale, const AtomString& familyName);
     
    146149    FontFeatureSettings m_featureSettings;
    147150    FontVariationSettings m_variationSettings;
     151    FontPalette m_fontPalette;
    148152    AtomString m_locale;
    149153    AtomString m_specifiedLocale;
     
    210214        && m_fontStyleAxis == other.m_fontStyleAxis
    211215        && m_shouldAllowUserInstalledFonts == other.m_shouldAllowUserInstalledFonts
    212         && m_shouldDisableLigaturesForSpacing == other.m_shouldDisableLigaturesForSpacing;
     216        && m_shouldDisableLigaturesForSpacing == other.m_shouldDisableLigaturesForSpacing
     217        && m_fontPalette == other.m_fontPalette;
    213218}
    214219
     
    248253    encoder << shouldAllowUserInstalledFonts();
    249254    encoder << shouldDisableLigaturesForSpacing();
     255    encoder << fontPalette();
    250256}
    251257
     
    412418    decoder >> shouldDisableLigaturesForSpacing;
    413419    if (!shouldDisableLigaturesForSpacing)
     420        return std::nullopt;
     421
     422    std::optional<FontPalette> fontPalette;
     423    decoder >> fontPalette;
     424    if (!fontPalette)
    414425        return std::nullopt;
    415426
     
    446457    fontDescription.setShouldAllowUserInstalledFonts(*shouldAllowUserInstalledFonts);
    447458    fontDescription.setShouldDisableLigaturesForSpacing(*shouldDisableLigaturesForSpacing);
     459    fontDescription.setFontPalette(*fontPalette);
    448460
    449461    return fontDescription;
  • trunk/Source/WebCore/style/StyleBuilderConverter.h

    r282397 r282851  
    11/*
    22 * Copyright (C) 2013 Google Inc. All rights reserved.
    3  * Copyright (C) 2014 Apple Inc. All rights reserved.
     3 * Copyright (C) 2014-2021 Apple Inc. All rights reserved.
    44 *
    55 * Redistribution and use in source and binary forms, with or without
     
    4545#include "CalcExpressionLength.h"
    4646#include "CalcExpressionOperation.h"
     47#include "FontPalette.h"
    4748#include "FontSelectionValueInlines.h"
    4849#include "Frame.h"
     
    152153    static std::optional<Length> convertLineHeight(BuilderState&, const CSSValue&, float multiplier = 1.f);
    153154    static FontSynthesis convertFontSynthesis(BuilderState&, const CSSValue&);
     155    static FontPalette convertFontPalette(BuilderState&, const CSSValue&);
    154156   
    155157    static BreakBetween convertPageBreakBetween(BuilderState&, const CSSValue&);
     
    15481550    return result;
    15491551}
     1552
     1553inline FontPalette BuilderConverter::convertFontPalette(BuilderState&, const CSSValue& value)
     1554{
     1555    ASSERT(is<CSSPrimitiveValue>(value));
     1556    const auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
     1557    switch (primitiveValue.valueID()) {
     1558    case CSSValueNone:
     1559        return { FontPalette::Type::None, nullAtom() };
     1560    case CSSValueNormal:
     1561        return { FontPalette::Type::Normal, nullAtom() };
     1562    case CSSValueLight:
     1563        return { FontPalette::Type::Light, nullAtom() };
     1564    case CSSValueDark:
     1565        return { FontPalette::Type::Dark, nullAtom() };
     1566    case CSSValueInvalid:
     1567        ASSERT(primitiveValue.isCustomIdent());
     1568        return { FontPalette::Type::Custom, primitiveValue.stringValue() };
     1569    default:
     1570        ASSERT_NOT_REACHED();
     1571        return { FontPalette::Type::Normal, nullAtom() };
     1572    }
     1573}
    15501574   
    15511575inline OptionSet<SpeakAs> BuilderConverter::convertSpeakAs(BuilderState&, const CSSValue& value)
Note: See TracChangeset for help on using the changeset viewer.