[webkit-changes] [WebKit/WebKit] f5f625: When no clearance applies to an element with `clea...

Ahmad Saleem noreply at github.com
Fri Nov 10 04:48:20 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f5f625b225726f4253400640695c0aa7fc1e9f0f
      https://github.com/WebKit/WebKit/commit/f5f625b225726f4253400640695c0aa7fc1e9f0f
  Author: Ahmad Saleem <ahmad.saleem792+github at gmail.com>
  Date:   2023-11-10 (Fri, 10 Nov 2023)

  Changed paths:
    A LayoutTests/fast/block/float/element-clears-float-without-clearance-expected.html
    A LayoutTests/fast/block/float/element-clears-float-without-clearance.html
    M Source/WebCore/rendering/RenderBlockFlow.cpp

  Log Message:
  -----------
  When no clearance applies to an element with `clear` set, place the element below the float just as we would if it was `clear:none`

https://bugs.webkit.org/show_bug.cgi?id=264397

Reviewed by Antti Koivisto.

This patch aligns WebKit with Blink / Chromium and Gecko / Firefox.

Merge: https://chromium.googlesource.com/chromium/blink/+/502ffded2efe7d27b5e0ec085a47d4764b65c12c

If an element has 'clear' set but we don't actually calculate clearance
for it then it should be placed as though it had 'clear:none'. This is
especially pertinent when the element has margin-top that puts it clear of any float.

The relevant web-specification [1] is:

"Computing the clearance of an element on which clear is set is done by ..."

[1] https://drafts.csswg.org/css2/#clearance

* Source/WebCore/rendering/RenderBlockFlow.cpp:
(RenderBlockFlow::marginBeforeEstimateForChild):
* LayoutTests/fast/block/float/element-clears-float-without-clearance.html: Add Test Case
* LayoutTests/fast/block/float/element-clears-float-without-clearance-expected.html: Add Test Case Expectation

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




More information about the webkit-changes mailing list