File tree Expand file tree Collapse file tree
src/view/frontend/web/js/toolbar/audits Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export default {
3030 if ( type !== null && type . trim ( ) !== '' ) return false ;
3131 if ( ! btn . offsetParent && getComputedStyle ( btn ) . position !== 'fixed' ) return false ;
3232 const style = getComputedStyle ( btn ) ;
33- if ( style . visibility === 'hidden' || style . display === 'none' || style . opacity === '0' ) return false ;
33+ if ( style . visibility === 'hidden' || style . display === 'none' || parseFloat ( style . opacity ) === 0 ) return false ;
3434 return true ;
3535 } ) ;
3636
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export default {
2828 // Visibility check
2929 if ( ! el . offsetParent && getComputedStyle ( el ) . position !== 'fixed' ) return false ;
3030 const style = getComputedStyle ( el ) ;
31- if ( style . visibility === 'hidden' || style . display === 'none' || style . opacity === '0' ) return false ;
31+ if ( style . visibility === 'hidden' || style . display === 'none' || parseFloat ( style . opacity ) === 0 ) return false ;
3232
3333 // Accessible name sources
3434 if ( el . getAttribute ( 'aria-label' ) ?. trim ( ) ) return false ;
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export default {
2626 const images = Array . from ( document . querySelectorAll ( 'img' ) ) . filter ( img => {
2727 if ( ! img . offsetParent && getComputedStyle ( img ) . position !== 'fixed' ) return false ;
2828 const style = getComputedStyle ( img ) ;
29- if ( style . visibility === 'hidden' || style . display === 'none' || style . opacity === '0' ) return false ;
29+ if ( style . visibility === 'hidden' || style . display === 'none' || parseFloat ( style . opacity ) === 0 ) return false ;
3030 return ! img . hasAttribute ( 'width' ) || ! img . hasAttribute ( 'height' ) ;
3131 } ) ;
3232
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export default {
2727 const h1s = Array . from ( document . querySelectorAll ( 'h1' ) ) . filter ( el => {
2828 if ( ! el . offsetParent && getComputedStyle ( el ) . position !== 'fixed' ) return false ;
2929 const style = getComputedStyle ( el ) ;
30- if ( style . visibility === 'hidden' || style . display === 'none' || style . opacity === '0' ) return false ;
30+ if ( style . visibility === 'hidden' || style . display === 'none' || parseFloat ( style . opacity ) === 0 ) return false ;
3131 return true ;
3232 } ) ;
3333
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export default {
4545 if ( el . matches ( '[disabled], [aria-disabled="true"]' ) ) return false ;
4646 if ( ! el . offsetParent && getComputedStyle ( el ) . position !== 'fixed' ) return false ;
4747 const style = getComputedStyle ( el ) ;
48- if ( style . visibility === 'hidden' || style . display === 'none' || style . opacity === '0' ) return false ;
48+ if ( style . visibility === 'hidden' || style . display === 'none' || parseFloat ( style . opacity ) === 0 ) return false ;
4949
5050 const rect = el . getBoundingClientRect ( ) ;
5151 return rect . width < MIN_SIZE || rect . height < MIN_SIZE ;
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export default {
3333 ) . filter ( el => {
3434 if ( ! el . offsetParent && getComputedStyle ( el ) . position !== 'fixed' ) return false ;
3535 const style = getComputedStyle ( el ) ;
36- if ( style . visibility === 'hidden' || style . display === 'none' || style . opacity === '0' ) return false ;
36+ if ( style . visibility === 'hidden' || style . display === 'none' || parseFloat ( style . opacity ) === 0 ) return false ;
3737
3838 const rel = ( el . getAttribute ( 'rel' ) || '' ) . toLowerCase ( ) . split ( / \s + / ) ;
3939 return ! rel . includes ( 'noopener' ) && ! rel . includes ( 'noreferrer' ) ;
You can’t perform that action at this time.
0 commit comments