- From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
- Date: Thu, 06 Oct 2022 23:26:46 +0000
- To: public-css-archive@w3.org
Loirooriol has just created a new issue for https://github.com/w3c/csswg-drafts:
== [css-pseudo][css-lists] Does ::file-selector-button accept counter properties? ==
[Testcase](https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cstyle%3E%0A%3Aroot%20%7B%20counter-reset%3A%20c%200%3B%20%7D%0A%3Aroot%3A%3Abefore%20%7B%20content%3A%20%22%5B%3Aroot%3A%3Abefore%3D%22%20counter(c)%20%22%5D%22%3B%20%7D%0A%3Aroot%3A%3Aafter%20%7B%20content%3A%20%22%5B%3Aroot%3A%3Aafter%3D%22%20counter(c)%20%22%5D%22%3B%20%7D%0Ainput%3A%3Abefore%20%7B%20content%3A%20%22%5Binput%3A%3Abefore%3D%22%20counter(c)%20%22%5D%22%3B%20%7D%0Ainput%3A%3Aafter%20%7B%20content%3A%20%22%5Binput%3A%3Aafter%3D%22%20counter(c)%20%22%5D%22%3B%20%7D%0Ainput%3A%3Afile-selector-button%20%7B%20counter-increment%3A%20c%201%3B%20%7D%0A%3C%2Fstyle%3E%0A%3Cinput%20type%3D%22file%22%3E%0A)
```html
<style>
:root { counter-reset: c 0; }
:root::before { content: "[:root::before=" counter(c) "]"; }
:root::after { content: "[:root::after=" counter(c) "]"; }
input::before { content: "[input::before=" counter(c) "]"; }
input::after { content: "[input::after=" counter(c) "]"; }
input::file-selector-button { counter-increment: c 1; }
</style>
<input type="file">
```
**Gecko:**
- Counter is 0 on `:root::before`
- `input::before` and `input::after` do not generate boxes
- Counter is 1 on `:root::after`
**Blink and WebKit**:
- Counter is 0 on `:root::before`, `input::before`, `input::after` and `:root::after`
So, should `::file-selector-button` obey `counter-increment` as Gecko does?
If so, this would presumably happen between `input::before` and `input::after`?
https://drafts.csswg.org/css-lists-3/#auto-numbering defines counter properties as applying to
> all elements (includes ::before and ::after pseudo-elements)
This doesn't mention `::file-selector-button`, but https://drafts.csswg.org/css-pseudo-4/#file-selector-button-pseudo says
> There is no restriction on which properties apply to the [::file-selector-button](https://drafts.csswg.org/css-pseudo-4/#selectordef-file-selector-button) pseudo-element.
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7846 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 6 October 2022 23:26:48 UTC