From df8969f1c45c41ad138ea046114fc4b8d500f1d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 3 Jul 2016 13:39:05 +0200 Subject: [PATCH] Switch to jsdom v9.4.0 with native DOMParser support. Closes #1093 --- package.json | 2 +- src/node/window.js | 19 ------------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/package.json b/package.json index 3be0b94c..13c11907 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "node": ">=4.0.0 <7.0.0" }, "dependencies": { - "jsdom": "^8.3.0", + "jsdom": "^9.4.0", "source-map-support": "^0.4.0" }, "optionalDependencies": { diff --git a/src/node/window.js b/src/node/window.js index 4d66ef84..598526c6 100644 --- a/src/node/window.js +++ b/src/node/window.js @@ -52,25 +52,6 @@ XMLSerializer.prototype.serializeToString = function(node) { return text; }; -function DOMParser() { -} - -DOMParser.prototype.parseFromString = function(string, contentType) { - // Create a new document, since we're supposed to always return one. - var doc = document.implementation.createHTMLDocument(''), - body = doc.body, - last; - // Set the body's HTML, then change the DOM according the specs. - body.innerHTML = string; - // Remove all top-level children () - while (last = doc.lastChild) - doc.removeChild(last); - // Insert the first child of the body at the top. - doc.appendChild(body.firstChild); - return doc; -}; - window.XMLSerializer = XMLSerializer; -window.DOMParser = DOMParser; module.exports = window;