Closed Bug 233202 Opened 21 years ago Closed 21 years ago

Find by attribute fails because walker walks non element_nodes which don't have getattribute

Categories

(Other Applications :: DOM Inspector, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 218210

People

(Reporter: timeless, Unassigned)

Details

Build is probably cvs trunk from this week Steps: 1. open domi 2. load http://devedge.netscape.com/library/manuals/2000/javascript/1.3/guide/frames.html 3. select /HTML/FRAMESET/FRAME[1][@src="dgtoc.html"][@name="toc"] #document /HTML/BODY/NOBR[8]/A[@href="ident.html"][@target="content"]/FONT 4. click the matching link (loads a new url in the right pane) 5. select /HTML/FRAMESET/FRAME[@src="whatsnew.html"][@name="content"] #document /HTML/BODY/DIV[2][@id="main"]/DIV[1][@id="content"]/UL[1]/LI[2]/A[@href="ident.html#1008330"] Next step should be: select /HTML/FRAMESET/FRAME[@src="whatsnew.html"][@name="content"] /HTML/BODY/DIV[2][@id="main"]/DIV[1][@id="content"]/A[68][@name="1012604"] But counting to 68 is "hard" So. instead of actually counting to 68 6. open the search dialog 7. select attr 8. enter 1012604 for the value 9. enter name for the attribute 10. click find expected results: select that node actual results: Error ``aWalker.currentNode.getAttribute is not a function'' [xs] in file ``chrome://inspector/content/viewers/dom/dom.js'', line 560, character 0. Stopped for error handler. #0: function anonymous(aWalker=XPComponent:{16}) in <chrome://inspector/content/viewers/dom/dom.js> line 560 558: && this.mFindParams[1] == "" 559: ? aWalker.currentNode.hasAttribute(this.mFindParams[0]) 560: : aWalker.currentNode.getAttribute(this.mFindParams[0]) == this.mFindParams[1]; 561: }, 562: 0001: walker.currentNode.nodeType == Node.ELEMENT_NODE $[0] = [boolean] false #0: function anonymous(aWalker=XPComponent:{16}) in <chrome://inspector/content/viewers/dom/dom.js> line 560 #1: function anonymous() in <chrome://inspector/content/viewers/dom/dom.js> line 518 #2: function anonymous(aType=string:"attr", aDir=string:"down") in <chrome://inspector/content/viewers/dom/dom.js> line 508 #3: function anonymous() in <chrome://inspector/content/viewers/dom/FindDialog.js> line 99 #4: function anonymous(event=Event:{0}) in <chrome://global/content/bindings/dialog.xml> line 282 #5: function _fireButtonEvent(aDlgType=string:"accept") in <chrome://global/content/bindings/dialog.xml> line 283 #6: function _reallyDoButtonCommand(aDlgType=string:"accept") in <chrome://global/content/bindings/dialog.xml> line 257 #7: function anonymous(aDlgType=string:"accept") in <chrome://global/content/bindings/dialog.xml> line 244 #mozilla analysis: <db48x-> timeless: what's the value of currentNode? > looks like HTMLDocument <db48x-> it's probably not supposed to match the document, just the stuff inside the document <peterv> well, aWalker.currentNode.nodeType == Node.ELEMENT_NODE shouldn't be true for HTMLDocument either :-) <db48x-> no, shouldn't <db48x-> might just need to specify that the walker should only visit ELEMENT_NODEs
Whiteboard: [good first bug]
Note bug 211074. DOM Inspector's inDeepTreeWalker is known to be a partial implementation.
I think this is a duplicate of bug 218210. There is also a description how this could be fixed.
good call, Jochen *** This bug has been marked as a duplicate of 218210 ***
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
Status: RESOLVED → VERIFIED
Product: Core → Other Applications
Assignee: dom-inspector → nobody
QA Contact: timeless → dom-inspector
Whiteboard: [good first bug]
You need to log in before you can comment on or make changes to this bug.