Skip to content

Commit

Permalink
[CSS] Unprefix text-decoration shorthand
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=230083
rdar://83182835

 Reviewed by NOBODY (OOPS!).

 Explanation of why this fixes the bug (OOPS!).

* LayoutTests/TestExpectations:
* LayoutTests/fast/css/getComputedStyle/getComputedStyle-text-decoration-expected.txt:
* LayoutTests/fast/css/getComputedStyle/getComputedStyle-text-decoration.html:
* LayoutTests/fast/css/style-enumerate-properties-expected.txt:
* LayoutTests/fast/css/style-enumerate-properties.html:
* LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-expected.txt:
* LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand.html:
* LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-dashed.html:
* LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-dotted-dashed.html:
* LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-dotted.html:
* LayoutTests/fast/events/input-events-paste-rich-datatransfer-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-letter-allowed-properties-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-line-allowed-properties-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/parsing/text-decoration-computed-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/parsing/text-decoration-shorthand-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/parsing/text-decoration-valid-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-serialization.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/inserttext_2001-last-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/multitest_4001-5000-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/multitest_8001-9000-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/multitest_9001-last-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/strikethrough_2001-last-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/underline_2001-last-expected.txt:
* Source/WebCore/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/ComputedStyleExtractor.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle const):
(WebCore::ComputedStyleExtractor::textDecorationShorthandValue const):
* Source/WebCore/css/ComputedStyleExtractor.h:
* Source/WebCore/css/MutableStyleProperties.cpp:
(WebCore::MutableStyleProperties::setProperty):
* Source/WebCore/css/MutableStyleProperties.h:
* Source/WebCore/css/ShorthandSerializer.cpp:
(WebCore::ShorthandSerializer::serialize):
* Source/WebCore/css/StyleProperties.cpp:
(WebCore::canUseShorthandForLonghand):
* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseShorthand):
* Source/WebCore/editing/EditingStyle.cpp:
(WebCore::HTMLTextDecorationEquivalent::HTMLTextDecorationEquivalent):
(WebCore::EditingStyle::init):
(WebCore::EditingStyle::styleWithResolvedTextDecorations const):
(WebCore::EditingStyle::collapseTextDecorationProperties):
(WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
(WebCore::EditingStyle::mergeStyle):
(WebCore::EditingStyle::removeEquivalentProperties):
(WebCore::reconcileTextDecorationProperties):
(WebCore::StyleChange::StyleChange):
(WebCore::setTextDecorationProperty):
(WebCore::StyleChange::extractTextStyles):
(WebCore::diffTextDecorations):
* Source/WebCore/editing/markup.cpp:
(WebCore::serializePreservingVisualAppearanceInternal):
  • Loading branch information
mdubet committed Mar 26, 2024
1 parent 6aefea9 commit 2cd03bd
Show file tree
Hide file tree
Showing 66 changed files with 363 additions and 323 deletions.
27 changes: 14 additions & 13 deletions LayoutTests/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -3797,25 +3797,14 @@ webkit.org/b/203583 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio-
# wpt css-text-decor failures
webkit.org/b/230041 imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-color-selection-001.html [ ImageOnlyFailure ]
webkit.org/b/230041 imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-color-selection-pseudo-01.html [ ImageOnlyFailure ]
webkit.org/b/203530 imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-line-recalc.html [ ImageOnlyFailure ]
webkit.org/b/203528 imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-linethrough-001.html [ ImageOnlyFailure ]
webkit.org/b/203528 imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-overline-001.html [ ImageOnlyFailure ]
webkit.org/b/203528 imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-scroll-001.html [ ImageOnlyFailure ]
webkit.org/b/203528 imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-underline-001.html [ ImageOnlyFailure ]
webkit.org/b/203528 imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-vertical-001.html [ ImageOnlyFailure ]
webkit.org/b/203528 imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-vertical-002.html [ ImageOnlyFailure ]
webkit.org/b/203528 imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-percent-001.html [ ImageOnlyFailure ]
webkit.org/b/203529 imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-underline-position-vertical-ja.html [ ImageOnlyFailure ]
webkit.org/b/203529 imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-underline-position-vertical.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-propagation-display-contents.html [ ImageOnlyFailure ]
webkit.org/b/230083 imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-skip-ink-001.html [ ImageOnlyFailure ]
webkit.org/b/230083 imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-skip-ink-004.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-skip-ink-005.html [ ImageOnlyFailure ]
webkit.org/b/230083 imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-skip-ink-sidewayslr-001.html [ ImageOnlyFailure ]
webkit.org/b/230083 imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-skip-ink-sidewaysrl-001.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-skip-ink-upright-001.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-skip-ink-vertical-001.html [ ImageOnlyFailure ]
webkit.org/b/230083 imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-001.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-text-decor/text-emphasis-position-over-left-002.xht [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-text-decor/text-emphasis-position-over-right-002.xht [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-text-decor/text-emphasis-position-under-left-001.xht [ ImageOnlyFailure ]
Expand All @@ -3833,7 +3822,6 @@ imported/w3c/web-platform-tests/css/css-text-decor/text-emphasis-style-filled-00
imported/w3c/web-platform-tests/css/css-text-decor/text-emphasis-style-open-001.xht [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-text-decor/text-emphasis-style-shape-001.xht [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-text-decor/text-emphasis-style-string-001.xht [ ImageOnlyFailure ]
webkit.org/b/230083 imported/w3c/web-platform-tests/css/css-text-decor/text-underline-offset-001.html [ ImageOnlyFailure ]

# wpt css-position failures
webkit.org/b/203445 [ Debug ] imported/w3c/web-platform-tests/css/css-position/position-absolute-container-dynamic-002.html [ Skip ]
Expand Down Expand Up @@ -4888,8 +4876,15 @@ webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/intrinsic-per
webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-replaced-dynamic-009.html [ ImageOnlyFailure ]
webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-replaced-dynamic-010.html [ ImageOnlyFailure ]

# Bugs with text-decoration-thickness
webkit.org/b/214464 imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-ink-skip-dilation.html [ ImageOnlyFailure ]

# writing-mode: sideways-lr not supported
imported/w3c/web-platform-tests/css/css-text-decor/text-underline-offset-vertical-002.html [ ImageOnlyFailure ]

# text-underline-position: right; not supported
webkit.org/b/112615 imported/w3c/web-platform-tests/css/css-text-decor/text-underline-offset-vertical-003.html [ ImageOnlyFailure ]

webkit.org/b/214465 imported/w3c/web-platform-tests/css/mediaqueries/prefers-color-scheme-svg-image.html [ ImageOnlyFailure ]
webkit.org/b/214465 imported/w3c/web-platform-tests/css/mediaqueries/prefers-color-scheme-svg-image-normal-with-meta-dark.html [ ImageOnlyFailure ]

Expand Down Expand Up @@ -5246,7 +5241,13 @@ webkit.org/b/230004 imported/w3c/web-platform-tests/css/css-pseudo/selection-int
webkit.org/b/230004 imported/w3c/web-platform-tests/css/css-pseudo/selection-overlay-and-grammar-001.html [ ImageOnlyFailure ]
webkit.org/b/230004 imported/w3c/web-platform-tests/css/css-pseudo/selection-overlay-and-spelling-001.html [ ImageOnlyFailure ]
webkit.org/b/230004 imported/w3c/web-platform-tests/css/css-pseudo/selection-textarea-011.html [ ImageOnlyFailure ]

webkit.org/b/233927 imported/w3c/web-platform-tests/css/css-pseudo/highlight-painting-003.html [ ImageOnlyFailure ]
webkit.org/b/233927 imported/w3c/web-platform-tests/css/css-pseudo/highlight-painting-004.html [ ImageOnlyFailure ]
webkit.org/b/233927 imported/w3c/web-platform-tests/css/css-pseudo/selection-originating-decoration-color.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-highlight-api/painting/css-highlight-painting-underline-offset-001.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-highlight-api/painting/custom-highlight-painting-text-decoration-001.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-highlight-api/painting/custom-highlight-painting-text-decoration-dynamic-001.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-highlight-api/painting/invalidation/css-highlight-invalidation-001.html [ ImageOnlyFailure ]

# css/filter-effects
imported/w3c/web-platform-tests/css/filter-effects/backdrop-filter-fixed-clip.html [ ImageOnlyFailure ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ WebKit should not generate a span with background-color property in such cases.
| "\n"
| <p>
| id="destination"
| "hello<#selection-caret>world"
| "hello<#selection-caret>"
| <span>
| style="text-decoration: none;"
| "world"
| "\n"
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Rich text
"text/plain": ""
},
"drop": {
"text/html": "<!DOCTYPE html><strong style=\"font-family: -apple-system; font-size: 150px; font-style: normal; font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: nowrap; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; color: purple;\">Rich text</strong>",
"text/html": "<!DOCTYPE html><strong style=\"font-family: -apple-system; font-size: 150px; font-style: normal; font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: nowrap; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-line: none; color: purple;\">Rich text</strong>",
"text/plain": "Rich text"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ Content to insert:
After insertion:
| <div>
| contenteditable=""
| "hello "
| <span>
| style="text-decoration: none;"
| "hello "
| <span>
| style="text-decoration: line-through;"
| "world<#selection-caret>"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This test for a bug copy/pasting underlined text. The color of the underline should be the color of the element that has the text-decoration property.
| <span>
| style="caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); text-decoration: underline;"
| style="caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); text-decoration-line: underline;"
| "This should be underlined.<#selection-caret>"
| <br>
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ PASS underline on second word of <u><strike>hello world webkit</strike></u> yiel
PASS underline on second word of <u><strike>hello world</strike> webkit</u> yields <strike><u>hello</u> world</strike><u> webkit</u>
PASS underline on second word of <u>hello <em><code>world webkit</code></em> rocks</u> yields <u>hello</u> <em><code>world<u> webkit</u></code></em><u> rocks</u>
PASS strikeThrough on all of <s style="color: blue;">hello world</strike> yields <span style="color: blue;">hello world</span>
PASS strikeThrough on first word of <s style="color: blue;"><div>hello</div> <b>world</b> webkit</strike> yields <span style="color: blue;"><div>hello</div> <b style="text-decoration: line-through;">world</b><strike> webkit</strike></span>
PASS strikeThrough on first word of <s style="color: blue;"><div>hello</div> <b>world</b> webkit</strike> yields <span style="color: blue;"><div>hello</div> <b style="text-decoration-line: line-through;">world</b><strike> webkit</strike></span>
PASS successfullyParsed is true

TEST COMPLETE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
testSingleToggle("underline", selectSecondWord, '<u>hello <em><code>world webkit</code></em> rocks</u>', '<u>hello</u> <em><code>world<u> webkit</u></code></em><u> rocks</u>');

testSingleToggle("strikeThrough", selectAll, '<s style="color: blue;">hello world</strike>', '<span style="color: blue;">hello world</span>');
testSingleToggle("strikeThrough", selectFirstWord, '<s style="color: blue;"><div>hello</div> <b>world</b> webkit</strike>', '<span style="color: blue;"><div>hello</div> <b style="text-decoration: line-through;">world</b><strike> webkit</strike></span>');
testSingleToggle("strikeThrough", selectFirstWord, '<s style="color: blue;"><div>hello</div> <b>world</b> webkit</strike>', '<span style="color: blue;"><div>hello</div> <b style="text-decoration-line: line-through;">world</b><strike> webkit</strike></span>');

document.body.removeChild(testContainer);

Expand Down

0 comments on commit 2cd03bd

Please sign in to comment.