-
Notifications
You must be signed in to change notification settings - Fork 49
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: Hide animated images instead of covering them #1707
base: master
Are you sure you want to change the base?
AccessKit Disable GIFs: Hide animated images instead of covering them #1707
Conversation
184ba7b
to
6bc6630
Compare
Ooh, fascinating! In Firefox, this This can be fixed completely cleanly by Note that:
|
Description
Right now, Disable GIFs hides most animated images when they aren't hovered by covering them with a non-animated one, and handles transparency by setting an opaque "white" background on the cover so the real, animated image can't be seen through transparent parts. This works great as long as the background is actually supposed to be "white" (which it is, in posts, even with Themed Posts). It doesn't work if one wants to apply that part of the Disable GIFs to other parts of the Tumblr UI which may have different background colors (in this case, the "recommended" element at the top of the Tumblr TV interface), and also might use a bit more CPU than the alternative.
What's the alternative? We simply hide the animated image when it's not hovered, just like we hide the cover when it is hovered. Thus, only one image is ever displayed at a time, and there's no need to implement anything special to make transparent images work.
This also means that we no longer care about the layer order at all, and in fact it's slightly more elegant due to the way CSS selectors work to put our canvas element before (i.e. what would have been "behind") the native animated image, similar to how Vanilla Videos inserts its replacement element before the native element and hides the native element with aremoved for consistency with possible future development~
selector.(Aside: #1458, which I've done a reasonable amount of testing on, already uses the main technique used here. It will merge conflict with this, but it needs some refactoring anyway, hence its draft status.)
Testing steps