Bug 173027 - Pseudo-elements (::after) in shadow roots don't animate
Summary: Pseudo-elements (::after) in shadow roots don't animate
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 148695
  Show dependency treegraph
 
Reported: 2017-06-06 12:14 PDT by Keanu Lee
Modified: 2020-06-08 07:24 PDT (History)
9 users (show)

See Also:


Attachments
Test (509 bytes, text/html)
2020-05-27 06:33 PDT, Antoine Quint
no flags Details
patch (3.98 KB, patch)
2020-06-08 05:57 PDT, Antti Koivisto
graouts: review+
Details | Formatted Diff | Diff
patch (3.98 KB, patch)
2020-06-08 06:41 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keanu Lee 2017-06-06 12:14:45 PDT
E.g. Inside a shadow root:

<style>
    div::after {
      display: inline-block;
      content: 'boo';
      animation: spin 1s infinite;
    }
</style>

Repo: http://output.jsbin.com/kuwado

Expected: The text should have a rotate animation.

Actual: It does not.
Comment 1 Laurent Pellegrino 2018-01-24 12:27:01 PST
The issue is still present in Safari 11.0.2. Any updates?
Comment 2 Radar WebKit Bug Importer 2018-08-01 22:41:01 PDT
<rdar://problem/42842994>
Comment 3 Antoine Quint 2018-08-14 08:04:21 PDT
I tried and this test fails with the new animation code path as well as the old one. The test works fine in Chrome Canary and Firefox Nightly.
Comment 4 Antoine Quint 2020-05-27 06:22:30 PDT
We fail to start the animation under AnimationTimeline::updateCSSAnimationsForElement() because shouldConsiderAnimation() returns false in this statement:

    if (auto* styleScope = Style::Scope::forOrdinal(element, animation.nameStyleScopeOrdinal()))
        return styleScope->resolver().isAnimationNameValid(name);

Indeed, m_keyframesRuleMap is empty and so we cannot validate the animation name.
Comment 5 Antoine Quint 2020-05-27 06:24:33 PDT
Style::Resolver::addKeyframeStyle() is called but not on the same style resolver used in shouldConsiderAnimation().
Comment 6 Antoine Quint 2020-05-27 06:33:28 PDT
Created attachment 400329 [details]
Test
Comment 7 Antti Koivisto 2020-06-08 05:57:06 PDT
Created attachment 401327 [details]
patch
Comment 8 Antoine Quint 2020-06-08 06:02:14 PDT
Comment on attachment 401327 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=401327&action=review

> Source/WebCore/ChangeLog:15
> +        The keyfram code that computes the style already does this correctly.

Typo: keyfram.
Comment 9 Antti Koivisto 2020-06-08 06:41:53 PDT
Created attachment 401329 [details]
patch
Comment 10 EWS 2020-06-08 07:24:19 PDT
Committed r262711: <https://trac.webkit.org/changeset/262711>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 401329 [details].