Closed Bug 1667501 Opened 4 years ago Closed 3 years ago

Ensure elements not supporting aspect-ratio property are ignoring aspect-ratio

Categories

(Core :: Layout, defect)

defect

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: TYLin, Assigned: boris)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached file table-with-aspect-ratio.html (obsolete) —

Per spec, aspect-ratio applies to all elements except inline boxes and internal ruby or table boxes. https://drafts.csswg.org/css-sizing-4/#aspect-ratio

Currently, we do apply aspect-ratio on <table> elements. See the attached test case.

I think the root cause probably is we unconditionally consider aspect-ratio in nsIFrame::ComputeSize(). After bug 1660122, we can call nsIFrame::GetApsectRatio() and get a ratio if the frame supports aspect-ratio.

Blocks: aspect-ratio

Per discussion with emilio on Matrix, it's correct to apply aspect-ratio property on <table>.

We currently unconditionally consider aspect-ratio property in nsIFrame::ComputeSize(). If the size of the elements not supporting aspect-ratio (inline boxes and internal ruby or table boxes) are not computed via the nsIFrame::ComputeSize(), then we're fine to leave it as is (though using GetAspectRatio() added in bug 1660122 may be a little bit ergonomic).

We also need testcases to ensure that those elements not supporting aspect-ratio are covered. Currently, I don't see any in testing/web-platform/tests/css/css-sizing/aspect-ratio.

Summary: Ignore aspect-ratio property for tables → Ensure elements not supporting aspect-ratio property are ignoring aspect-ratio

Comment on attachment 9177999 [details]
table-with-aspect-ratio.html

Obsolete the wrong testcase.

Attachment #9177999 - Attachment is obsolete: true
Depends on: 1685207

aspect-ratio applies to all elements except inline boxes and internal ruby or
table boxes. So we should return false for inline frames, table internal frames
(i.e. except nsTableFrame and nsTableWrapperFrame), and ruby internal frames.

Note: it seems nsRubyBaseContainerFrame and nsRubyTextContainerFrame are
inline, so we return false for them.

Assignee: nobody → boris.chiou
Status: NEW → ASSIGNED
Blocks: 1690422
Pushed by bchiou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bf6cf886b968
Add an nsIFrame::IsFrameOfType bit to say whether frames support aspect-ratio. r=TYLin
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: