W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2019

Re: [csswg-drafts] [css-lists] Can replaced elements be list items? (#4633)

From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
Date: Tue, 31 Dec 2019 00:34:47 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-569836678-1577752486-sysbot+gh@w3.org>
Oh, I missed https://drafts.csswg.org/css-lists/#counters-without-boxes

> An element that does not generate a box (for example, an element with `display` set to `none`, or a pseudo-element with `content` set to `none`) cannot set, reset, or increment a counter.

So I guess an element with `display: list-item` inside a `display: none` may be considered to be a list item but is not able to increment the `list-item` counter.

The section also says

> Whether a replaced element’s descendants (such as HTML option, or SVG rect) can set, reset, or increment a counter is undefined.

but replaced elements themselves are not included, so presumably they must be able to affect counters.

Then Firefox is following the spec. And thinking more about this, I guess that behavior is more reasonable given how the `list-item` counter is supposed to behave (it's so buggy in Chromium, since it's not a real counter). So OK.

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4633#issuecomment-569836678 using your GitHub account
Received on Tuesday, 31 December 2019 00:34:49 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:57 UTC