Bug 245502 - Consider implementing a UA-level-only pseudo-class matching <select> as a listbox
Summary: Consider implementing a UA-level-only pseudo-class matching <select> as a lis...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar, WPTImpact
Depends on:
Blocks:
 
Reported: 2022-09-21 12:53 PDT by Simon Pieters (:zcorpan)
Modified: 2023-07-04 04:15 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Pieters (:zcorpan) 2022-09-21 12:53:03 PDT
In https://bugs.webkit.org/show_bug.cgi?id=220376 WebKit's UA stylesheet was tweaked to avoid mismatches between which <select> elements the UA stylesheet styles as a listbox and what the rendering engine decides is a listbox based on the rules specified in the HTML standard. But there's still a mismatch, for example if there's trailing whitespace or an infinite number of other attribute values that are parsed one way or the other for the size="" attribute.

Chromium and Gecko instead support a UA-level-only pseudo-class that matches <select> elements that are listboxes, which solves the mismatch problem.

In https://github.com/w3c/csswg-drafts/issues/7422 it's proposed that such a pseudo-class should be standardized and also exposed to author-level CSS, but the CSS WG is hesitant to standardize it because there are already many pseudo-classes and it's not clear if it solves a common problem for web developers.

Nevertheless, I think a UA-level-only pseudo-class makes sense, and would improve WebKit's <select> rendering interop with Chromium and Gecko.
Comment 1 Aditya Keerthi 2022-09-21 12:57:47 PDT
This seems reasonable. I think we could also add WPT for any interop issues?
Comment 2 Simon Pieters (:zcorpan) 2022-09-21 13:13:03 PDT
Sure. I've opened a wpt PR for the spec's current default styles for <select> (which are incomplete) at https://github.com/web-platform-tests/wpt/pull/35801

I can add a test for this also, e.g. a reftest similar to:  http://software.hixie.ch/utilities/js/live-dom-viewer/saved/10763
Comment 3 Radar WebKit Bug Importer 2022-09-28 12:53:20 PDT
<rdar://problem/100521615>
Comment 4 Simon Pieters (:zcorpan) 2022-10-04 05:56:09 PDT
(In reply to Simon Pieters (:zcorpan) from comment #2)
> I can add a test for this also, e.g. a reftest similar to: 
> http://software.hixie.ch/utilities/js/live-dom-viewer/saved/10763

PR here: https://github.com/web-platform-tests/wpt/pull/36256