Closed Bug 2089423 Opened 13 days ago Closed

[wpt-sync] Sync PR 64448 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=313316

Categories

(Core :: CSS Parsing and Computation, task, P4)

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 64448 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/64448
Details from upstream follow.

Alan Baradlay <zalan@apple.com> wrote:

WebKit export of https://bugs.webkit.org/show_bug.cgi?id=313316

WebKit export from bug: Float with margin-<!---->start overlaps adjacent float

<pre>
Float with margin-start overlaps adjacent float

When a float has a non-zero start margin, FloatAvoider::inlineEnd() computes the wrong margin box edge.

Inline start's initial value is the border box start. In order to expand it to the margin box
we do inlineStart -= marginStart (correct). However when we compute inline end as
'inlineStart + borderBoxWidth + marginEnd' the start margin is gone now (incorrect).

For example, a left float with margin-left: 50px and width: 30px should have a
margin box spanning 0..80. But inlineEnd() returned 30 instead of 80 because it
went from margin-box-left (0) + border-box-width (30) + margin-end (0) = 30,
missing the 50px start margin.

This caused findAvailablePosition to think the float was much narrower than it
actually is, so it would not push the float below an adjacent float when the
margin box did not fit.

The fix is to use inlineStart() + marginBoxWidth() for floats, which correctly accounts for all margins.

WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=313316">https://bugs.webkit.org/show_bug.cgi?id=313316</a>
WebKit-Canonical-Link: <a href="https://commits.webkit.org/312083@main">https://commits.webkit.org/312083@main</a>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
</pre>

Whiteboard: [wptsync downstream] → [wptsync downstream error]
Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 157 tests

Status Summary

Firefox

OK : 17
PASS: 9[GitHub] 20[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 116[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 225[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 11

Chrome

PASS: 9

Safari

PASS: 9

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Status: NEW → RESOLVED
Closed: 4 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.