Core: Update tested jsdom, drop obsolete workarounds

The latest version supporting Node.js is 3.1.2; some workarounds are not needed
for this version. For example, in jsdom 3.1.2 a document created via
document.implementation.createHTMLDocument( "" ) has a body.

Fixes gh-2153
Closes gh-2154
This commit is contained in:
Michał Gołębiowski
2015-03-20 16:28:10 +01:00
parent f5aa89af70
commit 06f6cd1ffd
3 changed files with 53 additions and 62 deletions

View File

@@ -4,14 +4,9 @@ define([
], function( document, support ) {
support.createHTMLDocument = (function() {
var doc = document.implementation.createHTMLDocument( "" );
// Support: Node with jsdom<=1.5.0+
// jsdom's document created via the above method doesn't contain the body
if ( !doc.body ) {
return false;
}
doc.body.innerHTML = "<form></form><form></form>";
return doc.body.childNodes.length === 2;
var body = document.implementation.createHTMLDocument( "" ).body;
body.innerHTML = "<form></form><form></form>";
return body.childNodes.length === 2;
})();
return support;