Remove the input.type polyfill

This is only relevant for browsers that we don't intend to support with PDF.js version `2.0`.
This commit is contained in:
Jonas Jenwald 2017-12-19 15:00:27 +01:00
parent cf88b7b212
commit 6af45052c5

View File

@ -111,31 +111,6 @@ PDFJS.compatibilityChecked = true;
});
})();
// Provides `input.type = 'type'` runtime failure protection.
// Support: IE9,10.
(function checkInputTypeNumberAssign() {
if (!hasDOM) {
return;
}
var el = document.createElement('input');
try {
el.type = 'number';
} catch (ex) {
var inputProto = el.constructor.prototype;
var typeProperty = Object.getOwnPropertyDescriptor(inputProto, 'type');
Object.defineProperty(inputProto, 'type', {
get() {
return typeProperty.get.call(this);
},
set(value) {
typeProperty.set.call(this, value === 'number' ? 'text' : value);
},
enumerable: true,
configurable: true,
});
}
})();
// Provides correct document.readyState value for legacy browsers.
// Support: IE9,10.
(function checkDocumentReadyState() {