Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9aadd01d4225e121ed0393e9a91849f27c90fae3
https://github.com/WebKit/WebKit/commit/9aadd01d4225e121ed0393e9a91849f27c90fae3
Author: Alan Baradlay <[email protected]>
Date: 2026-06-15 (Mon, 15 Jun 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/reference/text-decoration-decorating-box-002-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-decorating-box-002-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-decorating-box-002.html
M Source/WebCore/rendering/TextBoxPainter.cpp
M Source/WebCore/rendering/TextDecorationPainter.h
Log Message:
-----------
Underline is drawn twice on a <sup>
https://bugs.webkit.org/show_bug.cgi?id=316601
<rdar://problem/179537119>
Reviewed by Antti Koivisto.
<div style="text-decoration: underline green">
A<span style="text-decoration: overline green; vertical-align: top">B</span>
</div>
The underline should be one line under both "A" and the superscript "B".
Instead "B" got a second underline at its raised position, so the line
looked broken in two.
Each text box paints its slice of the decorations from its decorating-box
ancestors. The span counts as a decorating box for its own overline, but the
set of lines it painted came from text-decoration-line-in-effect, which also
includes the underline propagated from the div. So the raised "B" painted that
underline again at its own offset, on top of the one the root inline box
already draws at the baseline.
A non-root decorating box now keeps only the decorations it originates (its own
text-decoration-line); a propagated underline or overline it does not originate
is dropped, unless a marked text genuinely overrides it. The root inline box
and <a>/<font> keep the in-effect decorations. Per css-text-decor a
vertical-align'd inline takes its parent's underline position.
* Source/WebCore/rendering/TextBoxPainter.cpp:
(WebCore::isAlwaysDecoratingBoxForBackground):
(WebCore::isDecoratingBoxForBackground):
(WebCore::TextBoxPainter::collectDecoratingBoxesForBackgroundPainting):
* Source/WebCore/rendering/TextDecorationPainter.h:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-decorating-box-002.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-decorating-box-002-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/reference/text-decoration-decorating-box-002-ref.html:
Added.
Canonical link: https://commits.webkit.org/315220@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications