Closed Bug 1936549 Opened 1 year ago Closed 1 year ago

Incorrect TD baseline with empty TD, height, and border-collapse

Categories

(Core :: Layout: Tables, defect)

Firefox 133
defect

Tracking

()

VERIFIED FIXED
135 Branch
Tracking Status
firefox135 --- verified
firefox136 --- verified

People

(Reporter: mvdleij, Assigned: emilio)

References

Details

Attachments

(3 files)

Attached image jsfiddle output.png

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0

Steps to reproduce:

See https://jsfiddle.net/s407w5Lc/ or the following html:

<head>
<style>
TABLE.collapse { border-collapse:collapse }
TR { vertical-align:baseline }
TD { border: 1px solid black }
TABLE.height TD { height: 30px }
</style>
</head><body>
<table class="collapse height">
<tr><td>ABCDE</td><td></td></tr>
</table>
</body>

Actual results:

The row in the table has an incorrect baseline. The text in the first cell appears too low and the bottom is cut off.

Expected results:

The row should have the same baseline as when the cell next to it is not empty, and as when border-collapse is not present on the table. That is, the row should look similar to the second and third table in https://jsfiddle.net/s407w5Lc/

The Bugbug bot thinks this bug should belong to the 'Core::Layout: Tables' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Layout: Tables
Product: Firefox → Core
Attached file test-case

So... behavior here changed in bug 1923201, but before that patch it wasn't quite correct either (the table ended up taller than the expected 30px).

Status: UNCONFIRMED → NEW
Ever confirmed: true
See Also: → 1923201

This matches other browsers, and was kinda what was intended with the
content empty check and such, I believe.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Attachment #9444124 - Attachment description: Bug 1936549 - Make cells without baseline not participate on baseline alignment. r=dshin,#layout → Bug 1936549 - Make empty cells more thoroughly not participate on baseline alignment. r=dshin,#layout
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f298f75ad50e Make empty cells more thoroughly not participate on baseline alignment. r=dshin
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/49743 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch
Upstream PR merged by moz-wptsync-bot
Flags: qe-verify+

Reproduced this issue on an affected Nightly build following the STR from Comment 0 on Ubuntu 22.04.
Verified as fixed on the latest Nightly 136.0a1 (20250109183505) and latest Beta 135.0b2 (20250108092002) using Windows 11, Ubuntu 22.04 and macOS 11.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: