Bug 264397 - 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
Summary: When no clearance applies to an element with 'clear' set, place the element b...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2023-11-08 03:23 PST by Ahmad Saleem
Modified: 2023-11-10 04:49 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ahmad Saleem 2023-11-08 03:23:44 PST
Hi Team,

I came across another failing test on STP182:

Test Case: https://jsfiddle.net/d83gt4d8/16/

^ This fails in Safari but passes in Chrome Canary 121 and Firefox Nightly 121.

Test Case (from commit): https://jsfiddle.net/vo39besy/show

^ Third last and above fails in Safari.

Blink Commit: https://chromium.googlesource.com/chromium/blink/+/502ffded2efe7d27b5e0ec085a47d4764b65c12c

WebKit Source: https://searchfox.org/wubkat/source/Source/WebCore/rendering/RenderBlockFlow.cpp#1593

____

This compiles:

if (!grandchildBox)
        return;
    // Make sure to update the block margins now for the grandchild box so that we're looking at

...

 // If we have a 'clear' value but also have a margin we may not actually require clearance to move past any floats.
    // If that's the case we want to be sure we estimate the correct position including margins after any floats rather
    // than use 'clearance' later which could give us the wrong position.
    if (RenderStyle::usedClear(*grandchildBox) != UsedClear::None && !childBlock.marginBeforeForChild(*grandchildBox))
        return;

______

It progress above test case and it might also progress 'no-clearance-due-to-large-margin.html' on WPT in css2 directory.

_______

Just wanted to raise, so we can fix it. Adding 'BrowserCompat' since only Safari / WebKit fails it.

Thanks!
Comment 1 Ahmad Saleem 2023-11-08 16:16:29 PST
PR Attempt - https://github.com/WebKit/WebKit/pull/20199
Comment 2 EWS 2023-11-10 04:48:11 PST
Committed 270525@main (f5f625b22572): <https://commits.webkit.org/270525@main>

Reviewed commits have been landed. Closing PR #20199 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2023-11-10 04:49:15 PST
<rdar://problem/118230738>