Bug 1021023 - Fix 'document is null' error in CssLogic_findCssSelector when inspecting <window> in XUL document. r=pbrosset
This commit is contained in:
@@ -917,10 +917,13 @@ CssLogic.findCssSelector = function CssLogic_findCssSelector(ele) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// So we can be unique w.r.t. our parent, and use recursion
|
// Not unique enough yet. As long as it's not a child of the document,
|
||||||
|
// continue recursing up until it is unique enough.
|
||||||
|
if (ele.parentNode !== document) {
|
||||||
index = positionInNodeList(ele, ele.parentNode.children) + 1;
|
index = positionInNodeList(ele, ele.parentNode.children) + 1;
|
||||||
selector = CssLogic_findCssSelector(ele.parentNode) + ' > ' +
|
selector = CssLogic_findCssSelector(ele.parentNode) + ' > ' +
|
||||||
tagName + ':nth-child(' + index + ')';
|
tagName + ':nth-child(' + index + ')';
|
||||||
|
}
|
||||||
|
|
||||||
return selector;
|
return selector;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user