Closed Bug 1944423 Opened 7 months ago Closed 4 months ago

[css-grid] Resolve grid-item’s percentage block size (with aspect-ratio) when computing grid container's intrinsic inline-size

Categories

(Core :: Layout: Grid, defect)

defect

Tracking

()

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [grid-percentages:m1])

Attachments

(2 files)

Currently, we compute only the grid column sizes when determining the grid container's intrinsic inline size [1]. We should also compute row sizes so that grid items with percentage block sizes can use the row sizes as a percentage basis.

[1] https://searchfox.org/mozilla-central/rev/a965e3c683ecc035dee1de72bd33a8d91b1203ed/layout/generic/nsGridContainerFrame.cpp#9806-9807

See Also: → 1481876
Summary: [css-grid] Resolve percentage block-size for grid items (with aspect-ratio) when computing grid container's intrinsic inline-size → [css-grid] Resolve grid-item’s percentage block size (with aspect-ratio) when computing grid container's intrinsic inline-size
Whiteboard: [grid-percentages:m1]
Blocks: 1957244
Blocks: 1300366
Depends on: 1481876
See Also: 1481876
Assignee: nobody → aethanyc
Status: NEW → ASSIGNED

The idea behind this patch is to allow grid items with percent-valued
block-sizes to resolve against definite grid rows and then transfer that
resolved block-size as their inline contribution to the grid container's
intrinsic inline-size.

Here are the modification to those reftests in our reftest framework. In these
sub-tests, the grid containers' widths become the same as their items' width,
and Firefox now has the same behavior as Google Chrome.

  • grid-auto-min-sizing-min-content-min-size-002-ref.html: test 7, 8, and 9.
  • grid-auto-min-sizing-min-content-min-size-004-ref.html: test 4 and 6.
  • grid-auto-min-sizing-transferred-size-002-ref.html: test 8, 12, and 13.
  • grid-auto-min-sizing-transferred-size-004-ref.html: test 4 and 6.
  • grid-min-content-min-sizing-transferred-size-002-ref.html: test 8, 12, and 13.
  • grid-min-content-min-sizing-transferred-size-004-ref.html: test 4 and 6.

Note: grid-auto-min-sizing-transferred-size-002.html is marked as fails, and
this patch just change those sub-tests that have behavior change introduced by
this bug.

Blocks: 1963513
Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/0f4933db48c8 Part 1 - Resolve grid row sizes when computing grid container's intrinsic inline-size. r=dholbert https://hg.mozilla.org/integration/autoland/rev/52bc4c80d65f Part 2 - Update test expectations and references. r=dholbert
Duplicate of this bug: 1714951
No longer blocks: 1841698
Duplicate of this bug: 1841698
No longer blocks: 1841316
Duplicate of this bug: 1841316
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch
Regressions: 1966450
QA Whiteboard: [qa-triage-done-c141/b140]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: