Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6e21a3c75d32d9379b9cb7a6a364105cc9cebd9d
      
https://github.com/WebKit/WebKit/commit/6e21a3c75d32d9379b9cb7a6a364105cc9cebd9d
  Author: Alan Baradlay <[email protected]>
  Date:   2026-03-02 (Mon, 02 Mar 2026)

  Changed paths:
    A LayoutTests/fast/inline/float-with-collapsed-margin-assert-expected.txt
    A LayoutTests/fast/inline/float-with-collapsed-margin-assert.html
    M Source/WebCore/rendering/RenderBlockFlow.cpp

  Log Message:
  -----------
  [block-in-inline] ASSERT in ~RenderTreeNeedsLayoutChecker with float and 
margin
https://bugs.webkit.org/show_bug.cgi?id=308903

Reviewed by Antti Koivisto.

When a child box shifts in the block direction because of margin collapsing 
(with a float present), it must be laid out again.
To ensure this, we call setNeedsLayout() on the child.
By default, setNeedsLayout() also marks the entire containing block chain as 
dirty.

In normal block layout, the parent is still marked dirty at this stage of the 
layout flow, so practically only the child ends up being marked.

However, in block-in-inline layout, the dirty flags on inline-level boxes are 
cleared just before inline layout begins.
As a result, in a case like <span><div></div></span>, when margin collapsing 
runs on the <div>, the <span> is no longer marked for layout.

This change ensures that we don't leave dirty bits on RenderInlines after 
block-in-inline layout.

Test: fast/inline/float-with-collapsed-margin-assert.html

* LayoutTests/fast/inline/float-with-collapsed-margin-assert-expected.txt: 
Added.
* LayoutTests/fast/inline/float-with-collapsed-margin-assert.html: Added.
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::collapseMargins):

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



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

Reply via email to