Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AccessKit Disable GIFs: Pause ALL the GIFs! #1729

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

marcustyphoon
Copy link
Collaborator

@marcustyphoon marcustyphoon commented Feb 17, 2025

Description

This applies AccessKit Disable GIFs to basically everything.

Consists of #1727 (see its description for technical details) plus an expanded list of element selectors and a few miscellaneous tweaks for functionality on newly enabled elements. One may simply consider this PR the canonical version of these changes; it's of course the meaningfully testable one.

Known elements that are not paused:

  • Tumblrmart rainbow checkmark/lunar badge modal images (technical: can't position the label effectively; intentional: moon is invisible when paused)
  • rainbow checkmark/lunar badge hover modals
  • gifs in the post editor/post editor gif selector (intentional: you probably want to see what your post looks like)
  • gifs in lightboxes (intentional)
  • Tumblr TV modal images (intentional but somewhat technical: tumblr's layout relies onsizes="100vw", which doesn't affect content-replaced images)

Supersedes #1682, #1706, and #1708.


Yes, as you may have guessed, this is pretty close in functionality to simply writing:

pageModifications.register(`img:not(${keyToCss('poster')})`, processGifs);
pageModifications.register('[style*="background-image:"]', processBackgroundGifs);

Like https://github.com/marcustyphoon/XKit-Rewritten/blob/77a3d6734c33373e9c0fafb37c677fcf963febcf/src/features/mute.js#L84-L94, it would be far fewer lines of code to use a blacklist than a whitelist. That would result in the feature potentially being active on a missed or just-released piece of site UI, however. For both of these features, that's probably fine in most cases, but it has some possibility to lead to user confusion on a deeper level than the feature not working until we test and approve it.

(That is: you can mute your own e.g. reblogged posts, making it appear as though a new non-blacklisted timeline is missing elements; sufficiently complex css can make paused gifs not have visible labels or hover-to-play functionality, making it appear as though a new non-blacklisted animated element is not animated. The likelihood of this happening is so small, but the moment it happens and I have to read a post in which a user blames Staff for the "site being broken" due to this I will throw my laptop into the ocean. So, you know, swings and roundabouts.)

Testing steps

Find an unpaused GIF in the Tumblr interface. Do it, I dare you.

No, but actually:

  • Confirm that each type of animated element listed in the source code is paused and receives a size-appropriate and visible label, and becomes unpaused and labelless when hovered.

@marcustyphoon marcustyphoon force-pushed the disable-gifs-pause-all branch 14 times, most recently from 19e7a4f to 98ec95b Compare February 20, 2025 12:29
@marcustyphoon
Copy link
Collaborator Author

marcustyphoon commented Feb 20, 2025

https://www.tumblr.com/dashboard/tumblr_tv cards apparently change their background image each time you navigate within them; React changes only the background-image style property, so our paused images go out of sync with the on-hover images/sometimes we don't pause an image because it wasn't originally animated.

  • fix this (or just don't process the Tumblr TV page)

@marcustyphoon marcustyphoon force-pushed the disable-gifs-pause-all branch 6 times, most recently from c4dae68 to a44a5cf Compare February 21, 2025 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant