Bug 263735 - AX: Sometimes unable to see play/pause animation context menu item when setting is toggled
Summary: AX: Sometimes unable to see play/pause animation context menu item when setti...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Joshua Hoffman
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-10-26 11:21 PDT by Joshua Hoffman
Modified: 2023-10-27 18:23 PDT (History)
4 users (show)

See Also:


Attachments
Patch (5.42 KB, patch)
2023-10-26 12:21 PDT, Joshua Hoffman
no flags Details | Formatted Diff | Diff
Patch (5.47 KB, patch)
2023-10-26 13:30 PDT, Joshua Hoffman
no flags Details | Formatted Diff | Diff
Patch (5.56 KB, patch)
2023-10-26 16:19 PDT, Joshua Hoffman
no flags Details | Formatted Diff | Diff
Patch (5.58 KB, patch)
2023-10-27 13:06 PDT, Joshua Hoffman
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Hoffman 2023-10-26 11:21:50 PDT
When the Autoplay Animated Images setting is toggled off and on, the setting often remains stale, so the context menu item does not reappear when it should.
Comment 1 Radar WebKit Bug Importer 2023-10-26 11:22:24 PDT
<rdar://problem/117543410>
Comment 2 Joshua Hoffman 2023-10-26 11:22:40 PDT
rdar://117215059
Comment 3 Joshua Hoffman 2023-10-26 12:21:03 PDT
Created attachment 468355 [details]
Patch
Comment 4 chris fleizach 2023-10-26 12:30:44 PDT
Comment on attachment 468355 [details]
Patch

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

> Source/WebCore/page/Page.h:706
>      bool imageAnimationEnabled() const { return m_imageAnimationEnabled; }

why isn't the value of imageAnimationEnabled() sufficient for this? it ends up just being the inverse of whatever is set for imageAnimationEnabled
Comment 5 Tyler Wilcock 2023-10-26 12:33:37 PDT
Comment on attachment 468355 [details]
Patch

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

> Source/WebCore/page/Page.cpp:2186
> +
> +void Page::setSystemAllowsAnimationControls(bool isAllowed)
> +{
> +    m_systemAllowsAnimationControls = isAllowed;
> +}
>  #endif

Seems like this block has grown long enough to comment this #endif.

#endif // PLATFORM(FOO)
Comment 6 Joshua Hoffman 2023-10-26 13:27:43 PDT
Comment on attachment 468355 [details]
Patch

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

>> Source/WebCore/page/Page.cpp:2186
>>  #endif
> 
> Seems like this block has grown long enough to comment this #endif.
> 
> #endif // PLATFORM(FOO)

Will add that!

>> Source/WebCore/page/Page.h:706
>>      bool imageAnimationEnabled() const { return m_imageAnimationEnabled; }
> 
> why isn't the value of imageAnimationEnabled() sufficient for this? it ends up just being the inverse of whatever is set for imageAnimationEnabled

m_imageAnimationEnabled can be true even with the preference is off (for example, if the user has clicked "Play all animations"). See: anywhere we call setImageAnimationEnabled.
Comment 7 Joshua Hoffman 2023-10-26 13:30:01 PDT
Created attachment 468358 [details]
Patch
Comment 8 chris fleizach 2023-10-26 14:30:33 PDT
Comment on attachment 468358 [details]
Patch

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

> Source/WebCore/page/Page.h:1240
> +    bool m_systemAllowsAnimationControls { false };

should this concept be called

m_imageAnimationControlsEnabled
Comment 9 Joshua Hoffman 2023-10-26 14:36:41 PDT
(In reply to chris fleizach from comment #8)
> Comment on attachment 468358 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=468358&action=review
> 
> > Source/WebCore/page/Page.h:1240
> > +    bool m_systemAllowsAnimationControls { false };
> 
> should this concept be called
> 
> m_imageAnimationControlsEnabled

That does make sense, but I worry it is too similar to ImageAnimationControlEnabled, a preference which uses the ACCESSIBILITY_ANIMATION_CONTROL compile flag to determine if we should allow animation controls at all (used alongside the AX preference).
Comment 10 chris fleizach 2023-10-26 14:38:48 PDT
(In reply to Joshua Hoffman from comment #9)
> (In reply to chris fleizach from comment #8)
> > Comment on attachment 468358 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=468358&action=review
> > 
> > > Source/WebCore/page/Page.h:1240
> > > +    bool m_systemAllowsAnimationControls { false };
> > 
> > should this concept be called
> > 
> > m_imageAnimationControlsEnabled
> 
> That does make sense, but I worry it is too similar to
> ImageAnimationControlEnabled, a preference which uses the
> ACCESSIBILITY_ANIMATION_CONTROL compile flag to determine if we should allow
> animation controls at all (used alongside the AX preference).

M_systemImageAnimationEnabled ?
Comment 11 Joshua Hoffman 2023-10-26 14:39:51 PDT
(In reply to chris fleizach from comment #10)
> (In reply to Joshua Hoffman from comment #9)
> > (In reply to chris fleizach from comment #8)
> > > Comment on attachment 468358 [details]
> > > Patch
> > > 
> > > View in context:
> > > https://bugs.webkit.org/attachment.cgi?id=468358&action=review
> > > 
> > > > Source/WebCore/page/Page.h:1240
> > > > +    bool m_systemAllowsAnimationControls { false };
> > > 
> > > should this concept be called
> > > 
> > > m_imageAnimationControlsEnabled
> > 
> > That does make sense, but I worry it is too similar to
> > ImageAnimationControlEnabled, a preference which uses the
> > ACCESSIBILITY_ANIMATION_CONTROL compile flag to determine if we should allow
> > animation controls at all (used alongside the AX preference).
> 
> M_systemImageAnimationEnabled ?

works for me!
Comment 12 Joshua Hoffman 2023-10-26 16:19:14 PDT
Created attachment 468362 [details]
Patch
Comment 13 Tyler Wilcock 2023-10-26 21:50:06 PDT
Comment on attachment 468362 [details]
Patch

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

> Source/WebCore/page/Page.h:1240
> +    bool m_systemImageAnimationEnabled { false };

This new name and the default value of false feel inconsistent to me. All systems / platforms allow animation by default, contrary to this default value of false. It also might be confusing to have two flags that are named so similarly (m_imageAnimationEnabled and m_systemImageAnimationEnabled). If we called this something like m_systemAllowsAnimationControls that might be more precise, and distinct from m_imageAnimationEnabled. What do y'all think?
Comment 14 Joshua Hoffman 2023-10-26 22:24:23 PDT
(In reply to Tyler Wilcock from comment #13)
> Comment on attachment 468362 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=468362&action=review
> 
> > Source/WebCore/page/Page.h:1240
> > +    bool m_systemImageAnimationEnabled { false };
> 
> This new name and the default value of false feel inconsistent to me. All
> systems / platforms allow animation by default, contrary to this default
> value of false. It also might be confusing to have two flags that are named
> so similarly (m_imageAnimationEnabled and m_systemImageAnimationEnabled). If
> we called this something like m_systemAllowsAnimationControls that might be
> more precise, and distinct from m_imageAnimationEnabled. What do y'all think?

This does make sense—I think the more we can separate the two the better as to not make it more convoluted.
Comment 15 Joshua Hoffman 2023-10-27 13:06:36 PDT
Created attachment 468372 [details]
Patch
Comment 16 EWS 2023-10-27 18:23:04 PDT
Committed 269878@main (38398649280b): <https://commits.webkit.org/269878@main>

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