o2team / es5-polyfill

ECMAScript 5 Polyfill for IE-8

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing global attributes in IE9

zcfan opened this issue · comments

IE9 have all four attributes and pass the following test, but it shouldn't because it doesn't have scrollX and scrollY.

es5-polyfill/dist/polyfill.js

Lines 1119 to 1121 in 3f186b5

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.

es5-polyfill/dist/polyfill.js

Lines 1134 to 1157 in 3f186b5

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
}
});