File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -330,11 +330,6 @@ async function waitForIcons(page: Page) {
330
330
throw new Error ( 'Icon is not an SVGElement' ) ;
331
331
}
332
332
333
- // If not visible, we don't care about loading state
334
- if ( ! icon . checkVisibility ( ) ) {
335
- return true ;
336
- }
337
-
338
333
// If loaded, good it passes the test.
339
334
if ( icon . dataset . loadingState === 'loaded' ) {
340
335
return true ;
@@ -370,7 +365,12 @@ async function waitForIcons(page: Page) {
370
365
const img = new Image ( ) ;
371
366
img . src = url ;
372
367
img . decode ( ) . then ( ( ) => {
373
- icon . dataset . loadingState = 'loaded' ;
368
+ // Wait two frames to let the time to the icon to repaint.
369
+ requestAnimationFrame ( ( ) => {
370
+ requestAnimationFrame ( ( ) => {
371
+ icon . dataset . loadingState = 'loaded' ;
372
+ } ) ;
373
+ } ) ;
374
374
} ) ;
375
375
376
376
return false ;
You can’t perform that action at this time.
0 commit comments