Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

jsdom

Package Overview
Dependencies
77
Maintainers
3
Versions
259
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 9.9.1 to 9.10.0

lib/jsdom/living/file-api/Blob-impl.js

4

lib/jsdom.js

@@ -19,3 +19,3 @@ "use strict";

const idlUtils = require("./jsdom/living/generated/utils");
const blobSymbols = require("./jsdom/living/blob-symbols");
const Blob = require("./jsdom/living/generated/Blob");

@@ -290,3 +290,3 @@ const whatwgURL = require("whatwg-url");

exports.blobToBuffer = function (blob) {
return blob && blob[blobSymbols.buffer];
return Blob.is(blob) && idlUtils.implForWrapper(blob)._buffer || undefined;
};

@@ -293,0 +293,0 @@

@@ -15,4 +15,4 @@ "use strict";

const idlUtils = require("../living/generated/utils");
const createFileReader = require("../living/file-reader");
const createXMLHttpRequest = require("../living/xmlhttprequest");
const createFileReader = require("../living/generated/FileReader").createInterface;
const Document = require("../living/generated/Document");

@@ -265,3 +265,6 @@ const Navigator = require("../living/generated/Navigator");

this.FileReader = createFileReader(this);
this.FileReader = createFileReader({
window: this
}).interface;
this.XMLHttpRequest = createXMLHttpRequest(this);

@@ -268,0 +271,0 @@

@@ -41,2 +41,12 @@ "use strict";

get cancelBubble() {
return this._stopPropagationFlag;
}
set cancelBubble(v) {
if (v) {
this._stopPropagationFlag = true;
}
}
stopImmediatePropagation() {

@@ -43,0 +53,0 @@ this._stopPropagationFlag = true;

@@ -111,3 +111,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -168,4 +168,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../attributes/Attr-impl.js");

@@ -22,3 +22,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -81,4 +81,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/CDATASection-impl.js");

@@ -129,3 +129,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -188,4 +188,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/CharacterData-impl.js");

@@ -34,3 +34,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -91,4 +91,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/ChildNode-impl.js");

@@ -19,3 +19,3 @@ "use strict";

module.exports.setup(this, args);
iface.setup(this, args);
}

@@ -33,3 +33,3 @@ Comment.prototype = Object.create(CharacterData.interface.prototype);

module.exports = {
const iface = {
mixedInto: [],

@@ -92,4 +92,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/Comment-impl.js");

@@ -23,3 +23,3 @@ "use strict";

module.exports.setup(this, args);
iface.setup(this, args);
}

@@ -62,3 +62,3 @@ CustomEvent.prototype = Object.create(Event.interface.prototype);

module.exports = {
const iface = {
mixedInto: [],

@@ -122,4 +122,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../events/CustomEvent-impl.js");

@@ -18,3 +18,3 @@ "use strict";

module.exports.setup(this, args);
iface.setup(this, args);
}

@@ -680,3 +680,3 @@ Document.prototype = Object.create(Node.interface.prototype);

module.exports = {
const iface = {
mixedInto: [],

@@ -751,4 +751,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/Document-impl.js");

@@ -16,3 +16,3 @@ "use strict";

module.exports.setup(this, args);
iface.setup(this, args);
}

@@ -32,3 +32,3 @@ DocumentFragment.prototype = Object.create(Node.interface.prototype);

module.exports = {
const iface = {
mixedInto: [],

@@ -91,4 +91,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/DocumentFragment-impl.js");

@@ -50,3 +50,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -109,4 +109,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/DocumentType-impl.js");

@@ -85,3 +85,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -142,4 +142,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/DOMImplementation-impl.js");

@@ -13,3 +13,3 @@ "use strict";

module.exports.setup(this, args);
iface.setup(this, args);
}

@@ -40,3 +40,3 @@

module.exports = {
const iface = {
mixedInto: [],

@@ -97,4 +97,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../domparsing/DOMParser-impl.js");

@@ -491,4 +491,76 @@ "use strict";

Object.defineProperty(Element.prototype, "scrollTop", {
get() {
return this[impl].scrollTop;
},
set(V) {
V = conversions["unrestricted double"](V);
this[impl].scrollTop = V;
},
enumerable: true,
configurable: true
});
module.exports = {
Object.defineProperty(Element.prototype, "scrollLeft", {
get() {
return this[impl].scrollLeft;
},
set(V) {
V = conversions["unrestricted double"](V);
this[impl].scrollLeft = V;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Element.prototype, "scrollWidth", {
get() {
return this[impl].scrollWidth;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Element.prototype, "scrollHeight", {
get() {
return this[impl].scrollHeight;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Element.prototype, "clientTop", {
get() {
return this[impl].clientTop;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Element.prototype, "clientLeft", {
get() {
return this[impl].clientLeft;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Element.prototype, "clientWidth", {
get() {
return this[impl].clientWidth;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Element.prototype, "clientHeight", {
get() {
return this[impl].clientHeight;
},
enumerable: true,
configurable: true
});
const iface = {
mixedInto: [],

@@ -551,4 +623,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/Element-impl.js");

@@ -19,3 +19,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -76,4 +76,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/ElementContentEditable-impl.js");

@@ -30,3 +30,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -87,4 +87,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/ElementCSSInlineStyle-impl.js");

@@ -23,3 +23,3 @@ "use strict";

module.exports.setup(this, args);
iface.setup(this, args);
}

@@ -77,3 +77,3 @@ ErrorEvent.prototype = Object.create(Event.interface.prototype);

module.exports = {
const iface = {
mixedInto: [],

@@ -137,4 +137,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../events/ErrorEvent-impl.js");

@@ -22,3 +22,3 @@ "use strict";

module.exports.setup(this, args);
iface.setup(this, args);
}

@@ -151,2 +151,14 @@

Object.defineProperty(Event.prototype, "cancelBubble", {
get() {
return this[impl].cancelBubble;
},
set(V) {
V = conversions["boolean"](V);
this[impl].cancelBubble = V;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Event.prototype, "bubbles", {

@@ -185,3 +197,3 @@ get() {

module.exports = {
const iface = {
mixedInto: [],

@@ -252,4 +264,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../events/Event-impl.js");

@@ -71,3 +71,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -129,4 +129,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../events/EventTarget-impl.js");

@@ -23,3 +23,3 @@ "use strict";

module.exports.setup(this, args);
iface.setup(this, args);
}

@@ -45,3 +45,3 @@ FocusEvent.prototype = Object.create(UIEvent.interface.prototype);

module.exports = {
const iface = {
mixedInto: [],

@@ -104,4 +104,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../events/FocusEvent-impl.js");

@@ -13,3 +13,3 @@ "use strict";

module.exports.setup(this, args);
iface.setup(this, args);
}

@@ -121,3 +121,3 @@

module.exports = {
const iface = {
mixedInto: [],

@@ -179,4 +179,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../xhr/FormData-impl.js");

@@ -712,3 +712,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -769,4 +769,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/GlobalEventHandlers-impl.js");

@@ -23,3 +23,3 @@ "use strict";

module.exports.setup(this, args);
iface.setup(this, args);
}

@@ -53,3 +53,3 @@ HashChangeEvent.prototype = Object.create(Event.interface.prototype);

module.exports = {
const iface = {
mixedInto: [],

@@ -113,4 +113,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../events/HashChangeEvent-impl.js");

@@ -121,3 +121,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -178,4 +178,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../window/History-impl.js");

@@ -168,3 +168,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -227,4 +227,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLAnchorElement-impl.js");

@@ -165,3 +165,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -224,4 +224,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLAppletElement-impl.js");

@@ -107,3 +107,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -166,4 +166,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLAreaElement-impl.js");

@@ -22,3 +22,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -81,4 +81,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLAudioElement-impl.js");

@@ -47,3 +47,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -106,4 +106,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLBaseElement-impl.js");

@@ -104,3 +104,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -163,4 +163,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLBodyElement-impl.js");

@@ -35,3 +35,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -94,4 +94,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLBRElement-impl.js");

@@ -129,3 +129,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -188,4 +188,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLButtonElement-impl.js");

@@ -121,3 +121,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -180,4 +180,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLCanvasElement-impl.js");

@@ -35,3 +35,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -94,4 +94,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLDataElement-impl.js");

@@ -22,3 +22,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -81,4 +81,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLDataListElement-impl.js");

@@ -38,3 +38,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -97,4 +97,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLDialogElement-impl.js");

@@ -38,3 +38,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -97,4 +97,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLDirectoryElement-impl.js");

@@ -35,3 +35,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -94,4 +94,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLDivElement-impl.js");

@@ -38,3 +38,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -97,4 +97,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLDListElement-impl.js");

@@ -145,3 +145,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -204,4 +204,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLElement-impl.js");

@@ -99,3 +99,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -158,4 +158,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLEmbedElement-impl.js");

@@ -59,3 +59,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -118,4 +118,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLFieldSetElement-impl.js");

@@ -61,3 +61,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -120,4 +120,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLFontElement-impl.js");

@@ -151,3 +151,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -210,4 +210,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLFormElement-impl.js");

@@ -143,3 +143,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -202,4 +202,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLFrameElement-impl.js");

@@ -52,3 +52,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -111,4 +111,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLFrameSetElement-impl.js");

@@ -22,3 +22,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -81,4 +81,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLHeadElement-impl.js");

@@ -35,3 +35,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -94,4 +94,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLHeadingElement-impl.js");

@@ -90,3 +90,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -149,4 +149,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLHRElement-impl.js");

@@ -35,3 +35,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -94,4 +94,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLHtmlElement-impl.js");

@@ -27,3 +27,3 @@ "use strict";

}
return this.href;
return this[impl].href;;
};

@@ -148,3 +148,3 @@

module.exports = {
const iface = {
mixedInto: [],

@@ -205,4 +205,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLHyperlinkElementUtils-impl.js");

@@ -218,3 +218,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -277,4 +277,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLIFrameElement-impl.js");

@@ -266,3 +266,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -325,4 +325,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLImageElement-impl.js");

@@ -523,3 +523,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -582,4 +582,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLInputElement-impl.js");

@@ -43,3 +43,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -102,4 +102,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLLabelElement-impl.js");

@@ -43,3 +43,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -102,4 +102,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLLegendElement-impl.js");

@@ -48,3 +48,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -107,4 +107,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLLIElement-impl.js");

@@ -146,3 +146,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -205,4 +205,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLLinkElement-impl.js");

@@ -43,3 +43,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -102,4 +102,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLMapElement-impl.js");

@@ -445,3 +445,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -504,4 +504,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLMediaElement-impl.js");

@@ -64,3 +64,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -123,4 +123,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLMenuElement-impl.js");

@@ -74,3 +74,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -133,4 +133,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLMetaElement-impl.js");

@@ -22,3 +22,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -81,4 +81,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLMeterElement-impl.js");

@@ -48,3 +48,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -107,4 +107,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLModElement-impl.js");

@@ -249,3 +249,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -308,4 +308,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLObjectElement-impl.js");

@@ -80,3 +80,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -139,4 +139,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLOListElement-impl.js");

@@ -51,3 +51,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -110,4 +110,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLOptGroupElement-impl.js");

@@ -118,3 +118,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -177,4 +177,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLOptionElement-impl.js");

@@ -35,3 +35,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -94,4 +94,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLOutputElement-impl.js");

@@ -35,3 +35,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -94,4 +94,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLParagraphElement-impl.js");

@@ -74,3 +74,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -133,4 +133,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLParamElement-impl.js");

@@ -35,3 +35,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -94,4 +94,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLPreElement-impl.js");

@@ -22,3 +22,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -81,4 +81,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLProgressElement-impl.js");

@@ -35,3 +35,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -94,4 +94,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLQuoteElement-impl.js");

@@ -144,3 +144,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -203,4 +203,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLScriptElement-impl.js");

@@ -200,3 +200,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -259,4 +259,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLSelectElement-impl.js");

@@ -86,3 +86,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -145,4 +145,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLSourceElement-impl.js");

@@ -22,3 +22,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -81,4 +81,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLSpanElement-impl.js");

@@ -65,3 +65,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -124,4 +124,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLStyleElement-impl.js");

@@ -35,3 +35,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -94,4 +94,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLTableCaptionElement-impl.js");

@@ -185,3 +185,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -244,4 +244,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLTableCellElement-impl.js");

@@ -101,3 +101,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -160,4 +160,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLTableColElement-impl.js");

@@ -35,3 +35,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -94,4 +94,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLTableDataCellElement-impl.js");

@@ -297,3 +297,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -356,4 +356,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLTableElement-impl.js");

@@ -61,3 +61,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -120,4 +120,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLTableHeaderCellElement-impl.js");

@@ -142,3 +142,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -201,4 +201,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLTableRowElement-impl.js");

@@ -113,3 +113,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -172,4 +172,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLTableSectionElement-impl.js");

@@ -30,3 +30,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -89,4 +89,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLTemplateElement-impl.js");

@@ -355,3 +355,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -414,4 +414,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLTextAreaElement-impl.js");

@@ -35,3 +35,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -94,4 +94,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLTimeElement-impl.js");

@@ -34,3 +34,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -93,4 +93,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLTitleElement-impl.js");

@@ -133,3 +133,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -192,4 +192,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLTrackElement-impl.js");

@@ -51,3 +51,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -110,4 +110,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLUListElement-impl.js");

@@ -22,3 +22,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -81,4 +81,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLUnknownElement-impl.js");

@@ -78,3 +78,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -137,4 +137,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/HTMLVideoElement-impl.js");

@@ -23,3 +23,3 @@ "use strict";

module.exports.setup(this, args);
iface.setup(this, args);
}

@@ -210,3 +210,3 @@ KeyboardEvent.prototype = Object.create(UIEvent.interface.prototype);

module.exports = {
const iface = {
mixedInto: [],

@@ -269,4 +269,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../events/KeyboardEvent-impl.js");

@@ -27,3 +27,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -84,4 +84,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/LinkStyle-impl.js");

@@ -68,3 +68,3 @@ "use strict";

}
return this.href;
return this[impl].href;;
};

@@ -165,3 +165,3 @@

module.exports = {
const iface = {
mixedInto: [],

@@ -227,4 +227,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../window/Location-impl.js");

@@ -23,3 +23,3 @@ "use strict";

module.exports.setup(this, args);
iface.setup(this, args);
}

@@ -104,3 +104,3 @@ MessageEvent.prototype = Object.create(Event.interface.prototype);

module.exports = {
const iface = {
mixedInto: [],

@@ -164,4 +164,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../events/MessageEvent-impl.js");

@@ -23,3 +23,3 @@ "use strict";

module.exports.setup(this, args);
iface.setup(this, args);
}

@@ -175,3 +175,3 @@ MouseEvent.prototype = Object.create(UIEvent.interface.prototype);

module.exports = {
const iface = {
mixedInto: [],

@@ -234,4 +234,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../events/MouseEvent-impl.js");

@@ -38,3 +38,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -95,4 +95,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../navigator/Navigator-impl.js");

@@ -27,3 +27,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -84,4 +84,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../navigator/NavigatorConcurrentHardware-impl.js");

@@ -27,3 +27,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -84,4 +84,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../navigator/NavigatorCookies-impl.js");

@@ -91,3 +91,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -148,4 +148,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../navigator/NavigatorID-impl.js");

@@ -35,3 +35,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -92,4 +92,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../navigator/NavigatorLanguage-impl.js");

@@ -27,3 +27,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -84,4 +84,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../navigator/NavigatorOnLine-impl.js");

@@ -30,3 +30,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -87,4 +87,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../navigator/NavigatorPlugins-impl.js");

@@ -452,3 +452,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -511,4 +511,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/Node-impl.js");

@@ -35,3 +35,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -92,4 +92,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/NonDocumentTypeChildNode-impl.js");

@@ -34,3 +34,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -91,4 +91,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/NonElementParentNode-impl.js");

@@ -81,3 +81,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -138,4 +138,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/ParentNode-impl.js");

@@ -23,3 +23,3 @@ "use strict";

module.exports.setup(this, args);
iface.setup(this, args);
}

@@ -45,3 +45,3 @@ PopStateEvent.prototype = Object.create(Event.interface.prototype);

module.exports = {
const iface = {
mixedInto: [],

@@ -105,4 +105,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../events/PopStateEvent-impl.js");

@@ -30,3 +30,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -89,4 +89,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/ProcessingInstruction-impl.js");

@@ -23,3 +23,3 @@ "use strict";

module.exports.setup(this, args);
iface.setup(this, args);
}

@@ -61,3 +61,3 @@ ProgressEvent.prototype = Object.create(Event.interface.prototype);

module.exports = {
const iface = {
mixedInto: [],

@@ -122,4 +122,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../events/ProgressEvent-impl.js");

@@ -19,3 +19,3 @@ "use strict";

module.exports.setup(this, args);
iface.setup(this, args);
}

@@ -56,3 +56,3 @@ Text.prototype = Object.create(CharacterData.interface.prototype);

module.exports = {
const iface = {
mixedInto: [],

@@ -115,4 +115,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/Text-impl.js");

@@ -78,3 +78,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -137,4 +137,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../events/TouchEvent-impl.js");

@@ -131,3 +131,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -188,4 +188,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../traversal/TreeWalker-impl.js");

@@ -23,3 +23,3 @@ "use strict";

module.exports.setup(this, args);
iface.setup(this, args);
}

@@ -75,3 +75,3 @@ UIEvent.prototype = Object.create(Event.interface.prototype);

module.exports = {
const iface = {
mixedInto: [],

@@ -134,4 +134,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../events/UIEvent-impl.js");

@@ -35,2 +35,5 @@ "use strict";

const iterInternalSymbol = Symbol("internal");
const IteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));
module.exports.wrapperSymbol = wrapperSymbol;

@@ -42,1 +45,3 @@ module.exports.implSymbol = implSymbol;

module.exports.tryImplForWrapper = tryImplForWrapper;
module.exports.iterInternalSymbol = iterInternalSymbol;
module.exports.IteratorPrototype = IteratorPrototype;

@@ -184,3 +184,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -241,4 +241,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/WindowEventHandlers-impl.js");

@@ -22,3 +22,3 @@ "use strict";

module.exports = {
const iface = {
mixedInto: [],

@@ -81,4 +81,4 @@ is(obj) {

};
module.exports = iface;
const Impl = require("../nodes/XMLDocument-impl.js");

@@ -36,2 +36,6 @@ "use strict";

exports.Blob = require("./generated/Blob").interface;
exports.File = require("./generated/File").interface;
exports.FileList = require("./generated/FileList").interface;
exports.DOMParser = require("./generated/DOMParser").interface;

@@ -52,5 +56,2 @@

require("./node-list")(exports);
exports.Blob = require("./blob");
exports.File = require("./file");
require("./filelist")(exports);
require("./xmlhttprequest-event-target")(exports);

@@ -57,0 +58,0 @@ require("./xmlhttprequest-upload")(exports);

@@ -31,3 +31,3 @@ "use strict";

get vendor() {
return "Google Inc.";
return "Apple Computer, Inc.";
}

@@ -34,0 +34,0 @@

@@ -44,5 +44,33 @@ "use strict";

}
// TODO reimplement this in webidl2js so these become more per-spec
* keys() {
updateNodeList(this);
const length = this[privates].length;
for (let i = 0; i < length; ++i) {
yield i;
}
}
* entries() {
updateNodeList(this);
const length = this[privates].length;
for (let i = 0; i < length; ++i) {
yield [i, this[i]];
}
}
forEach(callback) {
const thisArg = arguments[1]; // TODO Node v6: use default arguments
let values = Array.from(this);
let i = 0;
while (i < values.length) {
callback.call(thisArg, values[i], i, this);
values = Array.from(this);
++i;
}
}
}
NodeList.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator];
NodeList.prototype[Symbol.iterator] = NodeList.prototype.values = Array.prototype[Symbol.iterator];

@@ -49,0 +77,0 @@ function updateNodeList(nodeList) {

@@ -416,12 +416,29 @@ "use strict";

getClientRects() {
return [{
bottom: 0,
height: 0,
left: 0,
right: 0,
top: 0,
width: 0
}];
return [];
}
get scrollWidth() {
return 0;
}
get scrollHeight() {
return 0;
}
get clientTop() {
return 0;
}
get clientLeft() {
return 0;
}
get clientWidth() {
return 0;
}
get clientHeight() {
return 0;
}
// https://w3c.github.io/DOM-Parsing/#dom-element-insertadjacenthtml

@@ -428,0 +445,0 @@ insertAdjacentHTML(position, text) {

@@ -7,2 +7,3 @@ "use strict";

const Event = require("../generated/Event");
const FileList = require("../generated/FileList");
const DOMException = require("../../web-idl/DOMException");

@@ -204,3 +205,3 @@ const internalConstants = require("../helpers/internal-constants");

if (this.type === "file") {
this[filesSymbol] = this[filesSymbol] || new this._core.FileList();
this[filesSymbol] = this[filesSymbol] || FileList.create();
} else {

@@ -207,0 +208,0 @@ this[filesSymbol] = null;

@@ -75,2 +75,3 @@ "use strict";

get value() {
// TODO fallback is wrong
return this.hasAttribute("value") ? this.getAttribute("value") : this.innerHTML;

@@ -77,0 +78,0 @@ }

@@ -9,5 +9,4 @@ "use strict";

const normalizeToCRLF = require("../helpers/form-controls").normalizeToCRLF;
const File = require("../file");
const blobSymbols = require("../blob-symbols");
const fileSymbols = require("../file-symbols");
const Blob = require("../generated/Blob.js");
const File = require("../generated/File.js");
const conversions = require("webidl-conversions");

@@ -30,3 +29,3 @@

// Handling this manually for now: https://github.com/jsdom/webidl2js/issues/29
if (!isBlob(value)) {
if (!Blob.isImpl(value)) {
value = conversions.USVString(value);

@@ -58,3 +57,3 @@ }

// Handling this manually for now: https://github.com/jsdom/webidl2js/issues/29
if (!isBlob(value)) {
if (!Blob.isImpl(value)) {
value = conversions.USVString(value);

@@ -80,12 +79,24 @@ }

if (isBlob(value) && !isFile(value)) {
const oldType = value[blobSymbols.type];
value = new File([value], "blob");
value[blobSymbols.type] = oldType;
if (Blob.isImpl(value) && !File.isImpl(value)) {
const oldValue = value;
value = File.createImpl([
[],
"blob",
{ type: oldValue.type }
]);
// "representing the same bytes"
value._buffer = oldValue._buffer;
}
if (isFile(value) && filename !== undefined) {
const oldType = value[blobSymbols.type];
value = new File([value], filename);
value[blobSymbols.type] = oldType;
if (File.isImpl(value) && filename !== undefined) {
const oldValue = value;
value = File.createImpl([
[],
filename,
// spec makes no mention of `lastModified`; assume it is inherited
// (Chrome's behavior)
{ type: oldValue.type, lastModified: oldValue.lastModified }
]);
// "representing the same bytes"
value._buffer = oldValue._buffer;
}

@@ -179,9 +190,1 @@

}
function isBlob(obj) {
return obj !== null && typeof obj === "object" && blobSymbols.buffer in obj;
}
function isFile(obj) {
return obj !== null && typeof obj === "object" && fileSymbols.name in obj;
}

@@ -13,3 +13,2 @@ "use strict";

const xhrSymbols = require("./xmlhttprequest-symbols");
const blobSymbols = require("./blob-symbols");
const addConstants = require("../utils").addConstants;

@@ -19,2 +18,3 @@ const documentBaseURLSerialized = require("./helpers/document-base-url").documentBaseURLSerialized;

const Document = require("./generated/Document");
const Blob = require("./generated/Blob");
const domToHtml = require("../browser/domtohtml").domToHtml;

@@ -97,3 +97,2 @@

const ProgressEvent = window.ProgressEvent;
const Blob = window.Blob;
const FormData = window.FormData;

@@ -210,3 +209,6 @@ const XMLHttpRequestEventTarget = window.XMLHttpRequestEventTarget;

}
res = new Blob([(new Uint8Array(properties.responseBuffer)).buffer]);
const contentType = getContentType(this);
res = Blob.create([[new Uint8Array(properties.responseBuffer)], {
type: contentType && contentType.toString() || ""
}]);
break;

@@ -362,21 +364,40 @@ }

const properties = this[xhrSymbols.properties];
if (properties.beforeSend) {
throw new DOMException(DOMException.INVALID_STATE_ERR);
}
// Terminate the request
clearTimeout(properties.timeoutId);
properties.timeoutFn = null;
properties.timeoutStart = 0;
const client = properties.client;
if (client) {
client.abort();
properties.client = null;
}
if (!(this.readyState === XMLHttpRequest.UNSENT ||
(this.readyState === XMLHttpRequest.OPENED && !properties.send) ||
this.readyState === XMLHttpRequest.DONE)) {
if ((this.readyState === XMLHttpRequest.OPENED && properties.send) ||
this.readyState === XMLHttpRequest.HEADERS_RECEIVED ||
this.readyState === XMLHttpRequest.LOADING) {
// Run the request error steps for event abort
properties.readyState = XMLHttpRequest.DONE;
properties.send = false;
readyStateChange(this, XMLHttpRequest.DONE);
properties.status = 0;
properties.statusText = "";
properties.responseCache = properties.responseTextCache = properties.responseXMLCache = null;
if (flag.synchronous) {
throw new DOMException(DOMException.ABORT_ERR);
}
this.dispatchEvent(new Event("readystatechange"));
// TODO: spec says this should only be checking upload complete flag?
if (!(flag.method === "HEAD" || flag.method === "GET")) {
this.upload.dispatchEvent(new ProgressEvent("progress"));
properties.uploadComplete = true;
// TODO upload listener
this.upload.dispatchEvent(new ProgressEvent("abort"));
if (properties.abortError) {
// TODO document what this is about (here and below)
this.upload.dispatchEvent(new ProgressEvent("error"));

@@ -386,3 +407,3 @@ }

}
this.dispatchEvent(new ProgressEvent("progress"));
this.dispatchEvent(new ProgressEvent("abort"));

@@ -394,3 +415,10 @@ if (properties.abortError) {

}
properties.readyState = XMLHttpRequest.UNSENT;
if (this.readyState === XMLHttpRequest.DONE) {
properties.readyState = XMLHttpRequest.UNSENT;
properties.status = 0;
properties.statusText = "";
properties.responseCache = properties.responseTextCache = properties.responseXMLCache = null;
}
}

@@ -530,7 +558,7 @@ getAllResponseHeaders() {

let val;
if (entry.value instanceof Blob) {
if (Blob.isImpl(entry.value)) {
const blob = entry.value;
val = {
name: entry.name,
value: blob[blobSymbols.buffer],
value: blob._buffer,
options: {

@@ -549,6 +577,7 @@ filename: blob.name,

// TODO content type; what is the form boundary?
} else if (body instanceof Blob) {
flag.body = body[blobSymbols.buffer];
if (body[blobSymbols.type] !== "") {
contentType = body[blobSymbols.type];
} else if (Blob.is(body)) {
const blob = idlUtils.implForWrapper(body);
flag.body = blob._buffer;
if (blob.type !== "") {
contentType = blob.type;
}

@@ -649,4 +678,4 @@ } else if (body instanceof ArrayBuffer) {

}
this.dispatchEvent(new ProgressEvent("progress", progressObj));
readyStateChange(this, XMLHttpRequest.DONE);
this.dispatchEvent(new ProgressEvent("progress", progressObj));
this.dispatchEvent(new ProgressEvent("load", progressObj));

@@ -677,3 +706,3 @@ this.dispatchEvent(new ProgressEvent("loadend", progressObj));

properties.error = "Redirect after preflight forbidden";
dispatchError(this, false);
dispatchError(this);
client.abort();

@@ -701,3 +730,3 @@ return;

properties.error = "Userinfo forbidden in cors redirect";
dispatchError(this, false);
dispatchError(this);
return;

@@ -724,9 +753,14 @@ }

properties.send = false;
readyStateChange(this, XMLHttpRequest.DONE);
let stateChanged = false;
if (!(flag.method === "HEAD" || flag.method === "GET")) {
this.upload.dispatchEvent(new ProgressEvent("progress"));
readyStateChange(this, XMLHttpRequest.DONE);
this.upload.dispatchEvent(new ProgressEvent("timeout"));
this.upload.dispatchEvent(new ProgressEvent("loadend"));
stateChanged = true;
}
this.dispatchEvent(new ProgressEvent("progress"));
if (!stateChanged) {
readyStateChange(this, XMLHttpRequest.DONE);
}
this.dispatchEvent(new ProgressEvent("timeout"));

@@ -800,8 +834,11 @@ this.dispatchEvent(new ProgressEvent("loadend"));

function readyStateChange(xhr, readyState) {
if (xhr.readyState !== readyState) {
const readyStateChangeEvent = new Event("readystatechange");
const properties = xhr[xhrSymbols.properties];
properties.readyState = readyState;
xhr.dispatchEvent(readyStateChangeEvent);
const properties = xhr[xhrSymbols.properties];
if (properties.readyState === readyState) {
return;
}
properties.readyState = readyState;
const readyStateChangeEvent = new Event("readystatechange");
xhr.dispatchEvent(readyStateChangeEvent);
}

@@ -817,3 +854,3 @@

properties.error = "Redirect after preflight forbidden";
dispatchError(this, false);
dispatchError(this);
return;

@@ -880,2 +917,3 @@ }

const progressObj = { lengthComputable: false };
let lastProgressReported;
if (bufferLength !== 0) {

@@ -891,2 +929,5 @@ progressObj.total = bufferLength;

readyStateChange(xhr, XMLHttpRequest.HEADERS_RECEIVED);
// Can't use the client since the client gets the post-ungzipping bytes (which can be greater than the
// Content-Length).
response.on("data", chunk => {

@@ -896,2 +937,3 @@ byteOffset += chunk.length;

});
properties.client.on("data", chunk => {

@@ -902,5 +944,15 @@ properties.responseBuffer = Buffer.concat([properties.responseBuffer, chunk]);

properties.responseXMLCache = null;
readyStateChange(xhr, XMLHttpRequest.LOADING);
if (properties.readyState === XMLHttpRequest.HEADERS_RECEIVED) {
properties.readyState = XMLHttpRequest.LOADING;
}
xhr.dispatchEvent(new Event("readystatechange"));
if (progressObj.total !== progressObj.loaded || properties.responseBuffer.length === byteOffset) {
xhr.dispatchEvent(new ProgressEvent("progress", progressObj));
if (lastProgressReported !== progressObj.loaded) {
// This is a necessary check in the gzip case where we can be getting new data from the client, as it
// un-gzips, but no new data has been gotten from the response, so we should not fire a progress event.
lastProgressReported = progressObj.loaded;
xhr.dispatchEvent(new ProgressEvent("progress", progressObj));
}
}

@@ -913,4 +965,4 @@ });

properties.client = null;
xhr.dispatchEvent(new ProgressEvent("progress", progressObj));
readyStateChange(xhr, XMLHttpRequest.DONE);
xhr.dispatchEvent(new ProgressEvent("progress", progressObj));
xhr.dispatchEvent(new ProgressEvent("load", progressObj));

@@ -955,13 +1007,9 @@ xhr.dispatchEvent(new ProgressEvent("loadend", progressObj));

function dispatchError(xhr, progress) {
function dispatchError(xhr) {
const properties = xhr[xhrSymbols.properties];
readyStateChange(xhr, XMLHttpRequest.DONE);
if (!properties.uploadComplete) {
xhr.upload.dispatchEvent(new ProgressEvent("progress"));
xhr.upload.dispatchEvent(new ProgressEvent("error"));
xhr.upload.dispatchEvent(new ProgressEvent("loadend"));
}
if (progress !== false) {
xhr.dispatchEvent(new ProgressEvent("progress"));
}
xhr.dispatchEvent(new ProgressEvent("error"));

@@ -982,3 +1030,3 @@ xhr.dispatchEvent(new ProgressEvent("loadend"));

properties.error = "Cross origin " + origin + " forbidden";
dispatchError(xhr, false);
dispatchError(xhr);
return false;

@@ -990,3 +1038,3 @@ }

properties.error = "Credentials forbidden";
dispatchError(xhr, false);
dispatchError(xhr);
return false;

@@ -1002,3 +1050,3 @@ }

properties.error = "Headers " + forbiddenHeaders + " forbidden";
dispatchError(xhr, false);
dispatchError(xhr);
return false;

@@ -1005,0 +1053,0 @@ }

@@ -215,3 +215,3 @@ "use strict";

const base64Regexp = /^(?:[A-Z0-9+\/]{4})*(?:[A-Z0-9+\/]{2}==|[A-Z0-9+\/]{3}=|[A-Z0-9+\/]{4})$/i;
const base64Regexp = /^(?:[A-Z0-9+/]{4})*(?:[A-Z0-9+/]{2}==|[A-Z0-9+/]{3}=|[A-Z0-9+/]{4})$/i;

@@ -218,0 +218,0 @@ exports.parseDataUrl = function parseDataUrl(url) {

@@ -63,3 +63,2 @@ "use strict";

const ast = acorn.parse(code, {
ecmaVersion: 6,
allowReturnOutsideFunction: true,

@@ -66,0 +65,0 @@ ranges: true,

{
"name": "jsdom",
"version": "9.9.1",
"version": "9.10.0",
"description": "A JavaScript implementation of the DOM and HTML standards",

@@ -20,50 +20,49 @@ "keywords": [

"dependencies": {
"abab": "^1.0.0",
"acorn": "^2.4.0",
"acorn-globals": "^1.0.4",
"abab": "^1.0.3",
"acorn": "^4.0.4",
"acorn-globals": "^3.1.0",
"array-equal": "^1.0.0",
"content-type-parser": "^1.0.1",
"cssom": ">= 0.3.0 < 0.4.0",
"cssstyle": ">= 0.2.36 < 0.3.0",
"cssom": ">= 0.3.2 < 0.4.0",
"cssstyle": ">= 0.2.37 < 0.3.0",
"escodegen": "^1.6.1",
"html-encoding-sniffer": "^1.0.1",
"iconv-lite": "^0.4.13",
"nwmatcher": ">= 1.3.9 < 2.0.0",
"parse5": "^1.5.1",
"request": "^2.55.0",
"sax": "^1.1.4",
"symbol-tree": ">= 3.1.0 < 4.0.0",
"tough-cookie": "^2.3.1",
"request": "^2.79.0",
"sax": "^1.2.1",
"symbol-tree": "^3.2.1",
"tough-cookie": "^2.3.2",
"webidl-conversions": "^3.0.1",
"whatwg-encoding": "^1.0.1",
"whatwg-url": "^4.1.0",
"xml-name-validator": ">= 2.0.1 < 3.0.0"
"whatwg-url": "^4.3.0",
"xml-name-validator": "^2.0.1"
},
"devDependencies": {
"benchmark": "1.0.0",
"browserify": "^13.0.0",
"browserify": "^14.0.0",
"chai": "^3.5.0",
"colors": "^1.0.3",
"eslint": "^2.10.1",
"eslint-plugin-html": "^1.0.4",
"colors": "^1.1.2",
"eslint": "^3.14.1",
"eslint-plugin-html": "^2.0.0",
"fs-readdir-recursive": "^1.0.0",
"http-server": "^0.8.0",
"jscs": "^2.5.0",
"karma": "^0.13.19",
"karma-browserify": "^5.0.1",
"karma-chrome-launcher": "^0.2.2",
"karma-mocha": "^0.2.1",
"karma-mocha-webworker": "^1.1.1",
"karma-sauce-launcher": "^0.3.0",
"mocha": "^2.4.5",
"mocha-sugar-free": ">=1.3.0 < 2.0.0",
"nodeunit": "0.9.1",
"http-server": "^0.9.0",
"karma": "^1.4.1",
"karma-browserify": "^5.1.1",
"karma-chrome-launcher": "^2.0.0",
"karma-mocha": "^1.3.0",
"karma-mocha-webworker": "^1.3.0",
"karma-sauce-launcher": "^1.1.0",
"mocha": "^3.2.0",
"mocha-sugar-free": "^1.3.1",
"nodeunit": "0.10.2",
"optimist": "0.6.1",
"portfinder": "0.4.0",
"q": "^1.2.0",
"selenium-standalone": "^4.6.1",
"st": "^0.5.5",
"watchify": "^3.7.0",
"wd": "0.3.12",
"webidl2js": "^5.0.0"
"portfinder": "^1.0.12",
"q": "^1.4.1",
"selenium-standalone": "^6.0.0",
"server-destroy": "^1.0.1",
"st": "^1.2.0",
"watchify": "^3.9.0",
"wd": "^1.1.3",
"webidl2js": "^5.1.0"
},

@@ -70,0 +69,0 @@ "browser": {

@@ -128,3 +128,3 @@ # jsdom

- `config.cookieJar`: cookie jar which will be used by document and related resource requests. Can be created by `jsdom.createCookieJar()` method. Useful to share cookie state among different documents as browsers does.
- `config.parsingMode`: either `"auto"`, `"html"`, or `"xml"`. The default is `"auto"`, which uses HTML behavior unless `config.url` responds with an XML `Content-Type`, or `config.file` contains a filename ending in `.xml` or `.xhtml`. Setting to `"xml"` will attempt to parse the document as an XHTML document. (jsdom is [currently only OK at doing that](https://github.com/tmpvar/jsdom/issues/885).)
- `config.parsingMode`: either `"auto"`, `"html"`, or `"xml"`. The default is `"auto"`, which uses HTML behavior unless `config.url` responds with an XML `Content-Type`, or `config.file` contains a filename ending in `.xml` or `.xhtml`. Setting to `"xml"` will attempt to parse the document as an XHTML document. (jsdom is [currently only OK at doing that](https://github.com/tmpvar/jsdom/labels/x%28ht%29ml).)
- `config.referrer`: the new document will have this referrer.

@@ -181,3 +181,3 @@ - `config.cookie`: manually set a cookie value, e.g. `'key=value; expires=Wed, Sep 21 2011 12:00:00 GMT; path=/'`. Accepts cookie string or array of cookie strings.

```js
// On the Node.js/io.js side:
// On the Node.js side:
var window = jsdom.jsdom(...).defaultView;

@@ -431,3 +431,3 @@ window.onModulesLoaded = function () {

// anotherScript.js will have the ability to read `window.__myObject`, even
// though it originated in Node.js/io.js!
// though it originated in Node.js!
```

@@ -472,3 +472,3 @@

#### Forward a window's console output to the Node.js/io.js console
#### Forward a window's console output to the Node.js console

@@ -578,3 +578,3 @@ ```js

Another important benefit jsdom has for testing is a bit more complicated: it is easy to suffer race conditions using an external process like PhantomJS (or Selenium). For example if you create a script to test something using PhantomJS, that script will live in a different process than the web application. If you perform multiple steps in your test that are dependent on each other (for example, step 1: find the element; step 2: click on the element), the application might change the DOM during those steps (step 2.5: the page's JavaScript removes the element). This is not an issue in jsdom, since your tests live in exactly the same thread and event loop as the web application, so if your test is executing JavaScript code, the web application cannot run its code until your test releases control of the event loop.
Another important benefit jsdom has for testing is a bit more complicated: it is easy to suffer race conditions using an external process like PhantomJS (or Selenium). For example if you create a script to test something using PhantomJS, that script will live in a different process than the web application. If you perform multiple steps in your test that are dependent on each other (for example, step 1: find the element; step 2: click on the element), the application might change the DOM during those steps (step 1.5: the page's JavaScript removes the element). This is not an issue in jsdom, since your tests live in exactly the same thread and event loop as the web application, so if your test is executing JavaScript code, the web application cannot run its code until your test releases control of the event loop.

@@ -581,0 +581,0 @@ In general the same reasons that make jsdom pleasant for testing also make it pleasant for web scraping. In both cases, the extra power of a full browser is not as important as getting things done easily and quickly.

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc