Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e40ae8c085c10d883b0a7792ee9f97a0f08956ac
      
https://github.com/WebKit/WebKit/commit/e40ae8c085c10d883b0a7792ee9f97a0f08956ac
  Author: Alan Baradlay <[email protected]>
  Date:   2026-02-20 (Fri, 20 Feb 2026)

  Changed paths:
    A LayoutTests/fast/inline/block-in-inlinw-with-br-and-margin-expected.html
    A LayoutTests/fast/inline/block-in-inlinw-with-br-and-margin.html
    A 
LayoutTests/fast/inline/line-break-position-with-block-and-margin-inside-inline-expected.html
    A 
LayoutTests/fast/inline/line-break-position-with-block-and-margin-inside-inline.html
    M LayoutTests/platform/ios/fast/css/word-space-extra-expected.txt
    M LayoutTests/platform/mac/fast/css/word-space-extra-expected.txt
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp

  Log Message:
  -----------
  [block-in-inline] Incorrect <br> position when block margin is present
https://bugs.webkit.org/show_bug.cgi?id=308174

Reviewed by Antti Koivisto.

<br> is considered inline content and it should prevent margin collapsing.

While this test _ visually_ passes on trunk, the line box (the <br> belongs to) 
is at an incorrect vertical position.
It is adjacent to the block box's border box as if there was no bottom margin, 
while it should be down by 100px in block direction (adjacent to the margin 
box).

The reason why rendering is correct is because later, in handleAfterSideMargin 
we figure out that the trailing line has inline content which
prevents margin collapsing.

* LayoutTests/fast/inline/block-in-inlinw-with-br-and-margin-expected.html: 
Added.
* LayoutTests/fast/inline/block-in-inlinw-with-br-and-margin.html: Added.
* 
LayoutTests/fast/inline/line-break-position-with-block-and-margin-inside-inline-expected.html:
 Added.
* 
LayoutTests/fast/inline/line-break-position-with-block-and-margin-inside-inline.html:
 Added.
* LayoutTests/platform/ios/fast/css/word-space-extra-expected.txt:
* LayoutTests/platform/mac/fast/css/word-space-extra-expected.txt:
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::placeInlineAndFloatContent):

Canonical link: https://commits.webkit.org/307932@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to