Closed
Bug 218210
Opened 21 years ago
Closed 21 years ago
find nodes does not work when searching for attribute
Categories
(Other Applications :: DOM Inspector, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: jochen.mader, Assigned: db48x)
References
()
Details
Attachments
(1 file, 1 obsolete file)
1.56 KB,
patch
|
timeless
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624
when using the "find nodes" dialog in DOM Inspector to find a node by attribute
name + value, the "Find" button appears to do nothing.
However, the JavaScript Console displays an error:
Error: aWalker.currentNode.getAttribute is not a function
Source File: chrome://inspector/content/viewers/dom/dom.js
Line: 560
B.T.W, already at DOM Inspector startup, the JavaScript Console displays:
Error: uncaught exception: [Exception... "Invalid ClassID or ContractID"
nsresult: "0x80570017 (NS_ERROR_XPC_BAD_CID)" location: "JS frame ::
chrome://inspector/content/jsutil/system/file.js :: <TOP_LEVEL> :: line 119"
data: no]
Reproducible: Always
Steps to Reproduce:
1. Open JavaScript Console
2. Open DOM Inspector
3. Load any URL
4. Open "Find Nodes" dialog (Search -> Find Nodes...)
5. Select Search by Attr
6. Enter some attribute name + value
7. Click "Find"
Actual Results:
Nothing visible in DOM Inspector, but JavaScript Console displays error.
Expected Results:
Show a matching node, or tell me there is no matching node.
Reporter | ||
Comment 1•21 years ago
|
||
Can be fixed by inserting a pair of ():
Change
doFindElementsByAttr: function(aWalker)
{
return aWalker.currentNode
&& aWalker.currentNode.nodeType == Node.ELEMENT_NODE
&& this.mFindParams[1] == ""
? aWalker.currentNode.hasAttribute(this.mFindParams[0])
: aWalker.currentNode.getAttribute(this.mFindParams[0]) ==
this.mFindParams[1];
},
to
doFindElementsByAttr: function(aWalker)
{
return aWalker.currentNode
&& aWalker.currentNode.nodeType == Node.ELEMENT_NODE
&& (this.mFindParams[1] == ""
? aWalker.currentNode.hasAttribute(this.mFindParams[0])
: aWalker.currentNode.getAttribute(this.mFindParams[0]) ==
this.mFindParams[1]);
},
in dom.js (inspector.jar).
However, I propose that either this function is changed to test for substring
instead of equality or (better) that the Find Nodes dialog is extended so that
one can optionally search for substrings - especially when searching for attributes.
Comment 2•21 years ago
|
||
Mass re-assigning bugs to dom.inspector@extensions.bugs
Assignee: caillon → dom.inspector
Assignee | ||
Comment 3•21 years ago
|
||
*** Bug 233202 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 4•21 years ago
|
||
needs (), just like Jochen said.
Assignee: dom-inspector → db48x
Status: UNCONFIRMED → ASSIGNED
Assignee | ||
Updated•21 years ago
|
Attachment #141182 -
Flags: review?(timeless)
Assignee | ||
Comment 5•21 years ago
|
||
Assignee | ||
Updated•21 years ago
|
Attachment #141182 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Attachment #141183 -
Flags: review?(timeless)
Assignee | ||
Updated•21 years ago
|
Attachment #141182 -
Flags: review?(timeless)
Attachment #141183 -
Flags: superreview?(bzbarsky)
Attachment #141183 -
Flags: review?(timeless)
Attachment #141183 -
Flags: review+
![]() |
||
Comment 6•21 years ago
|
||
Comment on attachment 141183 [details] [diff] [review]
fix, also make searches case insensitive and match against substrings
Please do not make id matches case-insensitive. In fact, don't make the other
matches case-insensitive either, for XML documents. Other than that,
sr=bzbarsky.
Attachment #141183 -
Flags: superreview?(bzbarsky) → superreview+
Assignee | ||
Comment 7•21 years ago
|
||
Do you mind if I ask why? This is a convenience feature, not something that has
to meet a w3c spec. Plus I think it'd be inconvenient to find out what kind of
document we're searching, and also rather inconvenient for it to be
case-sensitive sometimes but not others.
Assignee | ||
Comment 8•21 years ago
|
||
fix checked in
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Updated•20 years ago
|
Product: Core → Other Applications
Updated•18 years ago
|
QA Contact: timeless → dom-inspector
You need to log in
before you can comment on or make changes to this bug.
Description
•