Re: [css-grid] Implicit Named Areas

On Wed, Oct 7, 2015 at 12:02 PM, Mats Palmgren <mats@mozilla.com> wrote:
> On 10/06/2015 10:17 PM, Tab Atkins Jr. wrote:
>>
>> On Mon, Oct 5, 2015 at 10:26 AM, Mats Palmgren <mats@mozilla.com> wrote:
>>>
>>> I find the chapter on Implicit Named Areas:
>>> https://drafts.csswg.org/css-grid/#implicit-named-areas
>>> lacking in details on when and how such an implicit area is created.
>>
>>
>> The spec doesn't actually "create" any such areas; they exist as a
>> spec concept for convenience only.  The placement properties never
>> care about areas, they just check for lines with particular names.
>
>
> Well, I was actually using the spec's own language:
> "... effectively creates a named grid area."
>
>> If you said "grid-column-start: A", then it will first look for lines
>> named A-start to match against, and failing that, will look for lines
>> named A.  Same for grid-column-end and A-end.  That's it.  Whether or
>> not lines named A-start or A-end exist, or their relative
>> distribution, makes no difference whatsoever.  There is no "A area",
>> implicit or otherwise, that is looked for.
>
>
> OK, thanks, that makes it clear.  But then why don't you just say so in
> the spec if this is the behavior you want?  Why introduce these "Implicit
> Named Areas" in the first place if they don't serve a useful purpose to
> describe the name resolution?

Because the mental model of Grid has "areas", and that's a useful
concept for people; they don't usually have to know that declaring a
"foo" area in grid-template-areas and aligning to it with "grid-area:
foo" is accomplished via auto-generation of foo-start/end lines and
automagical matching against them.  But when people *are* explicitly
using lines, knowing that properly-named lines will still create
something you can refer to via "grid-area: foo" is nice.  I don't want
to force people to have to understand this via definition-chasing.

(On the other hand, implementors should be definition-chasing.)

> Frankly, I think you should just remove chapter 5.2.2 because it is highly
> misleading.  Instead, I'd prefer an algorithm in pseudo-code that steps
> through how a <custom-ident> is matched against the names in 'grid-
> template-areas' and 'grid-template-columns/rows' near its definition here:
> https://drafts.csswg.org/css-grid/#grid-placement-slot

I'm confused.  That section you link *is* the algorithm that you're
asking for.  What do you think is missing?

>> If either browser is doing something different, they're violating the
>> spec.
>
> Both browsers have bugs in this area.  I can say for the Gecko bugs
> that the spec (5.2.2) is what mislead me to implement it wrongly.
> Not a big deal, I can correct that in a few hours of work.  I'm just
> trying to give you the feedback that the spec describes poorly the
> behavior you intended.

Sure, I'm just not sure what the spec did wrong, or what you followed
to produce whatever behavior you ended up with.  I'd be happy to
clarify anything that we actually find is wrong or confusing. ^_^

~TJ

Received on Wednesday, 7 October 2015 20:36:43 UTC