Bug 891357 - iframes don't appear in breadcrumbs. r=robcee

This commit is contained in:
Dave Camp 2013-07-23 14:42:12 -07:00
parent f8b884172b
commit eb8f7614d5
2 changed files with 29 additions and 6 deletions

View File

@ -484,11 +484,13 @@ HTMLBreadcrumbs.prototype = {
if (originalLength > 0) {
stopNode = this.nodeHierarchy[originalLength - 1].node;
}
while (toAppend && toAppend.tagName && toAppend != stopNode) {
let button = this.buildButton(toAppend);
fragment.insertBefore(button, lastButtonInserted);
lastButtonInserted = button;
this.nodeHierarchy.splice(originalLength, 0, {node: toAppend, button: button});
while (toAppend && toAppend != stopNode) {
if (toAppend.tagName) {
let button = this.buildButton(toAppend);
fragment.insertBefore(button, lastButtonInserted);
lastButtonInserted = button;
this.nodeHierarchy.splice(originalLength, 0, {node: toAppend, button: button});
}
toAppend = toAppend.parentNode();
}
this.container.appendChild(fragment, this.container.firstChild);

View File

@ -74,7 +74,28 @@ function performTestComparisons2()
is(i.selection.node, div2, "selection matches div2 node");
is(getHighlitNode(), div2, "highlighter matches selection");
finish();
selectRoot();
}
function selectRoot()
{
// Select the root document element to clear the breadcrumbs.
let i = getActiveInspector();
i.selection.setNode(doc.documentElement);
i.once("inspector-updated", selectIframe);
}
function selectIframe()
{
// Directly select an element in an iframe (without navigating to it
// with mousemoves).
let i = getActiveInspector();
i.selection.setNode(div2);
i.once("inspector-updated", () => {
let breadcrumbs = i.breadcrumbs;
is(breadcrumbs.nodeHierarchy.length, 9, "Should have 9 items");
finish();
});
}
function test() {