Closed Bug 1883813 Opened 3 months ago Closed 3 months ago

[quirks] box-sizing: border-box not honored for table elements

Categories

(Core :: Layout: Tables, defect, P3)

Firefox 115
defect

Tracking

()

RESOLVED FIXED
126 Branch
Tracking Status
firefox126 --- fixed

People

(Reporter: jmturner8, Assigned: emilio)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

Steps to reproduce:

I am sizing table elements within rows (TD and TH elements) using box-sizing: border-box. This works correctly for my Table when on a page, but does not work correctly when the same Table is within an iframe. It seems that border-box is ignored within the iframe, and content-box sizes are applied instead.

Actual results:

See above. I have created this simple code pen to show the issue. https://codepen.io/turjmner8/pen/eYoppbp
The first Table in the iframe has the same styling and width settings as the second Table that is outside of the iframe, yet the resulting cell widths are all as if content-box sizing was utilized rather than border-box sizing.

Expected results:

My expectation is that both Tables would be sized the way the second Table that is not rendered within the iframe is sized. When I run the same sample in Chrome, Safari, or Edge, both Tables are sized as expected.

This additional code pen example allows for the TD elements to be sized correctly within the iframe, but the TH elements still seem to use content-box sizing for some reason...

https://codepen.io/turjmner8/pen/GRLpRZM

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

I think this is basically just a quirk. It works if you add <!doctype html> to the iframe.

My guess would be this code, which comes from bug 778413...

Might be interesting to check what the behavior of other engines is. Maybe they removed that quirk?

Severity: -- → S3
Priority: -- → P3
See Also: → 778413
Summary: box-sizing: border-box not honored for table elements within iframe → [quirks] box-sizing: border-box not honored for table elements

That is, don't force the width to be content-box. That matches other
implementations and the spec.

Assignee: nobody → emilio
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/aa7b5e5f38cb
Implement table cell height quirk as per spec. r=dshin
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/45230 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 126 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: