@@ -22,12 +22,7 @@ var punish = (statsEnabled, shouldRestoreCont) => {
22
22
23
23
// methods
24
24
const checkElem = element => {
25
- if ( ( element . nodeName == 'SCRIPT' ) ||
26
- ( element . nodeName == 'HEAD' ) ||
27
- ( element . nodeName == 'BODY' ) ||
28
- ( element . nodeName == 'HTML' ) ||
29
- ( element . nodeName == 'STYLE' ) )
30
- return
25
+ if ( ! isDecentElem ( element ) ) return
31
26
32
27
const elemPosStyle = getStyle ( element , 'position' )
33
28
if ( ( elemPosStyle == 'fixed' ) ||
@@ -46,18 +41,7 @@ var punish = (statsEnabled, shouldRestoreCont) => {
46
41
setTimeout ( ( ) => element ? setPropImp ( element , "display" , "none" ) : false , 10 )
47
42
}
48
43
49
- if ( ( getStyle ( element , 'filter' ) != 'none' ) ||
50
- ( getStyle ( element , '-webkit-filter' ) != 'none' ) ) {
51
- setPropImp ( element , "filter" , "none" )
52
- setPropImp ( element , "-webkit-filter" , "none" )
53
-
54
- if ( statsEnabled ) state = addItemToStats ( element , state )
55
- }
56
-
57
- if ( shouldRestoreCont ) state = detectGrad ( state , statsEnabled , element )
58
-
59
- if ( element . shadowRoot )
60
- checkElemWithSibl ( element . shadowRoot , checkElem )
44
+ state = additionalChecks ( element , state , statsEnabled , shouldRestoreCont , checkElem )
61
45
}
62
46
63
47
// watch DOM
0 commit comments