1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-29 07:37:57 +02:00

Using sans-serif instead of loaded fonts; fix IE9 dataset compatibility shim

This commit is contained in:
notmasteryet 2012-02-10 12:55:11 -06:00
parent 7859ef0f04
commit cdf1db35fc
3 changed files with 9 additions and 6 deletions

View file

@ -217,12 +217,15 @@
var div = document.createElement('div');
if ('dataset' in div)
return; // dataset property exists
Object.defineProperty(HTMLElement.prototype, 'dataset', {
get: function htmlElementDatasetGetter() {
// adding dataset field to the actual object
return (this.dataset = {});
var oldCreateElement = document.createElement;
document.createElement = function newCreateElement() {
var result = oldCreateElement.apply(document, arguments);
if (arguments[0] === 'div') {
// creating dataset property for the div elements
result.dataset = {};
}
});
return result;
};
})();
// Check console compatability