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

On Tue, Apr 26, 2016 at 4:16 AM, fantasai <fantasai.lists@inkedblade.net>
wrote:

> On 04/21/2016 09:24 PM, Tab Atkins Jr. wrote:
>
>> Recently HTML, under advisement from fantasai and I, specified that
>> the "disclosure triangle" on a <summary> element (part of the
>> <details> element) is displayed using a list marker, by setting
>> <summary> to display:list-item.
>>
>> Unfortunately, this decision came with some additional baggage that
>> we're now having to work around in HTML.  In particular:
>>
>> * display:list-item also automatically increments the list-item
>> counter, which is used by HTML's <ol> element.  This meant that using
>> a <details> inside of an <ol> would cause the next <li> to jump ahead
>> by 2.
>>
>
> There's a simple fix for this, too: make 'display' not set any
> magic counters. The HTML UA style sheet can set the 'list-item'
> counter in a counter-increment rule. This also makes 'list-item'
> less magic. It only affects the creation of ::marker.
>
> Chrome automatically increments items with 'display: list-item';
> however Firefox does not.
>

Firefox does increment the magic counter with 'display: list-item'. When
changing
summary to 'display: list-item', I need to stop the magic counter from
being increasing
for summary here
<https://dxr.mozilla.org/mozilla-central/rev/fc15477ce628599519cb0055f52cc195d640dc94/layout/generic/nsBlockFrame.cpp#7104-7111>
.

Full alternate proposal:
>
>   * 'display: list-item' does not magically set a 'list-item'
>     counter-increment; this is handled by the HTML UA style sheet
>
>   * 'list-style-*' apply to ::marker, not to list item elements;
>     since they inherit setting them on the list item will continue
>     to work as expected
>
> This proposal has two advantages:
>   * avoids the creation of a universal ::marker element
>   * maintains application of 'list-style' properties to styling
>     markers, for which these properties are very useful and usable.
>

I feel this proposal is easier to implement. For Firefox, we'll need to
convert the built-in magic counter to use css counter and use the
counter for <ol> in UA style sheet.


>
> If 'list-style' no longer applies to ::marker on <summary>, then
> we lose the simple interface that it offers for setting the marker
> style via 'list-style-type' and 'list-style-image', and furthermore
> we lose control over the position of the marker that is offered by
> 'list-style-position'.
>

I agree. We should keep summary marker to be styled via 'list-style-type',
etc.


>
> The **only** complaint about this is the name "list-style" being
> applied here. Imho think this is an acceptable suboptimal legacy
> situation. I strongly believe the benefits of its interface are
> greater than any superficial concern over its name.
>

Agree, too.

Received on Wednesday, 27 April 2016 06:46:35 UTC