Changeset 283536 in webkit


Ignore:
Timestamp:
Oct 4, 2021 8:52:13 PM (10 months ago)
Author:
mmaxfield@apple.com
Message:

Remove the "none" value from font-palette
https://bugs.webkit.org/show_bug.cgi?id=231050
<rdar://problem/83745650>

Reviewed by Wenson Hsieh.

LayoutTests/imported/w3c:

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

  • web-platform-tests/css/css-fonts/parsing/font-palette-invalid.html:
  • web-platform-tests/css/css-fonts/parsing/font-palette-valid.html:

Source/WebCore:

The spec changed in
https://github.com/w3c/csswg-drafts/commit/b7103b0269cde51914af02f5ca1e5582d44e7b70.
Luckily, we never implemented this anyway, so this is just a parsing change.

Tests: 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

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::fontPaletteFromStyle):

  • css/parser/CSSPropertyParser.cpp:

(WebCore::consumeFontPalette):

  • platform/graphics/FontPalette.h:

(WebCore::operator<<):

  • platform/graphics/cocoa/FontCacheCoreText.cpp:

(WebCore::addAttributesForFontPalettes):

  • style/StyleBuilderConverter.h:

(WebCore::Style::BuilderConverter::convertFontPalette):

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r283534 r283536  
     12021-10-04  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Remove the "none" value from font-palette
     4        https://bugs.webkit.org/show_bug.cgi?id=231050
     5        <rdar://problem/83745650>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        This is being upstreamed at https://github.com/web-platform-tests/wpt/pull/31077.
     10
     11        * web-platform-tests/css/css-fonts/parsing/font-palette-invalid.html:
     12        * web-platform-tests/css/css-fonts/parsing/font-palette-valid.html:
     13
    1142021-10-04  Myles C. Maxfield  <mmaxfield@apple.com>
    215
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-computed-expected.txt

    r283221 r283536  
    11
    2 PASS Property font-palette value 'none'
    32PASS Property font-palette value 'normal'
    43PASS Property font-palette value 'light'
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-computed.html

    r283221 r283536  
    1313<div id="target"></div>
    1414<script>
    15 test_computed_value('font-palette', 'none');
    1615test_computed_value('font-palette', 'normal');
    1716test_computed_value('font-palette', 'light');
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-invalid-expected.txt

    r283221 r283536  
    33PASS e.style['font-palette'] = "none, light" should not set the property value
    44PASS e.style['font-palette'] = "A" should not set the property value
     5PASS e.style['font-palette'] = "none" should not set the property value
    56
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-invalid.html

    r283221 r283536  
    1515test_invalid_value('font-palette', 'none, light');
    1616test_invalid_value('font-palette', 'A');
     17test_invalid_value('font-palette', 'none');
    1718</script>
    1819</body>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-valid-expected.txt

    r283221 r283536  
    11
    2 PASS e.style['font-palette'] = "none" should set the property value
    32PASS e.style['font-palette'] = "normal" should set the property value
    43PASS e.style['font-palette'] = "light" should set the property value
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-valid.html

    r283221 r283536  
    1212<body>
    1313<script>
    14 test_valid_value('font-palette', 'none');
    1514test_valid_value('font-palette', 'normal');
    1615test_valid_value('font-palette', 'light');
  • trunk/Source/WebCore/ChangeLog

    r283535 r283536  
     12021-10-04  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Remove the "none" value from font-palette
     4        https://bugs.webkit.org/show_bug.cgi?id=231050
     5        <rdar://problem/83745650>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        The spec changed in
     10        https://github.com/w3c/csswg-drafts/commit/b7103b0269cde51914af02f5ca1e5582d44e7b70.
     11        Luckily, we never implemented this anyway, so this is just a parsing change.
     12
     13        Tests: imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-invalid.html
     14               imported/w3c/web-platform-tests/css/css-fonts/parsing/font-palette-valid.html
     15
     16        * css/CSSComputedStyleDeclaration.cpp:
     17        (WebCore::fontPaletteFromStyle):
     18        * css/parser/CSSPropertyParser.cpp:
     19        (WebCore::consumeFontPalette):
     20        * platform/graphics/FontPalette.h:
     21        (WebCore::operator<<):
     22        * platform/graphics/cocoa/FontCacheCoreText.cpp:
     23        (WebCore::addAttributesForFontPalettes):
     24        * style/StyleBuilderConverter.h:
     25        (WebCore::Style::BuilderConverter::convertFontPalette):
     26
    1272021-10-04  Alan Bujtas  <zalan@apple.com>
    228
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r283159 r283536  
    18421842    auto fontPalette = style.fontDescription().fontPalette();
    18431843    switch (fontPalette.type) {
    1844     case FontPalette::Type::None:
    1845         return CSSValuePool::singleton().createIdentifierValue(CSSValueNone);
    18461844    case FontPalette::Type::Normal:
    18471845        return CSSValuePool::singleton().createIdentifierValue(CSSValueNormal);
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r283398 r283536  
    930930static RefPtr<CSSPrimitiveValue> consumeFontPalette(CSSParserTokenRange& range)
    931931{
    932     if (auto result = consumeIdent<CSSValueNone, CSSValueNormal, CSSValueLight, CSSValueDark>(range))
     932    if (auto result = consumeIdent<CSSValueNormal, CSSValueLight, CSSValueDark>(range))
    933933        return result;
    934934    return consumeDashedIdent(range);
  • trunk/Source/WebCore/platform/graphics/FontPalette.h

    r283082 r283536  
    4747
    4848    enum class Type : uint8_t {
    49         None,
    5049        Normal,
    5150        Light,
     
    6766{
    6867    switch (fontPalette.type) {
    69     case FontPalette::Type::None:
    70         ts << "none";
    71         break;
    7268    case FontPalette::Type::Normal:
    7369        ts << "normal";
  • trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp

    r283431 r283536  
    500500{
    501501    switch (fontPalette.type) {
    502     case FontPalette::Type::None:
    503         // This is unimplementable in Core Text.
    504         break;
    505502    case FontPalette::Type::Normal:
    506503        break;
  • trunk/Source/WebCore/style/StyleBuilderConverter.h

    r282851 r283536  
    15561556    const auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
    15571557    switch (primitiveValue.valueID()) {
    1558     case CSSValueNone:
    1559         return { FontPalette::Type::None, nullAtom() };
    15601558    case CSSValueNormal:
    15611559        return { FontPalette::Type::Normal, nullAtom() };
Note: See TracChangeset for help on using the changeset viewer.