Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6b008edc4f7b617013ea647109ac8149243bbec8
https://github.com/WebKit/WebKit/commit/6b008edc4f7b617013ea647109ac8149243bbec8
Author: Alan Baradlay <[email protected]>
Date: 2026-06-16 (Tue, 16 Jun 2026)
Changed paths:
A LayoutTests/fast/inline/hidpi-underline-under-superscript-expected.html
A LayoutTests/fast/inline/hidpi-underline-under-superscript.html
M Source/WebCore/rendering/TextBoxPainter.cpp
Log Message:
-----------
[subpixel] Underline under a <sup> is offset by a device pixel from the rest
of the line
https://bugs.webkit.org/show_bug.cgi?id=317080
<rdar://problem/179586525>
Reviewed by Antti Koivisto.
<div style="text-decoration: underline green; font-size: 100px">
1
<sup>2</sup>
</div>
The green underline should be one straight line under "1" and the superscript
"2".
Instead the part under "2" was painted one device pixel below the rest, so the
single line looked broken in two.
Each text box paints its own slice of the propagated underline from one rect
that
was fully device-pixel snapped up front. The superscript's slice took its
block-axis
origin from that snapped rect, shifted it into the decorating box's frame, then
got
snapped again at paint time. Two snaps with the shift between them rounded that
slice
onto a different device row than the slice under "1". At 1x it rounds away;
above 1x
they split.
Hand the decoration painters a rect whose block-axis origin stays continuous,
so it
is snapped exactly once, at paint time. The inline slice (x and width) stays
snapped
so adjacent slices still tile, since paint snaps the origin but never the width.
* Source/WebCore/rendering/TextBoxPainter.cpp:
(WebCore::TextBoxPainter::paintForegroundAndDecorations):
* LayoutTests/fast/inline/hidpi-underline-under-superscript.html: Added.
* LayoutTests/fast/inline/hidpi-underline-under-superscript-expected.html:
Added.
Canonical link: https://commits.webkit.org/315316@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications