Skip to content

[css-lists-3] list-item counter nesting is confusing #9076

Open
@fantasai

Description

@fantasai

See @ZoeBijl’s thread at https://w3c.social/@moiety@front-end.social/110729923581670564

The testcase uses the following code:

<ol>
    <li>Some</li>
    <li>List</li>
    <li>Items
        <ol>
        <li>Nested</li>
        </ol>
    </li>
</ol>

<section>
    <ol>
        <li>Some</li>
        <li>List</li>
        <li>Items
            <ol>
                <li>Nested</li>
            </ol>
        </li>
    </ol>
</section>

<ol>
    <li>Some</li>
    <li>List
        <ol>
            <li>Nested</li>
        </ol>
    </li>
    <li>Items
    </li>
</ol>

which, if rendered with counters(list-item, "."), results in what looks like nonsense:

1. Some
2. List
3. Items
    3.1. Nested

3.1 Some
3.2 List
3.3 Items
    3.3.1. Nested

1. Some
2. List
    2.1. Nested
3. Items

This is apparently per spec. I'm not sure how to fix it, but we should probably fix it... it might require some new feature that adjusts counter scoping.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Unsorted regular

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions