Bug 273364 - pral.com.pk - Double bounce animation compared to other browsers
Summary: pral.com.pk - Double bounce animation compared to other browsers
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2024-04-27 16:53 PDT by Ahmad Saleem
Modified: 2024-04-29 22:41 PDT (History)
4 users (show)

See Also:


Attachments
Video Recording (Issue) (47.44 MB, video/quicktime)
2024-04-27 16:55 PDT, Ahmad Saleem
no flags Details
Reduction (310 bytes, text/html)
2024-04-29 03:39 PDT, Antoine Quint
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ahmad Saleem 2024-04-27 16:53:21 PDT
Hi Team,

While going through random websites, I noticed that Safari / WebKit (STP193 test) had double bounce animations compared to other browsers.

Steps to Reproduce:

1) Go to following - https://pral.com.pk
2) From 'About Us', select 'ISO Certification'
3) Hover on following 'ISO Certification'

Expected Results:

No double bounce in Chrome Canary 126 and Firefox Nightly 127

Actual Results:

Double bounce

__________

Just wanted to raise to get this fixed.

Thanks!
Comment 1 Ahmad Saleem 2024-04-27 16:55:46 PDT
Created attachment 471185 [details]
Video Recording (Issue)

Reference Video
Comment 2 Radar WebKit Bug Importer 2024-04-28 01:02:37 PDT
<rdar://problem/127188948>
Comment 3 Antoine Quint 2024-04-29 02:50:20 PDT
This only reproduces once per certification badge.
Comment 4 Antoine Quint 2024-04-29 03:02:29 PDT
Not a recent issue, this reproduces in Safari 16.6.
Comment 5 Antoine Quint 2024-04-29 03:08:54 PDT
While there is both a CSS Animation and a CSS Transition specified on those certification images, commenting out the CSS Animation reproduces the issue still, so this seems to be solely an issue triggered by the CSS Transition for the `transform` property.
Comment 6 Antoine Quint 2024-04-29 03:39:47 PDT
Created attachment 471189 [details]
Reduction

I can reduce it with a single <img> element with a transform transition. That's pretty wild.
Comment 7 Antoine Quint 2024-04-29 08:15:58 PDT
This reproduces with a non-accelerated property and logging CSS Transition events clearly shows the transition running twice. So there's something wrong, specific to images, at the CSS Transitions processing level most likely.
Comment 8 Antoine Quint 2024-04-29 08:23:39 PDT
Doesn't reproduce if the transition is triggered via a style change through script. Could be somehow specific to a :hover-initiated transition.
Comment 9 Antoine Quint 2024-04-29 08:27:49 PDT
Making the transition run longer reveals that, about 1 second after the first transition starts, the first transition gets canceled and a new transition starts.
Comment 10 Antoine Quint 2024-04-29 08:54:27 PDT
This is the stack when the `transitioncancel` event gets triggered:

#0	0x000000014ed4dc70 in WebCore::StyleOriginatedAnimation::cancelFromStyle(WebCore::WebAnimation::Silently) at ~/Source/WebCore/animation/StyleOriginatedAnimation.cpp:223
#1	0x0000000151aac230 in WebCore::Styleable::cancelStyleOriginatedAnimations(WTF::Vector<WTF::WeakPtr<WebCore::StyleOriginatedAnimation, WebCore::WeakPtrImplWithEventTargetData, WTF::RawPtrTraits<WebCore::WeakPtrImplWithEventTargetData>>, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc> const&) const at ~/Source/WebCore/style/Styleable.cpp:311
#2	0x00000001519d138c in WebCore::RenderTreeUpdater::tearDownRenderers(WebCore::Element&, WebCore::RenderTreeUpdater::TeardownType, WebCore::RenderTreeBuilder&)::$_1::operator()(unsigned int) const at ~/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp:726
#3	0x00000001519cfd84 in WebCore::RenderTreeUpdater::tearDownRenderers(WebCore::Element&, WebCore::RenderTreeUpdater::TeardownType, WebCore::RenderTreeBuilder&) at ~/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp:774
#4	0x00000001519d0fac in WebCore::RenderTreeUpdater::tearDownRenderers(WebCore::Element&) at ~/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp:667
#5	0x000000014f86f0b4 in WebCore::Element::addShadowRoot(WTF::Ref<WebCore::ShadowRoot, WTF::RawPtrTraits<WebCore::ShadowRoot>, WTF::DefaultRefDerefTraits<WebCore::ShadowRoot>>&&) at ~/Source/WebCore/dom/Element.cpp:2870
#6	0x000000014f881af4 in WebCore::Element::createUserAgentShadowRoot() at ~/Source/WebCore/dom/Element.cpp:3028
#7	0x000000014f881a0c in WebCore::Element::ensureUserAgentShadowRoot() at ~/Source/WebCore/dom/Element.cpp:3020
#8	0x000000014f927b7c in WebCore::ImageOverlay::updateSubtree(WebCore::HTMLElement&, WebCore::TextRecognitionResult const&) at ~/Source/WebCore/dom/ImageOverlay.cpp:377
#9	0x000000014f926404 in WebCore::ImageOverlay::updateWithTextRecognitionResult(WebCore::HTMLElement&, WebCore::TextRecognitionResult const&, WebCore::ImageOverlay::CacheTextRecognitionResults) at ~/Source/WebCore/dom/ImageOverlay.cpp:493
#10	0x0000000119ca0a24 in auto WebKit::WebPage::requestTextRecognition(WebCore::Element&, WebCore::TextRecognitionOptions&&, WTF::CompletionHandler<void (WTF::RefPtr<WebCore::Element, WTF::RawPtrTraits<WebCore::Element>, WTF::DefaultRefDerefTraits<WebCore::Element>>&&)>&&)::$_1::operator()<WebCore::TextRecognitionResult>(WebCore::TextRecognitionResult&&) const at ~/Source/WebKit/WebProcess/WebPage/WebPage.cpp:8848

So that's why this is specific to <img>, we're adding a shadow root to that element when text is recognized within that image. I presume this only happens when the cursor is over that image.
Comment 11 Antoine Quint 2024-04-29 10:19:53 PDT
Pull request: https://github.com/WebKit/WebKit/pull/27881
Comment 12 Antoine Quint 2024-04-29 10:28:07 PDT
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/45958
Comment 13 EWS 2024-04-29 22:41:21 PDT
Committed 278156@main (19c5bd914bfa): <https://commits.webkit.org/278156@main>

Reviewed commits have been landed. Closing PR #27881 and removing active labels.