Bug 255114 - Wave animation on https://deploy-preview-14--unas-new-site.netlify.app/ doesn't work in Safari
Summary: Wave animation on https://deploy-preview-14--unas-new-site.netlify.app/ doesn...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL: https://deploy-preview-14--unas-new-s...
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2023-04-06 13:43 PDT by Simon Fraser (smfr)
Modified: 2023-04-11 01:32 PDT (History)
9 users (show)

See Also:


Attachments
Test (608 bytes, text/html)
2023-04-07 10:32 PDT, Antoine Quint
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2023-04-06 13:43:41 PDT
Load https://deploy-preview-14--unas-new-site.netlify.app/ in Firefox and note the nice wave animation on the lower edge of the header. Now load in Safari; the wave animation is not there.
Comment 1 Radar WebKit Bug Importer 2023-04-06 13:44:04 PDT
<rdar://problem/107725408>
Comment 2 Simon Fraser (smfr) 2023-04-06 13:44:57 PDT
The animation is driven by:

.wave:where(.astro-J7PV25F6) {
    display:block;
    width:100%;
    height:clamp(2rem, 5vw, 10rem);
    margin:0;
    z-index:0;
    bottom:0
}

#page-divide:where(.astro-J7PV25F6) {
    animation:moveforward 10s linear infinite
}

@keyframes moveforward {
    0% {
        transform:translate(-90px)
    }

    to {
        transform:translate(85px)
    }
}
Comment 3 Simon Fraser (smfr) 2023-04-06 13:46:20 PDT
Looks like we fail to animation the <path> inside the <defs>
Comment 4 Antoine Quint 2023-04-07 00:21:11 PDT
Presumably a <path> within a <defs> does not have a renderer, and I guess we bail out of the accelerated animation code which does not account for this possibility.
Comment 5 Antoine Quint 2023-04-07 10:25:21 PDT
Actually, we correctly animate the transform. This is probably something SVG-specific about updating the shadow tree rendering.
Comment 6 Antoine Quint 2023-04-07 10:32:24 PDT
Created attachment 465812 [details]
Test
Comment 7 Antoine Quint 2023-04-07 10:35:19 PDT
I think we need to call a method on SVGElement to notify that the style changed due to an animation which would then call invalidateInstances().
Comment 8 Antoine Quint 2023-04-07 10:40:41 PDT
I wonder if we should add a new virtual method to StyledElement to notify when the animated style changed which would allow SVGElement to override. We could then call this method at the end of Style::TreeResolver::createAnimatedElementUpdate(), or somewhere else?