Make the search by ID in Inspector work even for nodes with no "id" property
(eg xml:id, MathML, etc). Bug 324752, patch by Alex Vincent <ajvincent@gmail.com>, r+sr=bzbarsky git-svn-id: svn://10.0.0.236/trunk@188436 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
5ac8e11bc9
commit
7c95cfd5c2
@ -540,9 +540,21 @@ DOMViewer.prototype =
|
||||
{
|
||||
var re = new RegExp(this.mFindParams[0], "i");
|
||||
|
||||
return aWalker.currentNode
|
||||
&& "id" in aWalker.currentNode
|
||||
&& re.test(aWalker.currentNode.id);
|
||||
var node = aWalker.currentNode;
|
||||
if (!node)
|
||||
return false;
|
||||
|
||||
if (node.nodeType != Components.interfaces.nsIDOMNode.ELEMENT_NODE)
|
||||
return false;
|
||||
|
||||
for (var i = 0; i < node.attributes.length; i++) {
|
||||
var attr = node.attributes[i];
|
||||
if (attr.isId && re.test(attr.nodeValue)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
doFindElementsByTagName: function(aWalker)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user