Changeset 293521 in webkit


Ignore:
Timestamp:
Apr 27, 2022 11:56:04 AM (3 months ago)
Author:
ntim@apple.com
Message:

[css-text] Make word-wrap CSS property an alias of overflow-wrap
https://bugs.webkit.org/show_bug.cgi?id=166782

Reviewed by Antti Koivisto.

This follows the spec, and fixes cascade issues when applying both properties (see bug 239579).

Relevant WPT expectations updated to pass.

  • LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-layer-expected.txt:
  • LayoutTests/imported/w3c/web-platform-tests/css/css-text/overflow-wrap/word-wrap-alias-expected.txt:
  • Source/WebCore/animation/CSSPropertyAnimation.cpp:

(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):

  • Source/WebCore/css/CSSComputedStyleDeclaration.cpp:

(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):

  • Source/WebCore/css/CSSProperties.json:
  • Source/WebCore/css/parser/CSSParserFastPaths.cpp:

(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):

  • Source/WebCore/editing/Editor.cpp:

(WebCore::Editor::applyEditingStyleToBodyElement const):

  • Source/WebCore/html/HTMLElement.cpp:

(WebCore::HTMLElement::collectPresentationalHintsForAttribute):

  • Source/WebCore/html/HTMLTextAreaElement.cpp:

(WebCore::HTMLTextAreaElement::collectPresentationalHintsForAttribute):

  • LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-layer-expected.txt:
  • LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt:
  • LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
  • LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
  • LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
  • LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
  • LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
  • LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
  • LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
  • LayoutTests/svg/css/getComputedStyle-basic-expected.txt:* web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
  • LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:

Canonical link: https://commits.webkit.org/250052@main

Location:
trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r293517 r293521  
     12022-04-27  Tim Nguyen  <ntim@apple.com>
     2
     3        [css-text] Make word-wrap CSS property an alias of overflow-wrap
     4        https://bugs.webkit.org/show_bug.cgi?id=166782
     5
     6        Reviewed by Antti Koivisto.
     7
     8        This follows the spec, and fixes cascade issues when applying both properties (see bug 239579).
     9
     10        Relevant WPT expectations updated to pass.
     11
     12        * fast/css/getComputedStyle/computed-style-expected.txt:
     13        * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
     14        * platform/gtk/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
     15        * platform/gtk/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
     16        * platform/ios/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
     17        * platform/ios/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
     18        * platform/mac-wk1/imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-layer-expected.txt:
     19        * platform/wpe/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
     20        * platform/wpe/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
     21        * svg/css/getComputedStyle-basic-expected.txt:
     22
    1232022-04-27  Truitt Savell  <tsavell@apple.com>
    224
  • trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt

    r293089 r293521  
    204204word-break: normal;
    205205word-spacing: 0px;
    206 word-wrap: normal;
    207206writing-mode: horizontal-tb;
    208207z-index: auto;
  • trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt

    r293089 r293521  
    203203word-break: normal
    204204word-spacing: 0px
    205 word-wrap: normal
    206205writing-mode: horizontal-tb
    207206z-index: auto
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r293511 r293521  
     12022-04-27  Tim Nguyen  <ntim@apple.com>
     2
     3        [css-text] Make word-wrap CSS property an alias of overflow-wrap
     4        https://bugs.webkit.org/show_bug.cgi?id=166782
     5
     6        Reviewed by Antti Koivisto.
     7
     8        This follows the spec, and fixes cascade issues when applying both properties (see bug 239579).
     9
     10        Relevant WPT expectations updated to pass.
     11
     12        * web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
     13        * web-platform-tests/css/css-cascade/all-prop-revert-layer-expected.txt:
     14        * web-platform-tests/css/css-text/overflow-wrap/word-wrap-alias-expected.txt:
     15        * web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
     16
    1172022-04-27  Ziran Sun  <zsun@igalia.com>
    218
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt

    r293090 r293521  
    333333PASS word-break
    334334PASS word-spacing
    335 PASS word-wrap
    336335PASS writing-mode
    337336PASS x
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-layer-expected.txt

    r293485 r293521  
    217217PASS outline-style
    218218PASS outline-width
    219 FAIL overflow-wrap assert_not_equals: Should get a different computed value. got disallowed value "normal"
     219PASS overflow-wrap
    220220PASS overflow-x
    221221PASS overflow-y
     
    328328PASS word-break
    329329PASS word-spacing
    330 PASS word-wrap
    331330PASS writing-mode
    332331PASS x
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/overflow-wrap/word-wrap-alias-expected.txt

    r242550 r293521  
    11
    2 FAIL word-wrap should be defined as an alias of overflow-wrap assert_equals: Only overflow-wrap should appear when serializing the declaration. expected "overflow-wrap: break-word;" but got "word-wrap: break-word; overflow-wrap: break-word;"
     2PASS word-wrap should be defined as an alias of overflow-wrap
    33
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt

    r293090 r293521  
    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 400
    4 FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 400
    5 FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 400
    6 FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 400
     3FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 399
     4FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 399
     5FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 399
     6FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 399
    77PASS getComputedStyle returns no style for shadow tree outside of flattened tree
    88
  • trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt

    r293090 r293521  
    333333PASS word-break
    334334PASS word-spacing
    335 PASS word-wrap
    336335PASS writing-mode
    337336PASS x
  • trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt

    r293090 r293521  
    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 398
    4 FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 398
    5 FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 398
    6 FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 398
     3FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 397
     4FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 397
     5FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 397
     6FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 397
    77PASS getComputedStyle returns no style for shadow tree outside of flattened tree
    88
  • trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt

    r293090 r293521  
    301301PASS word-break
    302302PASS word-spacing
    303 PASS word-wrap
    304303PASS writing-mode
    305304PASS x
  • trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt

    r293090 r293521  
    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 402
    4 FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 402
    5 FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 402
    6 FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 402
     3FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 401
     4FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 401
     5FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 401
     6FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 401
    77PASS getComputedStyle returns no style for shadow tree outside of flattened tree
    88
  • trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-layer-expected.txt

    r293485 r293521  
    217217PASS outline-style
    218218PASS outline-width
    219 FAIL overflow-wrap assert_not_equals: Should get a different computed value. got disallowed value "normal"
     219PASS overflow-wrap
    220220PASS overflow-x
    221221PASS overflow-y
     
    327327PASS word-break
    328328PASS word-spacing
    329 PASS word-wrap
    330329PASS writing-mode
    331330PASS x
  • trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt

    r293090 r293521  
    333333PASS word-break
    334334PASS word-spacing
    335 PASS word-wrap
    336335PASS writing-mode
    337336PASS x
  • trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt

    r293090 r293521  
    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 397
    4 FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 397
    5 FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 397
    6 FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 397
     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/svg/css/getComputedStyle-basic-expected.txt

    r293089 r293521  
    405405rect: style.getPropertyValue(word-spacing) : 0px
    406406rect: style.getPropertyCSSValue(word-spacing) : [object CSSPrimitiveValue]
    407 rect: style.getPropertyValue(word-wrap) : normal
    408 rect: style.getPropertyCSSValue(word-wrap) : [object CSSPrimitiveValue]
    409407rect: style.getPropertyValue(writing-mode) : horizontal-tb
    410408rect: style.getPropertyCSSValue(writing-mode) : [object CSSPrimitiveValue]
     
    919917g: style.getPropertyValue(word-spacing) : 0px
    920918g: style.getPropertyCSSValue(word-spacing) : [object CSSPrimitiveValue]
    921 g: style.getPropertyValue(word-wrap) : normal
    922 g: style.getPropertyCSSValue(word-wrap) : [object CSSPrimitiveValue]
    923919g: style.getPropertyValue(writing-mode) : horizontal-tb
    924920g: style.getPropertyCSSValue(writing-mode) : [object CSSPrimitiveValue]
  • trunk/Source/WebCore/ChangeLog

    r293516 r293521  
     12022-04-27  Tim Nguyen  <ntim@apple.com>
     2
     3        [css-text] Make word-wrap CSS property an alias of overflow-wrap
     4        https://bugs.webkit.org/show_bug.cgi?id=166782
     5
     6        Reviewed by Antti Koivisto.
     7
     8        This follows the spec, and fixes cascade issues when applying both properties (see bug 239579).
     9
     10        Relevant WPT expectations updated to pass.
     11
     12        * animation/CSSPropertyAnimation.cpp:
     13        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
     14        * css/CSSComputedStyleDeclaration.cpp:
     15        (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
     16        * css/CSSProperties.json:
     17        * css/parser/CSSParserFastPaths.cpp:
     18        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
     19        (WebCore::CSSParserFastPaths::isKeywordPropertyID):
     20        * editing/Editor.cpp:
     21        (WebCore::Editor::applyEditingStyleToBodyElement const):
     22        * html/HTMLElement.cpp:
     23        (WebCore::HTMLElement::collectPresentationalHintsForAttribute):
     24        * html/HTMLTextAreaElement.cpp:
     25        (WebCore::HTMLTextAreaElement::collectPresentationalHintsForAttribute):
     26
    1272022-04-27  Youenn Fablet  <youenn@apple.com>
    228
  • trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp

    r293493 r293521  
    35883588        case CSSPropertyUnicodeRange:
    35893589        case CSSPropertyWillChange:
    3590         case CSSPropertyWordWrap:
    35913590#if ENABLE(APPLE_PAY)
    35923591        case CSSPropertyApplePayButtonStyle:
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r293493 r293521  
    36743674        case CSSPropertyWordSpacing:
    36753675            return zoomAdjustedPixelValue(style.fontCascade().wordSpacing(), style);
    3676         case CSSPropertyWordWrap:
    3677             return cssValuePool.createValue(style.overflowWrap());
    36783676        case CSSPropertyLineBreak:
    36793677            return cssValuePool.createValue(style.lineBreak());
  • trunk/Source/WebCore/css/CSSProperties.json

    r293511 r293521  
    38173817        },
    38183818        "overflow-wrap": {
     3819            "codegen-properties": {
     3820                "aliases": [
     3821                    "word-wrap"
     3822                ]
     3823            },
     3824            "inherited": true,
    38193825            "values": [
    38203826                "normal",
    3821                 "break-word"
     3827                "break-word",
     3828                "anywhere"
    38223829            ],
    38233830            "specification": {
     
    50855092                "category": "css-22",
    50865093                "url": "https://www.w3.org/TR/CSS22/text.html#propdef-word-spacing"
    5087             }
    5088         },
    5089         "word-wrap": {
    5090             "inherited": true,
    5091             "values": [
    5092                 "normal",
    5093                 "break-word"
    5094             ],
    5095             "codegen-properties": {
    5096                 "name-for-methods": "OverflowWrap"
    5097             },
    5098             "status": {
    5099                 "status": "obsolete",
    5100                 "comment": "Replaced by overflow-wrap"
    5101             },
    5102             "specification": {
    5103                 "category": "css-text",
    5104                 "url": "https://www.w3.org/TR/css-text-3/#overflow-wrap"
    51055094            }
    51065095        },
  • trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp

    r293484 r293521  
    674674    //    return valueID == CSSValueNone || valueID == CSSValueAuto;
    675675    case CSSPropertyOverflowWrap: // normal | break-word | anywhere
    676     case CSSPropertyWordWrap:
    677676        return valueID == CSSValueNormal || valueID == CSSValueBreakWord || valueID == CSSValueAnywhere;
    678677    case CSSPropertyOverflowX: // visible | hidden | scroll | auto | overlay (overlay is a synonym for auto)
     
    994993    case CSSPropertyWhiteSpace:
    995994    case CSSPropertyWordBreak:
    996     case CSSPropertyWordWrap:
    997995
    998996    // SVG CSS properties from SVG 1.1, Appendix N: Property Index.
  • trunk/Source/WebCore/editing/Editor.cpp

    r293326 r293521  
    34963496    if (!body)
    34973497        return;
    3498     body->setInlineStyleProperty(CSSPropertyWordWrap, CSSValueBreakWord);
     3498    body->setInlineStyleProperty(CSSPropertyOverflowWrap, CSSValueBreakWord);
    34993499    body->setInlineStyleProperty(CSSPropertyWebkitNbspMode, CSSValueSpace);
    35003500    body->setInlineStyleProperty(CSSPropertyLineBreak, CSSValueAfterWhiteSpace);
  • trunk/Source/WebCore/html/HTMLElement.cpp

    r293491 r293521  
    201201            FALLTHROUGH;
    202202        case ContentEditableType::True:
    203             addPropertyToPresentationalHintStyle(style, CSSPropertyWordWrap, CSSValueBreakWord);
     203            addPropertyToPresentationalHintStyle(style, CSSPropertyOverflowWrap, CSSValueBreakWord);
    204204            addPropertyToPresentationalHintStyle(style, CSSPropertyWebkitNbspMode, CSSValueSpace);
    205205            addPropertyToPresentationalHintStyle(style, CSSPropertyLineBreak, CSSValueAfterWhiteSpace);
  • trunk/Source/WebCore/html/HTMLTextAreaElement.cpp

    r293484 r293521  
    158158        if (shouldWrapText()) {
    159159            addPropertyToPresentationalHintStyle(style, CSSPropertyWhiteSpace, CSSValuePreWrap);
    160             addPropertyToPresentationalHintStyle(style, CSSPropertyWordWrap, CSSValueBreakWord);
     160            addPropertyToPresentationalHintStyle(style, CSSPropertyOverflowWrap, CSSValueBreakWord);
    161161        } else {
    162162            addPropertyToPresentationalHintStyle(style, CSSPropertyWhiteSpace, CSSValuePre);
    163             addPropertyToPresentationalHintStyle(style, CSSPropertyWordWrap, CSSValueNormal);
     163            addPropertyToPresentationalHintStyle(style, CSSPropertyOverflowWrap, CSSValueNormal);
    164164        }
    165165    } else
Note: See TracChangeset for help on using the changeset viewer.