Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6235dda9e0d0d0af2e7dabeda75b28f8cc2a114d
https://github.com/WebKit/WebKit/commit/6235dda9e0d0d0af2e7dabeda75b28f8cc2a114d
Author: Alan Baradlay <[email protected]>
Date: 2026-06-16 (Tue, 16 Jun 2026)
Changed paths:
A LayoutTests/fast/inline/text-box-trim-with-underline-ex-expected.html
A LayoutTests/fast/inline/text-box-trim-with-underline-ex.html
M Source/WebCore/style/InlineTextBoxStyle.cpp
Log Message:
-----------
[text-box-edge] ex misplaces the propagated underline (paints it twice)
https://bugs.webkit.org/show_bug.cgi?id=317179
<rdar://problem/179769451>
Reviewed by Antti Koivisto.
<div style="text-decoration: underline">
<span style="text-decoration: underline; text-box: trim-both ex alphabetic">
A
</span>
</div>
The underline should be one line under the span. Instead it was painted twice:
the span's own underline sat where it belongs while the underline propagated
from the div landed about half an x-height away.
text-box-edge: ex trims the span so its top is the x-height line, moving the box
down from its full-ascent top by ascent - xHeight. A text box painting a
decoration owned by an ancestor shifts the slice up by that trimmed amount, but
textBoxEdgeAdjustmentForUnderline returned xHeight instead of ascent - xHeight,
so the slice was off by 2 * xHeight - ascent.
* LayoutTests/fast/inline/text-box-trim-with-underline-ex-expected.html: Added.
* LayoutTests/fast/inline/text-box-trim-with-underline-ex.html: Added.
* Source/WebCore/style/InlineTextBoxStyle.cpp:
(WebCore::textBoxEdgeAdjustmentForUnderline):
Canonical link: https://commits.webkit.org/315331@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications