[webkit-changes] [WebKit/WebKit] 6c2570: Clear floats added dynamically to previous siblings

Ahmad Saleem noreply at github.com
Wed Nov 2 11:56:09 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6c2570b4a4d2472445444323e37741fc45e90904
      https://github.com/WebKit/WebKit/commit/6c2570b4a4d2472445444323e37741fc45e90904
  Author: Ahmad Saleem <ahmad.saleem792+github at gmail.com>
  Date:   2022-11-02 (Wed, 02 Nov 2022)

  Changed paths:
    A LayoutTests/fast/block/margin-collapse/clear-dynamically-added-float-expected.txt
    A LayoutTests/fast/block/margin-collapse/clear-dynamically-added-float.html
    M Source/WebCore/rendering/RenderBlockFlow.cpp

  Log Message:
  -----------
  Clear floats added dynamically to previous siblings

Clear floats added dynamically to previous siblings
https://bugs.webkit.org/show_bug.cgi?id=247237

Reviewed by Alan Baradlay.

This patch is to align Webkit behavior with Blink / Chrome and Gecko / Firefox.

Merge - https://chromium.googlesource.com/chromium/src.git/+/c75a8e71e60527400e95d0834f4a07a018087130

If margin collapsing moves a child up into a previous
sibling, we shouldn't add any floats that it may have cleared and prompt another layout
so that the child can also clear them if necessary. Confining the need for a layout to
cases where the self-collapsing block has margin excludes the more obvious case
where a sibling has a lot of negative margin and moves up into a sibling with
nested floats inside.

* Source/WebCore/rendering/RenderBlockFlow:
(RenderBlockFlow::collapseMarginsWithChildInfo): Remove "clearanceForSelfCollapsingBlock" and conditions and update comment as needed
* LayoutTests/fast/block/margin-collapse/clear-dynamically-added-float.html: Added Test Case
* LayoutTests/fast/block/margin-collapse/clear-dynamically-added-float-expected.txt: Added Test Case Expectations

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




More information about the webkit-changes mailing list