Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 2bc4378d1c8c1bea754fa716a7002050adc76b9a
https://github.com/WebKit/WebKit/commit/2bc4378d1c8c1bea754fa716a7002050adc76b9a
Author: Alan Baradlay <[email protected]>
Date: 2025-11-01 (Sat, 01 Nov 2025)
Changed paths:
A LayoutTests/fast/inline/text-box-trim-with-underline2-expected.html
A LayoutTests/fast/inline/text-box-trim-with-underline2.html
M Source/WebCore/rendering/TextBoxPainter.cpp
M Source/WebCore/style/InlineTextBoxStyle.cpp
M Source/WebCore/style/InlineTextBoxStyle.h
Log Message:
-----------
[text-decoration] Incorrect underline position when inline box sides are
trimmed
https://bugs.webkit.org/show_bug.cgi?id=301794
Reviewed by Antti Koivisto.
1. In 'TextBoxPainter::collectDecoratingBoxesForBackgroundPainting', make
'decoratingBoxLocation' represent the actual position of the decorating box
itself, not the position of the text content inside it (the inline box).
(While these typically align, in cases with trimmed sides, the inline box can
be offset while the text content remains in its original position.)
2. Make sure that 'underlineOffsetForTextBoxPainting' consistently returns the
underline position relative to the decorating inline box - not the text
_inside_ the decorating inline box (see #1).
Test: fast/inline/text-box-trim-with-underline2.html
* LayoutTests/fast/inline/text-box-trim-with-underline2-expected.html: Added.
* LayoutTests/fast/inline/text-box-trim-with-underline2.html: Added.
* Source/WebCore/rendering/TextBoxPainter.cpp:
(WebCore::TextBoxPainter::collectDecoratingBoxesForBackgroundPainting):
* Source/WebCore/style/InlineTextBoxStyle.cpp:
(WebCore::textBoxEdgeAdjustmentForUnderline):
(WebCore::underlineOffsetForTextBoxPainting):
* Source/WebCore/style/InlineTextBoxStyle.h:
Canonical link: https://commits.webkit.org/302435@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications