Re: [csswg-drafts] [css-page] Should we allow resetting the `pages` counter? (#12824)

> For many use cases of counting layout containers, authors could indeed use sibling-count() instead, because it is usually sibling elements that generate containers of the same type and level, but not for all, e.g. columns if there are automatic breaks inside.

You really can't. The counter is based on fragments, not on DOM elements. `pages` (and `target-counter()` referring to elements not yet declared, which is effectively the same thing) are one of the hard problems - probably _the_ hard problem - for print-based layout engines, as this involves a lookahead of N pages where N is unbounded. If there is an ideal solution to this problem I am not aware of it.

> I really wish CanIUse.com would cover PDF generators. 

You are not alone in this :smile: And I think you got most of them in your list.

-- 
GitHub Notification of comment by faceless2
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12824#issuecomment-3313805316 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 19 September 2025 21:07:06 UTC