| 3189 | |
| 3190 | // Certain oddball element types can't be extended in IE8. |
| 3191 | function checkElementPrototypeDeficiency(tagName) { |
| 3192 | if (typeof window.Element === 'undefined') return false; |
| 3193 | // Skip newer IEs because creating an OBJECT tag pops up an annoying |
| 3194 | // "this page uses Java" warning. |
| 3195 | if (!HAS_EXTENDED_CREATE_ELEMENT_SYNTAX) return false; |
| 3196 | var proto = window.Element.prototype; |
| 3197 | if (proto) { |
| 3198 | var id = '_' + (Math.random() + '').slice(2), |
| 3199 | el = document.createElement(tagName); |
| 3200 | proto[id] = 'x'; |
| 3201 | var isBuggy = (el[id] !== 'x'); |
| 3202 | delete proto[id]; |
| 3203 | el = null; |
| 3204 | return isBuggy; |
| 3205 | } |
| 3206 | |
| 3207 | return false; |
| 3208 | } |
| 3209 | |
| 3210 | var HTMLOBJECTELEMENT_PROTOTYPE_BUGGY = |
| 3211 | checkElementPrototypeDeficiency('object'); |