Skip to content
Permalink
Browse files
[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
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@293521 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
nt1m committed Apr 27, 2022
1 parent 924fcee commit 98b7d076cfd49027e10188c29396c8597a10ba6f
Show file tree
Hide file tree
Showing 24 changed files with 95 additions and 59 deletions.
@@ -1,3 +1,25 @@
2022-04-27 Tim Nguyen <ntim@apple.com>

[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.

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

2022-04-27 Truitt Savell <tsavell@apple.com>

Cleanup expectations for 7 imported/w3c/web-platform-tests/html/semantics/interactive-elements/ tests
@@ -203,7 +203,6 @@ width: 784px;
will-change: auto;
word-break: normal;
word-spacing: 0px;
word-wrap: normal;
writing-mode: horizontal-tb;
z-index: auto;
zoom: 1;
@@ -202,7 +202,6 @@ width: 50%
will-change: auto
word-break: normal
word-spacing: 0px
word-wrap: normal
writing-mode: horizontal-tb
z-index: auto
zoom: 1
@@ -1,3 +1,19 @@
2022-04-27 Tim Nguyen <ntim@apple.com>

[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.

* web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* web-platform-tests/css/css-cascade/all-prop-revert-layer-expected.txt:
* web-platform-tests/css/css-text/overflow-wrap/word-wrap-alias-expected.txt:
* web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:

2022-04-27 Ziran Sun <zsun@igalia.com>

[css-ui] Remove some unimplemented -webkit-appearance keywords
@@ -332,7 +332,6 @@ PASS width
PASS will-change
PASS word-break
PASS word-spacing
PASS word-wrap
PASS writing-mode
PASS x
PASS y
@@ -216,7 +216,7 @@ PASS outline-color
PASS outline-offset
PASS outline-style
PASS outline-width
FAIL overflow-wrap assert_not_equals: Should get a different computed value. got disallowed value "normal"
PASS overflow-wrap
PASS overflow-x
PASS overflow-y
PASS overscroll-behavior-x
@@ -327,7 +327,6 @@ PASS width
PASS will-change
PASS word-break
PASS word-spacing
PASS word-wrap
PASS writing-mode
PASS x
PASS y
@@ -1,3 +1,3 @@

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;"
PASS word-wrap should be defined as an alias of overflow-wrap

@@ -1,8 +1,8 @@

PASS getComputedStyle returns no style for detached element
FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 400
FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 400
FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 400
FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 400
FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 399
FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 399
FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 399
FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 399
PASS getComputedStyle returns no style for shadow tree outside of flattened tree

@@ -332,7 +332,6 @@ PASS width
PASS will-change
PASS word-break
PASS word-spacing
PASS word-wrap
PASS writing-mode
PASS x
PASS y
@@ -1,8 +1,8 @@

PASS getComputedStyle returns no style for detached element
FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 398
FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 398
FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 398
FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 398
FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 397
FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 397
FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 397
FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 397
PASS getComputedStyle returns no style for shadow tree outside of flattened tree

@@ -300,7 +300,6 @@ PASS width
PASS will-change
PASS word-break
PASS word-spacing
PASS word-wrap
PASS writing-mode
PASS x
PASS y
@@ -1,8 +1,8 @@

PASS getComputedStyle returns no style for detached element
FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 402
FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 402
FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 402
FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 402
FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 401
FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 401
FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 401
FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 401
PASS getComputedStyle returns no style for shadow tree outside of flattened tree

@@ -216,7 +216,7 @@ PASS outline-color
PASS outline-offset
PASS outline-style
PASS outline-width
FAIL overflow-wrap assert_not_equals: Should get a different computed value. got disallowed value "normal"
PASS overflow-wrap
PASS overflow-x
PASS overflow-y
PASS overscroll-behavior-x
@@ -326,7 +326,6 @@ PASS width
PASS will-change
PASS word-break
PASS word-spacing
PASS word-wrap
PASS writing-mode
PASS x
PASS y
@@ -332,7 +332,6 @@ PASS width
PASS will-change
PASS word-break
PASS word-spacing
PASS word-wrap
PASS writing-mode
PASS x
PASS y
@@ -1,8 +1,8 @@

PASS getComputedStyle returns no style for detached element
FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 397
FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 397
FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 397
FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 397
FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 396
FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 396
FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 396
FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 396
PASS getComputedStyle returns no style for shadow tree outside of flattened tree

@@ -404,8 +404,6 @@ rect: style.getPropertyValue(word-break) : normal
rect: style.getPropertyCSSValue(word-break) : [object CSSPrimitiveValue]
rect: style.getPropertyValue(word-spacing) : 0px
rect: style.getPropertyCSSValue(word-spacing) : [object CSSPrimitiveValue]
rect: style.getPropertyValue(word-wrap) : normal
rect: style.getPropertyCSSValue(word-wrap) : [object CSSPrimitiveValue]
rect: style.getPropertyValue(writing-mode) : horizontal-tb
rect: style.getPropertyCSSValue(writing-mode) : [object CSSPrimitiveValue]
rect: style.getPropertyValue(z-index) : auto
@@ -918,8 +916,6 @@ g: style.getPropertyValue(word-break) : normal
g: style.getPropertyCSSValue(word-break) : [object CSSPrimitiveValue]
g: style.getPropertyValue(word-spacing) : 0px
g: style.getPropertyCSSValue(word-spacing) : [object CSSPrimitiveValue]
g: style.getPropertyValue(word-wrap) : normal
g: style.getPropertyCSSValue(word-wrap) : [object CSSPrimitiveValue]
g: style.getPropertyValue(writing-mode) : horizontal-tb
g: style.getPropertyCSSValue(writing-mode) : [object CSSPrimitiveValue]
g: style.getPropertyValue(z-index) : auto
@@ -1,3 +1,29 @@
2022-04-27 Tim Nguyen <ntim@apple.com>

[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.

* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/CSSProperties.json:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* editing/Editor.cpp:
(WebCore::Editor::applyEditingStyleToBodyElement const):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::collectPresentationalHintsForAttribute):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::collectPresentationalHintsForAttribute):

2022-04-27 Youenn Fablet <youenn@apple.com>

[Mac] http/tests/media/user-gesture-preserved-across-xmlhttprequest.html is a flaky fail/crash/timeout
@@ -3587,7 +3587,6 @@ CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap()
case CSSPropertyUnicodeBidi:
case CSSPropertyUnicodeRange:
case CSSPropertyWillChange:
case CSSPropertyWordWrap:
#if ENABLE(APPLE_PAY)
case CSSPropertyApplePayButtonStyle:
case CSSPropertyApplePayButtonType:
@@ -3673,8 +3673,6 @@ RefPtr<CSSValue> ComputedStyleExtractor::valueForPropertyInStyle(const RenderSty
return cssValuePool.createValue(style.wordBreak());
case CSSPropertyWordSpacing:
return zoomAdjustedPixelValue(style.fontCascade().wordSpacing(), style);
case CSSPropertyWordWrap:
return cssValuePool.createValue(style.overflowWrap());
case CSSPropertyLineBreak:
return cssValuePool.createValue(style.lineBreak());
case CSSPropertyWebkitNbspMode:
@@ -3816,9 +3816,16 @@
}
},
"overflow-wrap": {
"codegen-properties": {
"aliases": [
"word-wrap"
]
},
"inherited": true,
"values": [
"normal",
"break-word"
"break-word",
"anywhere"
],
"specification": {
"category": "css-text",
@@ -5086,24 +5093,6 @@
"url": "https://www.w3.org/TR/CSS22/text.html#propdef-word-spacing"
}
},
"word-wrap": {
"inherited": true,
"values": [
"normal",
"break-word"
],
"codegen-properties": {
"name-for-methods": "OverflowWrap"
},
"status": {
"status": "obsolete",
"comment": "Replaced by overflow-wrap"
},
"specification": {
"category": "css-text",
"url": "https://www.w3.org/TR/css-text-3/#overflow-wrap"
}
},
"x": {
"codegen-properties": {
"initial": "initialZeroLength",
@@ -673,7 +673,6 @@ bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId
// case CSSPropertyOverflowAnchor:
// return valueID == CSSValueNone || valueID == CSSValueAuto;
case CSSPropertyOverflowWrap: // normal | break-word | anywhere
case CSSPropertyWordWrap:
return valueID == CSSValueNormal || valueID == CSSValueBreakWord || valueID == CSSValueAnywhere;
case CSSPropertyOverflowX: // visible | hidden | scroll | auto | overlay (overlay is a synonym for auto)
if (context.overflowClipEnabled && valueID == CSSValueClip)
@@ -993,7 +992,6 @@ bool CSSParserFastPaths::isKeywordPropertyID(CSSPropertyID propertyId)
case CSSPropertyUserSelect:
case CSSPropertyWhiteSpace:
case CSSPropertyWordBreak:
case CSSPropertyWordWrap:

// SVG CSS properties from SVG 1.1, Appendix N: Property Index.
case CSSPropertyAlignmentBaseline:
@@ -3495,7 +3495,7 @@ void Editor::applyEditingStyleToBodyElement() const
RefPtr body { document().body() };
if (!body)
return;
body->setInlineStyleProperty(CSSPropertyWordWrap, CSSValueBreakWord);
body->setInlineStyleProperty(CSSPropertyOverflowWrap, CSSValueBreakWord);
body->setInlineStyleProperty(CSSPropertyWebkitNbspMode, CSSValueSpace);
body->setInlineStyleProperty(CSSPropertyLineBreak, CSSValueAfterWhiteSpace);
}
@@ -200,7 +200,7 @@ void HTMLElement::collectPresentationalHintsForAttribute(const QualifiedName& na
userModifyValue = CSSValueReadWritePlaintextOnly;
FALLTHROUGH;
case ContentEditableType::True:
addPropertyToPresentationalHintStyle(style, CSSPropertyWordWrap, CSSValueBreakWord);
addPropertyToPresentationalHintStyle(style, CSSPropertyOverflowWrap, CSSValueBreakWord);
addPropertyToPresentationalHintStyle(style, CSSPropertyWebkitNbspMode, CSSValueSpace);
addPropertyToPresentationalHintStyle(style, CSSPropertyLineBreak, CSSValueAfterWhiteSpace);
#if PLATFORM(IOS_FAMILY)
@@ -157,10 +157,10 @@ void HTMLTextAreaElement::collectPresentationalHintsForAttribute(const Qualified
if (name == wrapAttr) {
if (shouldWrapText()) {
addPropertyToPresentationalHintStyle(style, CSSPropertyWhiteSpace, CSSValuePreWrap);
addPropertyToPresentationalHintStyle(style, CSSPropertyWordWrap, CSSValueBreakWord);
addPropertyToPresentationalHintStyle(style, CSSPropertyOverflowWrap, CSSValueBreakWord);
} else {
addPropertyToPresentationalHintStyle(style, CSSPropertyWhiteSpace, CSSValuePre);
addPropertyToPresentationalHintStyle(style, CSSPropertyWordWrap, CSSValueNormal);
addPropertyToPresentationalHintStyle(style, CSSPropertyOverflowWrap, CSSValueNormal);
}
} else
HTMLTextFormControlElement::collectPresentationalHintsForAttribute(name, value, style);

0 comments on commit 98b7d07

Please sign in to comment.