-
Notifications
You must be signed in to change notification settings - Fork 177
Description
What went wrong
Percentage width/height/padding/border/etc are being resolved incorrectly for grid items. Specifically during the "measure" stage (min-content, max-content, and minimum sizes), the percentages are being resolved against inner size of the grid container instead of the size of the grid area that the item is placed in.
We do not always have a concrete size for the grid area at this stage in the layout process, as this can be circular for grid areas that are content sized (in which case the percentage should be resolved to zero/auto), but sometimes we do. Cases in which we do have a concrete size:
- All grid tracks forming the area in a given axis have a fixed pixel size
- All grid tracks forming the area in a given axis have a percentage size that resolves against a definite grid container size.
I am unsure how min/max size constraints ought to be handled. Same for grid areas where some but not all tracks have a resolvable concrete size (does that act as a minimum size?).
Additionally, y-axis percentages are currently being resolved against the height, but they should be resolved against the width as per the standard convention in CSS.
Additional information
The following WPT test (padding top and padding bottom cases) exihibits the bug:
This test has a grid container width of 500px, but a grid column width of 100px (both set to fixed pixel values). The percentages should be resolving against 100px, but they are resolving against 500px.
Screenshots
These are of the WPT test above.
Firefox:
Blitz:
