mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
ESLint --fix
This commit is contained in:
parent
80d7ff4912
commit
ef1f255649
13 changed files with 47 additions and 47 deletions
|
@ -1,7 +1,7 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function xmlEncode(s){
|
||||
function xmlEncode(s) {
|
||||
var i = 0, ch;
|
||||
s = String(s);
|
||||
while (i < s.length && (ch = s[i]) !== '&' && ch !== '<' &&
|
||||
|
@ -50,7 +50,7 @@ function DOMElement(name) {
|
|||
if (name === 'style') {
|
||||
this.sheet = {
|
||||
cssRules: [],
|
||||
insertRule: function (rule) {
|
||||
insertRule: function(rule) {
|
||||
this.cssRules.push(rule);
|
||||
},
|
||||
};
|
||||
|
@ -124,8 +124,8 @@ DOMElement.prototype = {
|
|||
|
||||
getSerializer: function DOMElement_getSerializer() {
|
||||
return new DOMElementSerializer(this);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
function DOMElementSerializer(node) {
|
||||
this._node = node;
|
||||
|
@ -198,48 +198,48 @@ DOMElementSerializer.prototype = {
|
|||
};
|
||||
|
||||
const document = {
|
||||
childNodes : [],
|
||||
childNodes: [],
|
||||
|
||||
get currentScript() {
|
||||
return { src: '' };
|
||||
return { src: '', };
|
||||
},
|
||||
|
||||
get documentElement() {
|
||||
return this;
|
||||
},
|
||||
|
||||
createElementNS: function (NS, element) {
|
||||
createElementNS: function(NS, element) {
|
||||
var elObject = new DOMElement(element);
|
||||
return elObject;
|
||||
},
|
||||
|
||||
createElement: function (element) {
|
||||
createElement: function(element) {
|
||||
return this.createElementNS('', element);
|
||||
},
|
||||
|
||||
getElementsByTagName: function (element) {
|
||||
getElementsByTagName: function(element) {
|
||||
if (element === 'head') {
|
||||
return [this.head || (this.head = new DOMElement('head'))];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
function Image () {
|
||||
function Image() {
|
||||
this._src = null;
|
||||
this.onload = null;
|
||||
}
|
||||
Image.prototype = {
|
||||
get src () {
|
||||
get src() {
|
||||
return this._src;
|
||||
},
|
||||
set src (value) {
|
||||
set src(value) {
|
||||
this._src = value;
|
||||
if (this.onload) {
|
||||
this.onload();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
exports.document = document;
|
||||
exports.Image = Image;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue