Closed Bug 2089406 Opened 15 days ago Closed

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

Categories

(Core :: Layout: Block and Inline, 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 64442 into mozilla-central (this bug is closed when the sync is complete).

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

Alan Baradlay <zalan@apple.com> wrote:

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

WebKit export from bug: [<!---->block-<!---->in-<!---->inline]<!----> inline-<!---->block baseline should fall back to bottom margin edge when content inside is block-<!---->in-<!---->inline only

<pre>
[block-in-inline] inline-block baseline should fall back to bottom margin edge when content inside is block-in-inline only

<span>text
<div style="display: inline-block; width: 320px; height: 100px;">
<span><div style="display: block; width: 320px; height: 100px;"></div></span>
</div>
</span>

The "text" should sit at the bottom of the inline-block. The inline-block's
baseline should be its bottom margin edge per CSS 2.1 10.8.1 (and CSS Inline 3
atomic-inline baseline synthesis), since the only content is block-in-inline
and there are no in-flow line boxes with a baseline. Instead the "text" sat
at the top of the inline-block.

In LayoutIntegrationBoxGeometryUpdater::baselineForBox, the RenderBlockFlow
path called LineLayout::lastLineBaseline() which correctly returns nullopt
when no line contributes a baseline (e.g. when the only content is a
block-in-inline whose inner block is empty). The integration was substituting
0 via .value_or(0_lu) and reporting the inline-block's top edge as its
baseline.

Drop the .value_or(0_lu) so the nullopt propagates: setIntegrationBaseline's
existing fallback then synthesizes margin-box-bottom for atomic inlines (per
css-inline-3 A.3), and lastInflowBoxBaseline's sibling walk skips the
non-contributing child and continues to the previous in-flow block-level
sibling (per css-align-3 §11.5).

LineLayout::lastLineBaseline already recurses into block-in-inline via
blockLevelBoxForLine, so when the inner block does contribute a last baseline
the inline-block aligns to it (covered by css/css-lists/list-and-block-in-inline.html)

WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=315324">https://bugs.webkit.org/show_bug.cgi?id=315324</a>
WebKit-Canonical-Link: <a href="https://commits.webkit.org/313769@main">https://commits.webkit.org/313769@main</a>
</pre>

Whiteboard: [wptsync downstream] → [wptsync downstream error]
Component: web-platform-tests → Layout: Block and Inline
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 436 tests

Status Summary

Firefox

OK : 59
PASS: 2[GitHub] 7[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 842[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 1122[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] 1125[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 20[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 107[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]

Chrome

PASS: 2

Safari

PASS: 2

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

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