IE9 have all four attributes and pass the following test, but it shouldn't because it doesn't have scrollX and scrollY.
|
if ('innerWidth' in global && 'innerHeight' in global && 'pageXOffset' in global && 'pageYOffset' in global) { |
|
return; |
|
} |
According to this snippet, the polyfill complete six global attributes instead of four. I suggest we test all attributes it affected to make IE9 environment more flat.
|
Object.defineProperties(global, { |
|
innerWidth: { |
|
get: function () { |
|
return docEl.clientWidth; |
|
} |
|
}, |
|
innerHeight: { |
|
get: function () { |
|
return docEl.clientHeight; |
|
} |
|
}, |
|
pageXOffset: { |
|
get: scrollX |
|
}, |
|
pageYOffset: { |
|
get: scrollY |
|
}, |
|
scrollX: { |
|
get: scrollX |
|
}, |
|
scrollY: { |
|
get: scrollY |
|
} |
|
}); |
IE9 have all four attributes and pass the following test, but it shouldn't because it doesn't have
scrollXandscrollY.es5-polyfill/dist/polyfill.js
Lines 1119 to 1121 in 3f186b5
According to this snippet, the polyfill complete six global attributes instead of four. I suggest we test all attributes it affected to make IE9 environment more flat.
es5-polyfill/dist/polyfill.js
Lines 1134 to 1157 in 3f186b5