Closed Bug 1671268 Opened 5 years ago Closed 5 years ago

Editorial nits for in-tree masonry spec

Categories

(Core :: Layout, task)

task

Tracking

()

RESOLVED FIXED
83 Branch
Tracking Status
firefox83 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(3 files)

Filing this bug to make some editorial nits to the currently-in-tree CSS Masonry spec (an extension to CSS Grid).

(For now, I'll just edit the bikeshed source; we can update the generated HTML in a one-off patch at the end.)

Actually, bikeshed's easier to set up than I expected (yay pip), so I'll include changes to the generated HTML in each patch after all.

FYI, you don't need to install it. You can generate the HTML like so:
curl https://api.csswg.org/bikeshed/ -F file=@layout/docs/css-grid-3/Overview.bs -F force=1 > layout/docs/css-grid-3/Overview.html

(And if you forget it it's documented in the first commit message so you just have to hg log -l 1 -v layout/docs/css-grid-3/Overview.bs to get it.)

Something that needs a bit of prose written to clarify:

6.2.
[...] Any item can opt out from stretching by setting align-self / justify-self to something other than normal or stretch in the relevant axis.

We should say what the varying behavior is for these other align-self/justify-self values, in this scenario with align-tracks:stretch. e.g. if an item "opts out" by doing align-self:center, does that mean we still allocate it space and then center it within that space (rather than stretching it)? Or do we just not allocate it any stretch space at all?

Items with a definite size don’t stretch and items with an auto margin in the masonry axis stretch by increasing their margin(s) instead of their content-box size.

What about an item that has a definite size and an auto margin in the masonry axis? (The two statements here conflict on whether or not those items would stretch in some way.)

Flags: needinfo?(mats)

And a bit earlier, at the end of the section 6: intro
https://hg.mozilla.org/mozilla-central/raw-file/tip/layout/docs/css-grid-3/Overview.html#alignment

By default, the masonry box is the same as the grid container's content-box due to being stretched.

This is true in simple cases, but it's not true if there's overflow -- i.e. if the grid container has a fixed size in the masonry axis and there's more content stacked in that axis than fits. In that scenario, the masonry box extends to the end of the furthest item, whereas the grid container's content box is only as large as the specified size.

Perhaps this sentence needs further caveats, or should just be removed?

Other values (other than stretch and baseline values) are all treated as start and thus have no effect.

Definite size and an auto margin will grow their margin. The intended meaning of "Items with a definite size don’t stretch" is "Items with a definite size don’t stretch their size".

True, so yeah, removing it sounds fine.

Flags: needinfo?(mats)

In regards to stretching with multiple auto-values: I think CSS2 says which values are ignored in that situation. We follow that.

Attachment #9181710 - Attachment description: Bug 1671268 part 3: Editorial nits to chapters 4-8 of the in-tree CSS Masonry spec. r?mats → Bug 1671268 part 3: Editorial nits to chapters 4-9 of the in-tree CSS Masonry spec. r?mats

One more spot that might need a tweak to the prose:

Absolute Positioning
The containing block is the extent of the tracks the item spans in the grid axis and the position of line 1 and the padding-box edge in the masonry axis.

I'm not sure what the definition for the masonry axis is saying here ("the position of line 1 and the padding-box edge")

Which padding-box edge? The end-edge, I'm guessing? (i.e. are you saying the containing block extends from line 1 to the end of the grid container's padding box?)

If so: it should say "end-edge"; and I think it also might need s/the position of/the area between/, perhaps?

I updated part 3 to address comment 6 and 7; hopefully I interpreted your thoughts correctly on those.

(I addressed comment 7 by focusing on the example rather than making a blanket declaration, and by adding a caveat about what would happen if the masonry box were larger. And I rephrased the text about auto margins and stretching to hopefully make things clearer.)

Which padding-box edge? The end-edge, I'm guessing?

Yes.

If so: it should say "end-edge"; and I think it also might need s/the position of/the area between/, perhaps?

Well, at this point we're talking about a single axis so "the distance between" might be better. Or, "the area between" could be used at the start of the sentence in a way so that covers both axes ... somehow?

EDIT: I think it's clear that we're defining an area here though, since the sentence starts with "The containing block", so I think just defining the edges in each axis is probably enough without explicitly mentioning "the distance between" those edges.

Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/26de37d3d1fc part 1: Editorial nits to introductory text in the in-tree CSS Masonry spec. r=mats https://hg.mozilla.org/integration/autoland/rev/158d4f42f599 part 2: Editorial nits to chapter 2 of the in-tree CSS Masonry spec. r=mats https://hg.mozilla.org/integration/autoland/rev/95aca7dd3567 part 3: Editorial nits to chapters 4-9 of the in-tree CSS Masonry spec. r=mats

(BTW, the patches that landed didn't end up including a tweak to address comment 12/14 at this point. I'd rubberstamp a patch to address that if you want to post something, though. Otherwise, trying my best to stay away from my source tree & bugmail for a little while. :) )

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: