Re: [csswg-drafts] [css-pseudo-4] Standardizing input[type="range"] styling (#4410)

One note about these pseudo-elements:  as we're standardizing pseudo-elements like those proposed above (and implementing them), we need to be a little bit careful with their CSS cascading behavior relative to the user agent's styles on the hidden user-agent element that they affect.  I think any user-agent styles inside the component should be treated either as an inner [context](https://drafts.csswg.org/css-cascade-5/#cascade-context) or as from the user-agent [origin](https://drafts.csswg.org/css-cascade-5/#cascade-origin), so that the pseudo-element overrides this.  (I think the two options are distinguishable only in how they interact with other user-agent origin styles and with user styles.)

Historically Blink has treated the user agent's styles in this case as an inner context, with the exception of the `style` attribute.  I ran into this while working on `<details>` element styling (for which I need to produce an updated proposal at some point soom), and I fixed it for unprefixed pseudo-elements (see background [CL 1](https://chromium-review.googlesource.com/c/chromium/src/+/4781449), background[CL 2](https://chromium-review.googlesource.com/c/chromium/src/+/4739681), and mainly [CL 3](https://chromium-review.googlesource.com/c/chromium/src/+/4823787)), but not for the existing prefixed ones, given that I didn't want to figure out the web compatibility implications (which appeared to affect a pretty large number of pseudo-elements, although maybe not the ones in this issue).  In other words, the prior Blink behavior treated style attributes in the control (which are often used programatically rather than from markup) differently from style elements in the control.  (It wouldn't surprise me if WebKit does the same, although I haven't checked.)  I got feedback from the one developer (@bramus) who experimented with my details styling work that the resulting behavior was bad, and thus fixed it as I mentioned (see third CL above), so that style attributes and style elements are treated roughly the same (modulo their existing specified cascading differences).

I realize that we may or may not standardize what the structure and styles of the underlying elements are, but I think it's good if the interaction of any such pseudo-elements with the user agent's control at least behaves according to the CSS model, as though there are underlying elements with styles.

-- 
GitHub Notification of comment by dbaron
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4410#issuecomment-1714124204 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 11 September 2023 15:31:33 UTC