Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b0169059361b8eee099b729602e46147cdf1d442
https://github.com/WebKit/WebKit/commit/b0169059361b8eee099b729602e46147cdf1d442
Author: Alan Baradlay <[email protected]>
Date: 2026-08-05 (Wed, 05 Aug 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/CSS2/floats/float-in-block-in-inline-position-001-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/css/CSS2/floats/float-in-block-in-inline-position-001.html
M
Source/WebCore/layout/integration/LayoutIntegrationFormattingContextLayout.cpp
Log Message:
-----------
[block-in-inline] Float inside a block nested in an inline box intrudes at
the wrong position
https://bugs.webkit.org/show_bug.cgi?id=321086
Reviewed by Antti Koivisto.
Floats coming out of a block level box on a line were handed to the inline
formatting context at the
line's top left, but the block's own border box does not sit there:
setTopLeft() a few lines above puts it
at { marginStart, borderBoxTop }, where borderBoxTop is its collapsed
margin-before. Floats therefore
landed that far above where they paint, and lines below the block failed to
avoid them.
LineBuilder deliberately rolls the line top back by the pending margin before
calling in, which is why the
offset has to be re-added here rather than being absent from both sides.
This reproduces in the default configuration, since block-in-inline ships: with
the block nested in an
inline box the probe below the float went to offsetTop -1 and offsetLeft 0,
instead of 99 and 34.
*
Source/WebCore/layout/integration/LayoutIntegrationFormattingContextLayout.cpp:
(WebCore::LayoutIntegration::layoutWithFormattingContextForBlockInInline):
*
LayoutTests/imported/w3c/web-platform-tests/css/CSS2/floats/float-in-block-in-inline-position-001-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/CSS2/floats/float-in-block-in-inline-position-001.html:
Added.
Canonical link: https://commits.webkit.org/318678@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications