Closed Bug 2094538 Opened 17 days ago Closed 14 days ago

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

Categories

(Core :: Layout: Tables, task, P4)

task

Tracking

()

RESOLVED FIXED
163 Branch
Tracking Status
firefox163 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [wptsync downstream])

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

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

Alan Baradlay <zalan@apple.com> wrote:

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

WebKit export from bug: Fix imported/<!---->w3c/<!---->web-<!---->platform-<!---->tests/<!---->css/<!---->css-<!---->tables/<!---->absolute-<!---->tables-<!---->015.<!---->html

<pre>
Fix css/css-tables/absolute-tables-015.html

A table with width: 0px was treated as width: auto, causing
percentage column scaling to inflate the table to its max-content
width instead of its min-content width.

For example:

<table style="width: 0px">
<td style="width: 100%;">
<span style="display: inline-block; width: 100px; height: 50px;"></span>
<span style="display: inline-block; width: 100px; height: 50px;"></span>
</td>
</table>

Expected: table is 100px (min-content), spans stack vertically.
Actual: table is 200px (max-content scaled by td width: 100%).

The condition in RenderTable::updateLogicalWidth that decides
whether to use the specified-width path or the auto-width path was:

styleLogicalWidth.isSpecified() && styleLogicalWidth.isPossiblyPositive()

isPossiblyPositive() returns false for 0, so width: 0px fell into
the auto-width path. The auto-width path uses
scaledWidthFromPercentColumns (from td width: 100%), which scales
the max-content width (204) to fill the available space (200).

The fix adds isKnownZero() to the condition so width: 0px takes
the specified-width path: the table gets width 0, then line 341
expands it to minPreferredLogicalWidth (100 - the min-content).

This changes the expectation of the replaced-element subtest of percentage-sizing-of-table-cell-children.html: with the table's width: 0px giving it its min-content width, the input's percentage width makes its min-content contribution zero (it's a compressible replaced element), so the input ends up 0px wide.

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

Component: web-platform-tests → Layout: Tables
Product: Testing → Core

CI Results

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

Total 1 tests and 10 subtests

Status Summary

Firefox

OK : 1
PASS: 7
FAIL: 3

Chrome

OK : 1
PASS: 10

Safari

OK : 1
PASS: 10

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

Firefox-only Failures

New Tests That Don't Pass

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