Skip to content

[css-page-3] page context counter scopes are described incorrectly  #4759

@faceless2

Description

@faceless2

(migrated from first half of #3520 to make a single point per issue, and updated)

css-page-3 has the following language:

If a counter is reset or incremented within the page context, it is in scope for all page-margin boxes and obscures all counters of the same name within the document.

This implies the counter falls out of scope at the end of the page context - which means a counter incremented in the page context cannot be referenced from within the document body, or indeed within another page context. This clearly isn't the intention, otherwise counter-increment: page in the page context couldn't work.

A qualifier was suggested when this was first raised by @fantasai, but it seems to have eroded over time.

I think the intended meaning is if a counter is incremented for the first time - because incrementing any counter without a previous reset will create a new counter.

Should this instead read "if a counter is created within the page context"?

"Created" is the specific term used in css-lists for when a counter is reset or set/incremented without a previous reset. With an implied user-agent rule of

:root { counter-reset: page 0 }

then the "page" counter is not being created in the margins, so can be shared across the whole document.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions