Summary: | keyframes do not work when defined inside a style in a shadowRoot | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Keanu Lee <webkit> | ||||||||
Component: | DOM | Assignee: | Nobody <webkit-unassigned> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | buildbot, cdumez, commit-queue, dino, koivisto, rniwa, simon.fraser, webkit-bug-importer | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | Safari Technology Preview | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=186837 | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 148695 | ||||||||||
Attachments: |
|
Description
Keanu Lee
2016-11-10 12:31:16 PST
It appears that KeyframeAnimation::resolveKeyframeStyles() calls into Element::styleResolver(), but that gets null for containingShadowRoot() so returns the Document's style resolver. I think the keyframes rule is in the shadow root's style resolver. But I'm not sure if containingShadowRoot should be null here. The animation is connected to the x-foo element. I don't really understand the shadow tree - which style resolver should that get? It's a bit tricker than that. If the keyframe is used by a rule inside the shadow tree, then it should see the keyframe rule but the rule outside the shadow tree shouldn't see it. Created attachment 296138 [details]
patch
Comment on attachment 296138 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=296138&action=review > Source/WebCore/ChangeLog:17 > + Test: fast/shadow-dom/shadow-host-animation.html I don't see this test in the patch. Did you forget to add it? Comment on attachment 296138 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=296138&action=review > Source/WebCore/page/animation/KeyframeAnimation.cpp:369 > + auto* styleScope = Style::Scope::forOrdinal(element, m_animation->name().scopeOrdinal); > + if (styleScope) > + styleScope->resolver().keyframeStylesForAnimation(*m_object->element(), m_unanimatedStyle.get(), m_keyframes); Could define the variable inside the if. > Source/WebCore/platform/animation/Animation.cpp:167 > -const String& Animation::initialName() > +Style::ScopedName Animation::initialName() > { > static NeverDestroyed<String> initialValue(ASCIILiteral("none")); > - return initialValue; > + return { initialValue.get(), Style::ScopeOrdinal::Element }; > } Could just have this return const Style::ScopedName& instead and have the global be a NeverDestroyed<Style::ScopedName>; would be slightly more efficient. Comment on attachment 296138 [details] patch Attachment 296138 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/2627250 New failing tests: media/modern-media-controls/media-controller/media-controller-resize.html Created attachment 296153 [details]
Archive of layout-test-results from ews102 for mac-yosemite
The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102 Port: mac-yosemite Platform: Mac OS X 10.10.5
Created attachment 296168 [details]
patch
Slightly simplified version.
Comment on attachment 296168 [details] patch Clearing flags on attachment: 296168 Committed r209352: <http://trac.webkit.org/changeset/209352> All reviewed patches have been landed. Closing bug. |