Closed Bug 2089438 Opened 14 days ago Closed 5 days ago

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

Categories

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

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

Alan Baradlay <zalan@apple.com> wrote:

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

WebKit export from bug: [<!---->Table]<!----> Incorrect distributed height when \<<!---->td><!----> height is set

<pre>
[Table] Incorrect distributed height when <td> height is set

When a table has a CSS height larger than its content, the extra height
should be distributed to rows. This works for rows with auto height, but
fails for rows with an explicit height (e.g. <td height=1px>). Instead
of reaching 100px, the table ends up shorter.

The problem is in distributeRemainingExtraLogicalHeight, which
distributes leftover height proportionally to existing row sizes. It used
m_rowPos[totalRows] as the total size, but m_rowPos includes
border-spacing -- both the initial spacing before the first row and the
spacing between rows. When computing each row's share, the spacing
portion absorbs some of the extra height that should go entirely to rows.

For example, with one row of height 4px and border-spacing 2px:
totalRowSize = 6 (includes 2px spacing), row share = 94 * 4/6 = 62.66.
The remaining 31px is silently lost.

The fix adds a rowLogicalHeight() helper that returns the actual row
height excluding border-spacing, and uses it for proportional
distribution. Row heights are pre-computed into a vector before the
distribution loop since the loop modifies m_rowPos (reading
rowLogicalHeight during the loop would use already-modified values,
producing wildly negative weights). When all rows are zero-height,
it distributes equally instead of doing nothing.

Also fixed the same spacing-included-in-row-height issue in
distributeExtraLogicalHeightToPercentRows.

This includes the lint fixes from <a href="https://commits.webkit.org/325383@main.">https://commits.webkit.org/325383@main.</a>

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

Whiteboard: [wptsync downstream] → [wptsync downstream error]
Component: web-platform-tests → Layout: Tables
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 351 tests

Status Summary

Firefox

OK : 1[GitHub] 136[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-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS: 3[GitHub] 41[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 856[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 1003[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] 1011[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 95[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 114[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 116[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]

Chrome

OK : 1
PASS: 3

Safari

OK : 1
PASS: 3

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

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