Bug 857262 - Inspector DocumentWalker: Reparent walker to SVGDocument only if a node contains a document; not if it just implements getSVGDocument. r=miker

This commit is contained in:
Sami Jaktholm 2014-07-19 23:32:00 -04:00
parent 7383806f8a
commit 05c399936e
3 changed files with 13 additions and 2 deletions

View File

@ -3012,7 +3012,7 @@ DocumentWalker.prototype = {
return null;
if (node.contentDocument) {
return this._reparentWalker(node.contentDocument);
} else if (node.getSVGDocument) {
} else if (node.getSVGDocument && node.getSVGDocument()) {
return this._reparentWalker(node.getSVGDocument());
}
return this.walker.firstChild();
@ -3024,7 +3024,7 @@ DocumentWalker.prototype = {
return null;
if (node.contentDocument) {
return this._reparentWalker(node.contentDocument);
} else if (node.getSVGDocument) {
} else if (node.getSVGDocument && node.getSVGDocument()) {
return this._reparentWalker(node.getSVGDocument());
}
return this.walker.lastChild();

View File

@ -51,5 +51,8 @@
<div id="longlist-sibling-firstchild"></div>
</div>
<p id="edit-html"></p>
<object>
<div id="1"></div>
</object>
</body>
</html>

View File

@ -214,6 +214,14 @@ addTest(function testLongListTraversal() {
}).then(runNextTest));
});
addTest(function testObjectNodeChildren() {
promiseDone(
gWalker.querySelector(gWalker.rootNode, "object")
.then(object => gWalker.children(object))
.then(nodeArrayChecker(true, true, "1"))
.then(runNextTest));
});
addTest(function testSiblings() {
promiseDone(gWalker.querySelector(gWalker.rootNode, "#a").then(a => {
return gWalker.siblings(a, { maxNodes: 5, center: a }).then(nodeArrayChecker(true, false, "abcde"));