Bug 1021023 - Fix 'document is null' error in CssLogic_findCssSelector when inspecting <window> in XUL document. r=pbrosset

This commit is contained in:
Brian Grinstead 2014-06-05 08:40:00 -04:00
Родитель 1bb9dabc3f
Коммит e9e0f4a7f4
1 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -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;
};