зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1021023 - Fix 'document is null' error in CssLogic_findCssSelector when inspecting <window> in XUL document. r=pbrosset
This commit is contained in:
Родитель
1bb9dabc3f
Коммит
e9e0f4a7f4
|
@ -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;
|
||||
selector = CssLogic_findCssSelector(ele.parentNode) + ' > ' +
|
||||
tagName + ':nth-child(' + index + ')';
|
||||
}
|
||||
|
||||
return selector;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче