Closed Bug 1995428 Opened 1 year ago Closed 2 days ago

vertical writing-modes misalign text in table cells with rowspan > 1

Categories

(Core :: Layout: Tables, defect)

defect

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: mpk, Assigned: jfkthame)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Keywords: parity-chrome, testcase)

Attachments

(1 file, 1 external file)

When a table header or data cell (<th> or <td>) spans multiple rows (rowspan > 1) and a vertical writing mode is applied, the text inside the cell is incorrectly aligned (see attached testcase). Chromium-based browsers (Chrome, Edge, etc.) seem to render this correctly.

Steps to reproduce:

  • Save and open the attached testcase in Firefox.
  • Observe the red text inside the tables.

Actual result:
For all vertical writing-modes, the text is not centered vertically when the cell spans multiple rows (rowspan > 1).

Expected result:
The text should be vertically centered within the multi-row cell, as it is in Chromium or when rowspan is either not used at all or set to 1.

This was reproduced with Firefox 144, 145 and 146 on FreeBSD and Android, but likely affects all platforms.

Thanks for the bug report! This is likely "just" a version of bug 1310551; it looks like we're laying out the vertical-writing-mode text here without knowing what their inline-size (height) will be, so we size their cell as if the text doesn't have to line-wrap. We would likely have to do additional passes of layout to avoid this problem.

(Bug 1310551 mentions cases where we end up with 0 block-size i.e. width, but I believe it's got some associated bugs where we end up with a single-line block-size instead, too, for similar reasons.)

Severity: -- → S3
Depends on: 1310551
Version: Firefox 146 → Trunk

(I cleared the various version-specific flags because this affects ~every Firefox since writing-mode support was first introduced, so it's likely not useful to track version-specific affected/wontfix statuses here.)

Interestingly, unlike many examples of bug 1310551-like issues, the broken rendering is not fixed by triggering an extra reflow, e.g. by zooming the page.

(A workaround would be to wrap the row-span cell contents in a <div> and apply the orthogonal writing mode to that instead of to the cell itself; this appears to give the expected result.)

See Also: → 2060385

The content's inline-size spans the rows, so it must be laid out using the final row sizes
for text-align in orthogonal cells to work correctly.

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED

With the change here (which builds on the patch currently landing in bug 2060385), all the examples in the testcase render as expected.

Depends on: 2060385
Pushed by jkew@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/3cedc6cfc66f https://hg.mozilla.org/integration/autoland/rev/872a287e563a Reflow orthogonal table cell content after the table's height stretches the rows. r=layout-reviewers,emilio

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/65314 for changes under testing/web-platform/tests

Status: ASSIGNED → RESOLVED
Closed: 2 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch

Upstream PR merged by moz-wptsync-bot

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: