Bug 255335
| Summary: | hidden attribute doesn't work on select's option and optgroup | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Mattia Astorino <astorino.design> |
| Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | akeerthi, ap, bfulgham, karlcow, simon.fraser, webkit-bug-importer, zalan |
| Priority: | P2 | Keywords: | BrowserCompat, InRadar |
| Version: | Safari 16 | ||
| Hardware: | Mac (Apple Silicon) | ||
| OS: | macOS 13 | ||
| URL: | https://jsfiddle.net/73y0fmek/ | ||
| See Also: |
https://bugs.webkit.org/show_bug.cgi?id=169039 https://bugs.webkit.org/show_bug.cgi?id=8351 |
||
Mattia Astorino
Hello, just reporting that option elements with the hidden attribute are broken and they're still visible and can be selected.
DEMO:
https://jsfiddle.net/73y0fmek/
The option "1" and the option group should not be visible like the spec say. Works with firefox and Chrome/Edge.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/107939825>
Alexey Proskuryakov
We had earlier reports of this, but they seem to be duped to different bugs that are all similar yet not obviously the same. This may need some cleanup.
Cf. bug 8351, bug 25623, bug 62900, bug 169039, bug 191581
Karl Dubost
In Bug 191581, Chris has done a bit of analysis about the possible why?
I followed the track of https://bugs.webkit.org/show_bug.cgi?id=191581#c2
where he said:
```
Both HTMLOptionElement and HTMLOptGroupElement have the following override:
bool rendererIsNeeded(const RenderStyle&) final { return false; }
Not sure why they do not need a renderer.
```
If we go down following the history, it has been added at a very early stage.
Thu, 6 Jul 2006 05:47:30 +0000
https://searchfox.org/wubkat/diff/1018550ecbdbd0f48c091502b7e2a0f26f8c9481/WebCore/html/HTMLOptGroupElement.h#46
Maybe… the solution is that nobody tried to remove this.
Karl Dubost
I'm trying to remove them in a local branch to see what it does.
Karl Dubost
So removing the RendererIsNeeded doesn't change anything to the behavior. It doesn't break things, but it doesn't improve things.