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: Refactor async callbacks #1683

Conversation

marcustyphoon
Copy link
Collaborator

@marcustyphoon marcustyphoon commented Jan 4, 2025

Description

Disable GIFs currently sets some onload callbacks to wait for image element sources to be loaded. This replaces them with the decode() HTMLImageElement instance method that I found while looking through MDN for something different-but-related, removing some nesting. Conveniently, this doesn't require a conditional for whether the image is already loaded (try $0.decode().then(() => console.log('done')) on an already-loaded image).

"Hide whitespace" is recommended.

Testing steps

  • Confirm that Disable GIFs continues to work as expected.

@marcustyphoon
Copy link
Collaborator Author

Annoyingly, this seems to just sometimes fail in Firefox in my testing.

@marcustyphoon
Copy link
Collaborator Author

Ah, figured out why and noted it in an MDN issue: mdn/content#38034

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