-
Notifications
You must be signed in to change notification settings - Fork 719
[css-animations-2] Scoping keyframe names between UA and developer styles. #7560
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
Comments
Yeah, this seems like a reasonable thing to do. I'd be fine with reserving the single-dash set of names (already used for vendor prefixes), or we could add a function that namespaces an ident, like |
I'm happy with either of those |
@tabatkins do you have a preference for a function/prefix vs implicit scoping based on which stylesheet the declaration is in? With the prefix/function every keyframe declaration in a UA stylesheet should have ua(foo) and no keyframe in author stylesheets should have that. So the implicit approach seems more straightforward. The only downside of implicit is that author stylesheets can not use a keyframe declaration in UA stylesheets but we don't have a use-case for that anyway. |
Carrying around implicit source information that isn't textually reflected in any way isn't great. We ended up doing it for shadow-scoped names, for example, and while I think we ended up on the best overall solution, it's still not great that a no-op that set the current style to itself can actually change the meaning of the style (by changing the tree that you're looking up the reference in). I'd personally strongly prefer a textual mechanism to differentiate the two. That also avoids problems with scripting APIs, as you listed in the OP, which would need to carry the source data out-of-band. |
Let me try to clarify the details for the explicit proposal:
I'm ok with this option too. |
We don't necessarily need to tag the
Yes, in that part I was referring to just using a custom-ident with a single-dash prefix, rather than a function.
It is, yeah, tho I'm not sure what existing usage is. We could potentially ban this naming pattern from the production, or perhaps just a
If we went with a special naming convention in the
Sure. As you say, it's not strictly necessary to ban it from being used in |
The CSS Working Group just discussed
The full IRC log of that discussion |
This patch renames the animation to add the -ua- prefix as resolved in w3c/csswg-drafts#7560 (comment) [email protected] Bug: 1285808 Change-Id: I57348682d21c307a4dc37fef8585c144fa8b75eb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3872686 Commit-Queue: Vladimir LevinReviewed-by: Khushal Sagar Cr-Commit-Position: refs/heads/main@{#1043625}
Uh oh!
There was an error while loading. Please reload this page.
Currently there is no way to scope keyframe names declared in styles in user-agent origin vs author rules. For example, consider the following declaration in a user agent stylesheet, used here
This has 2 problems:
We need a way to scope keyframe names between styles in the user-agent origin vs author styles. A couple of options are:
Come up with a prefix which is reserved for UA rules. It will be an error for author keyframes to use this prefix. This will have compat issues to figure out the right prefix.
Keep a separate list of keyframes declared in user-agent stylesheets vs author stylesheets. The list chosen when selecting the animation-name depends on where the resolved animation-name came from. This means if the animation-name was specified in a UA stylesheet but overridden by an author style (possibly with the same name), the look up is in author keyframe names.
One of the caveats with this is script APIs like AnimationEvent include animation-name and which keyframe it corresponds to would be ambiguous. We could add another field to such APIs (bool isUASource) specifying the namespace for the rule.
@flackr @vmpstr @jakearchibald
The text was updated successfully, but these errors were encountered: