зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
0cd2f844e4
Коммит
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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче