mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Bug 1360132 - Escaped tagName with cssEscape in findCssSelector to deal with special chars; r=pbro
MozReview-Commit-ID: CadEDXDYeBV --HG-- extra : rebase_source : 0f993ff164156e46271c2c249d801404c0396318
This commit is contained in:
parent
0cd2f844e4
commit
8a674f1ac1
@ -87,7 +87,7 @@ const findCssSelector = function(ele) {
|
||||
return selector;
|
||||
}
|
||||
// Maybe it's unique with a tag name?
|
||||
selector = tagName + selector;
|
||||
selector = cssEscape(tagName) + selector;
|
||||
matches = document.querySelectorAll(selector);
|
||||
if (matches.length === 1) {
|
||||
return selector;
|
||||
@ -107,7 +107,7 @@ const findCssSelector = function(ele) {
|
||||
if (ele.parentNode !== document) {
|
||||
index = positionInNodeList(ele, ele.parentNode.children) + 1;
|
||||
selector = findCssSelector(ele.parentNode) + " > " +
|
||||
tagName + ":nth-child(" + index + ")";
|
||||
cssEscape(tagName) + ":nth-child(" + index + ")";
|
||||
}
|
||||
|
||||
return selector;
|
||||
|
Loading…
Reference in New Issue
Block a user