Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c6d517a398fcb58985b5e1904aeab231c658caf9
https://github.com/WebKit/WebKit/commit/c6d517a398fcb58985b5e1904aeab231c658caf9
Author: Ahmad Saleem <[email protected]>
Date: 2026-10-05 (Mon, 05 Oct 2026)
Changed paths:
A
LayoutTests/fast/inline/selection-gap-with-block-in-inline-negative-top-expected.html
A
LayoutTests/fast/inline/selection-gap-with-block-in-inline-negative-top.html
M Source/WebCore/rendering/RenderBlockFlow.cpp
Log Message:
-----------
Selection gaps are not painted for a line whose selection top is above its
block container
https://bugs.webkit.org/show_bug.cgi?id=326233
rdar://189113277
Reviewed by Alan Baradlay.
RenderBlockFlow::inlineSelectionGaps builds a rect to decide whether a line
overlaps
the paint rect, but it passed the line's bottom (selectionTop +
selectionHeight) as the
rect's height. When selectionTop is positive this only makes the rect taller
than it
should be. When it is negative, for example for a block level box in an inline
box with
a large negative margin, the rect shrinks or flips above the line. The line is
then
wrongly treated as outside the paint rect and its selection gaps are not
painted.
Pass selectionHeight as the height.
Test: fast/inline/selection-gap-with-block-in-inline-negative-top.html
*
LayoutTests/fast/inline/selection-gap-with-block-in-inline-negative-top-expected.html:
Added.
* LayoutTests/fast/inline/selection-gap-with-block-in-inline-negative-top.html:
Added.
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::inlineSelectionGaps):
Canonical link: https://commits.webkit.org/322750@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications