Bug 181327 - <option> element can't increment CSS counters
Summary: <option> element can't increment CSS counters
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-01-05 07:16 PST by Roman Komarov
Modified: 2023-05-30 02:25 PDT (History)
10 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Komarov 2018-01-05 07:16:07 PST
## Steps to reproduce the problem:

Go to https://codepen.io/kizu/pen/PEJgpr

## What is the expected behavior?

The number after “Selected value:” should be equal to the selected option's inline CSS variable.

## What went wrong?

The counters on <option> element don't work

Other major browsers — Firefox & Edge support this behavior. Support for this in Chrome/Safari would mean we could do a lot of interesting stuff with <select>s.
Comment 1 Roman Komarov 2018-01-05 09:15:27 PST
A note: counters for options at select with `multiple` attribute work in Chrome, but don't work in webkit, so at least is should be possible to get a patch for the multiple selects and/or implement it for common ones?
Comment 2 Radar WebKit Bug Importer 2022-02-08 21:04:18 PST
<rdar://problem/88669337>
Comment 3 Ahmad Saleem 2023-04-02 07:59:48 PDT
(In reply to Roman Komarov from comment #1)
> A note: counters for options at select with `multiple` attribute work in
> Chrome, but don't work in webkit, so at least is should be possible to get a
> patch for the multiple selects and/or implement it for common ones?

Safari 16.4 is still broken with 'select multiple' as per following test case (got from Chrome bug):

https://bugs.webkit.org/show_bug.cgi?id=181327

but it is fixed in WebKit ToT.

So only broken case is the one mentioned in Comment 0 and it is also in both Chrome Canary 114 and Safari 16.4.
Comment 4 Ahmad Saleem 2023-04-02 21:09:14 PDT
(In reply to Ahmad Saleem from comment #3)
> (In reply to Roman Komarov from comment #1)
> > A note: counters for options at select with `multiple` attribute work in
> > Chrome, but don't work in webkit, so at least is should be possible to get a
> > patch for the multiple selects and/or implement it for common ones?
> 
> Safari 16.4 is still broken with 'select multiple' as per following test
> case (got from Chrome bug):
> 
> https://bugs.webkit.org/show_bug.cgi?id=181327
> 
> but it is fixed in WebKit ToT.
> 
> So only broken case is the one mentioned in Comment 0 and it is also in both
> Chrome Canary 114 and Safari 16.4.

NOTE - I just checked Firefox Nightly 113 and it seems - it now behaves same as Chrome Canary 114 and Safari 16.4 and don't show anything for other value for this test case:

https://codepen.io/kizu/pen/PEJgpr

______

GitHub Issue - https://github.com/w3c/csswg-drafts/issues/4004 (Leaving this behavior as undefined).

____

While 'https://codepen.io/kizu/pen/EowqxX' (on <select>) works now on WebKit ToT (not on STP166 and Safari 16.4).

^ This might have been fixed because of 'https://github.com/WebKit/WebKit/commit/febbe13cd11cd845645ec472954d2048e3289cda'.

_______

Do we need to do anything here because spec suggest that it is undefined and all browsers agree on Comment 0 testcase?

@Aditya & @Ryosuke - appreciate if you can share your input?
Comment 5 Tim Nguyen (:ntim) 2023-05-29 16:07:25 PDT
(In reply to Ahmad Saleem from comment #4)
> (In reply to Ahmad Saleem from comment #3)
> > (In reply to Roman Komarov from comment #1)
> > > A note: counters for options at select with `multiple` attribute work in
> > > Chrome, but don't work in webkit, so at least is should be possible to get a
> > > patch for the multiple selects and/or implement it for common ones?
> > 
> > Safari 16.4 is still broken with 'select multiple' as per following test
> > case (got from Chrome bug):
> > 
> > https://bugs.webkit.org/show_bug.cgi?id=181327
> > 
> > but it is fixed in WebKit ToT.
> > 
> > So only broken case is the one mentioned in Comment 0 and it is also in both
> > Chrome Canary 114 and Safari 16.4.
> 
> NOTE - I just checked Firefox Nightly 113 and it seems - it now behaves same
> as Chrome Canary 114 and Safari 16.4 and don't show anything for other value
> for this test case:
> 
> https://codepen.io/kizu/pen/PEJgpr
> 
> ______
> 
> GitHub Issue - https://github.com/w3c/csswg-drafts/issues/4004 (Leaving this
> behavior as undefined).
> 
> ____
> 
> While 'https://codepen.io/kizu/pen/EowqxX' (on <select>) works now on WebKit
> ToT (not on STP166 and Safari 16.4).
> 
> ^ This might have been fixed because of
> 'https://github.com/WebKit/WebKit/commit/
> febbe13cd11cd845645ec472954d2048e3289cda'.
> 
> _______
> 
> Do we need to do anything here because spec suggest that it is undefined and
> all browsers agree on Comment 0 testcase?
> 
> @Aditya & @Ryosuke - appreciate if you can share your input?

I'm still not seeing interoperable behavior here in either of the testcases. This is caused by option not having any renderers, which also causes a variety of other issues in WebKit. I think we should fix this.
Comment 6 Anne van Kesteren 2023-05-30 02:25:17 PDT
Duplicate of bug 8351?