Skip to content

fix(AccessKit Disable GIFs): Remove small flicker on first hover on certain elements - #2293

Draft
marcustyphoon wants to merge 1 commit into
AprilSylph:masterfrom
marcustyphoon:disable-gifs-background-no-flicker
Draft

fix(AccessKit Disable GIFs): Remove small flicker on first hover on certain elements#2293
marcustyphoon wants to merge 1 commit into
AprilSylph:masterfrom
marcustyphoon:disable-gifs-background-no-flicker

Conversation

@marcustyphoon

@marcustyphoon marcustyphoon commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Description

Currently, there's a slight flicker effect the first time you hover a GIF on https://www.tumblr.com/communities/browse if you have soft navigated to that page (observed in Firefox; have not yet tested in Chrome).

This is probably because we synchronously change the background-image property during initial processing, so the browser does not immediately begin to render the animated image as the background of the element in question. This is kind of like what #1853 did on purpose to prevent the animated source from being downloaded until the user hovers the element. In this case, we're immediately fetching the animated source ourselves anyway, so there's no bandwidth benefit; the only result of this is that the user hover is the first time the image is rendered (and to my knowledge there's no equivalent of gifElement.decoding = 'sync'; for background-image css, so this causes a brief flicker of no image being displayed).

The fix is to intentionally not initially process background-image gifs synchronously, making the browser fire the load process with the regular animated background-image value (even though by the time it would result in any visible effect, we've changed the value to something else). Then, when the user hover switches it back to the regular value, the processing has already been done and the switch is instant.

Screenshots

Testing steps

@marcustyphoon marcustyphoon self-assigned this Jul 11, 2026
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