Permalink
Browse files

Land: Fix: make sure that doctypes don't get set as the documentEleme…

…nt (aredridel)
  • Loading branch information...
2 parents 533cb2b + 5697dda commit 0f7f7073ad816bb792e24623cca4fd89ab2ef1a9 @tmpvar committed Jul 12, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/jsdom/level2/html.js
View
2 lib/jsdom/level2/html.js
@@ -252,7 +252,7 @@ function closest(e, tagName) {
function descendants(e, tagName, recursive) {
var owner = recursive ? e._ownerDocument || e : e;
return new core.HTMLCollection(owner, core.mapper(e, function(n) {
- return n.nodeName === tagName;
+ return n.nodeName === tagName && typeof n._publicId == 'undefined';
}, recursive));
}

0 comments on commit 0f7f707

Please sign in to comment.