Decide how @keyframes and similar rules should be looked up in Shadow DOM
Categories
(Core :: CSS Parsing and Computation, enhancement, P3)
Tracking
()
People
(Reporter: emilio, Unassigned)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
Attachments
(1 file)
59 bytes,
text/x-review-board-request
|
Details |
Comment hidden (mozreview-request) |
Comment 2•7 years ago
|
||
Reporter | ||
Comment 3•7 years ago
|
||
Reporter | ||
Comment 4•7 years ago
|
||
Updated•7 years ago
|
Comment 5•3 years ago
|
||
I am not sure whether this is relevant or maybe needs a separate bug, but...
I tried different scenarios of animation and font-family in conjunction with @keyframes and @font-face. Here are the results. I am using the term "outside" to denote the outer document scope and "inside" for shadow DOM scope.
For font family, it works only when @font-face rule is defined outside, regardless of font-family CSS property being defined inside or outside.
As for animation, there are two cases based on the element to which the styles are applied:
- Styles applied to :host
Animation works in all cases. - Styles applied to ::part
Animation works only when @keyframes are defined inside, regardless of animation CSS property being defined inside or outside. When @keyframes is defined in the outer scope, the animation never works.
Demo: https://jsfiddle.net/tikosar/1eLpavfs/
My particular use case right now is that I am trying to animate a CSS part in a web component from outside, and weirdly it doesn't work, even though I am defining both the animation property and @keyframes in the same outer scope.
This behavior, though not understandable for me, is consistent between Firefox and Chrome.
Comment 7•3 years ago
|
||
Hm - did the discussion on this stall out?
Updated•3 years ago
|
This works in Webkit
I opened an issue for Chromium: https://bugs.chromium.org/p/chromium/issues/detail?id=1398023
Description
•