-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-cascade-4] An "all-namespaces" user agent stylesheet #8573
Comments
I'm gonna label this with Cascade on the basis the underlying problem here is that it defines that:
Except as demonstrated by the links above, specs don't actually define a default style sheet, they define many default style sheets and it's undefined what the "Order of Appearance" of the various stylesheets is. It's also unclear if it's intended that each specification needs to consider the specificity of every other selector defined in every other specification to avoid unintended results. |
For the record, other UA stylesheets defined include:
|
And to be clear: as long as we don't care about specifying position in the cascade, there's no reason why each spec can't define its own stylesheet (e.g., CSS View Transitions defining its own styles that cover all namespaces). |
When can we be sure we don't need to care about position? I suppose with view transitions, since it only deals in view transition pseudos/properties, position doesn't matter. Unless… some other CSS spec in future creates a UA sheet that also deals in view transition pseudos/properties. |
I'm not sure there's actually an issue here? The stylesheets you linked contain namespaced rules: if you apply them to every single document loaded by the UA, you'll get the expected behavior. As for how the UA splits up the stylesheets into individual files internally: that's an implementation detail that we don't need to care about. If they want to put them all into a single file, using individually namespaced selectors instead of file-level default To the extent that CSS spec themselves define UA rules that apply to all namespaces (e.g. for View Transitions), they simply need to use selectors that are not namespaced. If there are order dependencies among the rules, we do need to be careful to spec those explicitly. But I don't think we have any such cases atm? It might be nice to have an index of all of the UA rules, but other than that, I don't think there's anything to do here. @jakearchibald am I missing something? |
I think what @jakearchibald was looking for is having a small set of centrally maintained normative user agent style sheets. We have that for HTML, SVG, and MathML, but there's no such style sheet for The user agent style sheets @gsnedders pointed out seem somewhat confusing to me. Some seem to monkey patch SVG, others are informative, but don't mention the normative style sheet (though some do). Just referencing the normative material would go a long way I think. |
Also
(as did CSS Color 3 and CSS Color 4). |
Right now we have:
But some styles should span all three, for example view transition pseudo-element styles, but perhaps also things like
::selection
.It feels like we need a central "all-namespaces user agent stylesheet". Other specs could define a set of styles, and the central "all-namespaces user agent stylesheet" spec would include them (this would also define the ordering of styles from different specs).
The text was updated successfully, but these errors were encountered: