-
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: Use content replacement #1708
Draft
marcustyphoon
wants to merge
19
commits into
AprilSylph:master
Choose a base branch
from
marcustyphoon:disable-gifs-content-replacement
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
AccessKit Disable GIFs: Use content replacement #1708
marcustyphoon
wants to merge
19
commits into
AprilSylph:master
from
marcustyphoon:disable-gifs-content-replacement
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c332219
to
eb4047e
Compare
eb4047e
to
482f3c3
Compare
c1fa486
to
e392cf7
Compare
90c3c24
to
9cd913e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
As a proof of concept, this modifies Disable GIFs by entirely replacing the technique of inserting canvas elements into the DOM with a new technique: overriding the content of non-hovered image elements using the css content property. This also contains various commits from other Disable GIFs PRs.
Because this version of Disable GIFs is implemented entirely in CSS—besides the labels; maybe they could be pseudos, but you can't pseudo an
<img>
so probably not—this removes basically all restrictions on what GIF elements we can hit. DOM structure and layout don't matter. Animated blog headers (including in blog cards) are now fair game, as are images in link cards, the thumbnail images in the search dropdown and the header above the tumblr labs settings.The drawbacks of doing this are mainly that its pausing-images-quickly performance can be pretty bad, e.g. when navigating to the tagged page for "gif" (it's a lot of blob URLs to create at once) and that I've observed some weird flickering when moving the cursor off of an affected GIF in some cases. I would not actually merge this as-is, though; we have a much better method for pausing GIFs in posts, which is to use or create a duplicate of Tumblr's native poster element. That has far better performance than our current method and fixes the on-hover flicker here. The technique in this PR is best for niche GIFs throughout the UI that don't have posters (setting
content
if they are true image elements and overridingbackground-image
when they are not), and these are generally few in number and/or can't be paused by any other method anyway.Testing steps