[webkit-changes] [WebKit/WebKit] 0c0259: (REGRESSION 262277 at main) Incorrect float placement...

Alan Baradlay noreply at github.com
Tue Aug 15 10:40:13 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0c0259832cca2e7079e2e2d3d333d12df35da090
      https://github.com/WebKit/WebKit/commit/0c0259832cca2e7079e2e2d3d333d12df35da090
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2023-08-15 (Tue, 15 Aug 2023)

  Changed paths:
    A LayoutTests/fast/block/float/float-left-with-clear-right-incorrect-position-expected.html
    A LayoutTests/fast/block/float/float-left-with-clear-right-incorrect-position.html
    M Source/WebCore/layout/floats/FloatingContext.cpp

  Log Message:
  -----------
  (REGRESSION 262277 at main) Incorrect float placement when clear is present
https://bugs.webkit.org/show_bug.cgi?id=260202
<rdar://111577468>

Reviewed by Antti Koivisto.

When no float is present at the clear direction it still needs to "clear" the existing floats.

e.g.

<div style="float: left"></div>
<div style="float: left; clear: right;"></div>

(notice we are supposed to clear right, but there's no right float in this context)

This patch ensures that we take existing floats into account for the initial position when there's nothing to clear.

* LayoutTests/fast/block/float/float-left-with-clear-right-incorrect-position-expected.html: Added.
* LayoutTests/fast/block/float/float-left-with-clear-right-incorrect-position.html: Added.
* Source/WebCore/layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::positionForFloat const):
(WebCore::Layout::FloatingContext::bottom const):

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




More information about the webkit-changes mailing list