mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1021023 - Fix 'document is null' error in CssLogic_findCssSelector when inspecting <window> in XUL document. r=pbrosset
This commit is contained in:
parent
58dd429b3d
commit
c065592bb5
@ -917,10 +917,13 @@ CssLogic.findCssSelector = function CssLogic_findCssSelector(ele) {
|
||||
}
|
||||
}
|
||||
|
||||
// So we can be unique w.r.t. our parent, and use recursion
|
||||
index = positionInNodeList(ele, ele.parentNode.children) + 1;
|
||||
selector = CssLogic_findCssSelector(ele.parentNode) + ' > ' +
|
||||
tagName + ':nth-child(' + index + ')';
|
||||
// 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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user