Skip to content

Commit

Permalink
use poster source if available
Browse files Browse the repository at this point in the history
  • Loading branch information
marcustyphoon committed Feb 7, 2025
1 parent e392cf7 commit 90c3c24
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/features/accesskit/disable_gifs.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ const processGifs = function (gifElements) {
return;
}

const posterElement = gifElement.parentElement.querySelector(keyToCss('poster'));
if (posterElement?.currentSrc) {
gifElement.style.setProperty(pausedContentVar, `url(${posterElement.currentSrc})`);
addLabel(gifElement);
return;
}

if (gifElement.complete && gifElement.currentSrc) {
pauseGif(gifElement);
} else {
Expand Down

0 comments on commit 90c3c24

Please sign in to comment.