Closed Bug 1827483 Opened 2 years ago Closed 2 years ago

Support tables with more than one caption

Categories

(Core :: Layout: Tables, defect)

defect

Tracking

()

RESOLVED DUPLICATE of bug 144517

People

(Reporter: dshin, Unassigned)

References

Details

Attachments

(1 file)

Attached file table.html

STR: Load attached test case
Expected: Two lime green boxes, one above and one below the table.
Actual: Only one shown - the top caption.

Taken from baseline-source WPT test.

Severity: -- → S3
Depends on: 1809568

It looks like we support (at-most) one caption frame.

Some code references:
https://searchfox.org/mozilla-central/rev/ad732108b073742d7324f998c085f459674a6846/layout/tables/nsTableWrapperFrame.h#21

* the nsTableWrapperFrame contains 0 or one caption frame, and a nsTableFrame

https://searchfox.org/mozilla-central/rev/ad732108b073742d7324f998c085f459674a6846/layout/tables/nsTableWrapperFrame.cpp#129

// We only have two child frames: the inner table and a caption frame.

https://searchfox.org/mozilla-central/rev/ad732108b073742d7324f998c085f459674a6846/layout/tables/nsTableWrapperFrame.h#21

Note: nsTableWrapperFrame does have a member-var mCaptionFrames which sounds plural, but we seem to treat it as only ever having one entry.

Spec-wise, though: I checked the css-tables-3 spec, and it does seem to indicate that tables are expected to support multiple captions. e.g. https://drafts.csswg.org/css-tables-3/#table-layout-algorithm says:

Compute the height of the table.
This is done by returning the sum of all table-caption heights (their width being set to the table width

The wording here makes it clear that a single table can have multiple captions.

CSS 2.1 also seems to indicate multiple captions were expected to work, too -- "...the table box itself and any caption boxes..." at https://www.w3.org/TR/CSS21/tables.html#model

So I guess this is a piece of table layout that we never implemented.

Summary: Bottom Table Caption Disappears → Support tables with more than one caption

I guess this is tracked in bug 144517 . (The first few comments are a bit of a diversion around possibly-broken markup, but later comments/dupes settle it on being about this issue.)

Status: NEW → RESOLVED
Closed: 2 years ago
Duplicate of bug: 144517
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: