Re: [css-lists][html] <summary> and ::marker

On Mon, Apr 25, 2016 at 12:04 AM, Ting-Yu Lin <tlin@mozilla.com> wrote:
> Do we want to redefine other counter styles keyword like 'disc' other than
> disclosure-open/closed to be a 'content' keyword?

I don't see any particular reason to.  I only added the
disclosure-open/closed keywords to list-style-type because I
anticipated <summary> using display:list-item when I wrote the Counter
Styles spec.

> If we remove
> disclosure-open/closed from being a keyword of 'list-style-type', won't this
> cause a backward compatibility issue?

With who?

> I'm a implementer for Firefox, so this is from the implementation point of
> view.
>
> Tab's proposal is cleaner, but I'm worrying about the implementation
> complexity
> for defining ::marker to be another universal pseudo like ::before for
> solving
> the issue for summary implementation.

I'm curious what the impl complexity is - you already have code to
handle creating ::marker for display:list-item, and you have code to
handle ::before/after pseudo-elements on all elements.  Are the two
too hacky to simplify reasonably?

> We do want the summary marker to be
> stylable. However, from the current details and summary usage I saw, authors
> are
> either satisfied with the built-in rendering of the triangle, or they're
> hiding
> the built-in one, and replace it by stuff in summary::before. Needless to
> say that if they want the marker position to be at the end of summary
> they'll still need to hide the triangle, and provide ones in summary::after
> like this page.

Why so? That page
(<https://developer.microsoft.com/en-us/microsoft-edge/platform/faq/>)
can just use "summary { display: flex; } summary::marker { order: 1;
}".

> And using summary::before is also the practical way for a
> decent
> web page to work across browsers with or without details and summary
> implementation.
>
> Even though summary being a list-item is hacky, it did provide a clean way
> to hide
> the triangle by summary { list-item-type: none }.

Same under my proposal, you just do "summary::marker { content: none;
}" (or display:none, whichever feels most natural).

> I can live with hacks in browser implementation as long as we provide a
> cleaner way for the authors to style the triangle, and a not-too-difficult
> way for
> vendors to start implement or adopt the standardized details and summary
> feature.
>
>> fantasai offers an alternate proposal: leave <summary> as is, leave
>> the hack for the first problem, but make the list-style-* properties
>> actually only apply to the ::marker pseudo, rather than to list items.
>> Inheritance ensures that we maintain today's behavior, but HTML can
>> then set list-style-position:inside directly on the summary::marker,
>> and avoid the second problem entirely.
>
> I feel changing list-style-* properties to *only* apply to the ::marker
> could be
> another source for compatibility issues. Other implementers who are familiar
> with counter styles might want to comment this.

I don't see how it can cause any compatibility issue at all, in any
scenario.  The list-style-* properties today only apply to list items,
they inherit, and ::marker is always a child of a list item, so all
code that today uses them to style a list item would, under this
proposal, style the marker instead, and no page can accidentally pick
up marker styling if it wasn't already styling the list item.

~T

Received on Monday, 25 April 2016 14:51:26 UTC