Bug 255758

Summary: AX: Play Animation and Pause Animation actions don't appear for animations with a link parent element
Product: WebKit Reporter: Tyler Wilcock <tyler_w>
Component: AnimationsAssignee: Tyler Wilcock <tyler_w>
Status: RESOLVED FIXED    
Severity: Normal CC: andresg_22, cfleizach, dino, graouts, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description Tyler Wilcock 2023-04-20 18:56:21 PDT
Example demonstrating this:

<a href="#foo">
    <img src="animated-red-green-blue-repeat-infinite.gif" width="223" height="223" alt="Alt text">
</a>
Comment 1 Radar WebKit Bug Importer 2023-04-20 18:56:50 PDT
<rdar://problem/108350118>
Comment 2 Tyler Wilcock 2023-04-20 19:21:43 PDT
Created attachment 466022 [details]
Patch
Comment 3 Tyler Wilcock 2023-04-20 20:32:21 PDT
Created attachment 466025 [details]
Patch
Comment 4 Tyler Wilcock 2023-04-20 20:41:59 PDT
Created attachment 466026 [details]
Patch
Comment 5 chris fleizach 2023-04-21 15:19:32 PDT
Comment on attachment 466026 [details]
Patch

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

> Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm:545
> +                [actions addObject:[_WKElementAction _elementActionWithType:_WKElementActionPauseAnimation info:elementInfo assistant:self]];

can we write these 4 lines as

[actions addObject:[_WKElementAction _elementActionWithType:elementInfo.isAnimating ? _WKElementActionPauseAnimation : _WKElementActionPlayAnimation  info:elementInfo assistant:self]];

> Tools/TestWebKitAPI/Tests/ios/ActionSheetTests.mm:379
> +#if ENABLE(ACCESSIBILITY_ANIMATION_CONTROL)

does this function need to be guarded by animation control? seems generic
Comment 6 Tyler Wilcock 2023-04-21 16:12:13 PDT
Created attachment 466037 [details]
Patch
Comment 7 Tyler Wilcock 2023-04-21 16:18:47 PDT
(In reply to chris fleizach from comment #5)
> Comment on attachment 466026 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=466026&action=review
> 
> > Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm:545
> > +                [actions addObject:[_WKElementAction _elementActionWithType:_WKElementActionPauseAnimation info:elementInfo assistant:self]];
> 
> can we write these 4 lines as
> 
> [actions addObject:[_WKElementAction
> _elementActionWithType:elementInfo.isAnimating ?
> _WKElementActionPauseAnimation : _WKElementActionPlayAnimation 
> info:elementInfo assistant:self]];
Yeah, that's nicer, thanks. Fixed in latest patch.

> > Tools/TestWebKitAPI/Tests/ios/ActionSheetTests.mm:379
> > +#if ENABLE(ACCESSIBILITY_ANIMATION_CONTROL)
> 
> does this function need to be guarded by animation control? seems generic
Since it's only used with ENABLE(ACCESSIBILITY_ANIMATION_CONTROL), I believe un-guarding it would cause an unused static function warning for other platforms.
Comment 8 EWS 2023-04-24 11:37:50 PDT
Committed 263323@main (9a8207739bc9): <https://commits.webkit.org/263323@main>

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