Warning ``reference to undefined property this.childNodes[i]'' [xs] in file ``chrome://global/content/bindings/tabbrowser.xml'', line 644, character 0.

RESOLVED FIXED

Status

--
trivial
RESOLVED FIXED
15 years ago
10 years ago

People

(Reporter: timeless, Assigned: neil)

Tracking

Trunk
x86
Windows XP

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

15 years ago
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031208

Warning ``reference to undefined property this.childNodes[i]'' [xs] in file
``chrome://global/content/bindings/tabbrowser.xml'', line 644, character 0.
Stopped for error handler.
#0: function onLinkAdded(event=Event:{0}) in
<chrome://global/content/bindings/tabbrowser.xml> line 644
642: }
643:
644: notifyListeners = (this.childNodes[i] == tabBrowser.mCurrentBrowser);
645: }
646: else if
(!contentPolicy.shouldLoad(Components.interfaces.nsIContentPolicy.IMAGE,

Sorry, my browser crashed since this, so I really can't give more info :)

Anyway, here's a short view of the code:
                              
632 for (i = 0; i < this.childNodes.length; i++) {                             
                      
642 }                                                                          
                      
644 notifyListeners = (this.childNodes[i] == tabBrowser.mCurrentBrowser);   

If you ignore the body of the for loop, then it's possible to have an ABR error,
which is what I got.
(Reporter)

Comment 1

15 years ago
Created attachment 137396 [details] [diff] [review]
only handle events for top level windows

i triggered this by using tools>translate page on a bugzilla patch. at the same
time i went off and made a new tab.

the translation service is google. the patch came from bugzilla which has a
favicon.

anyway, the core of the problem is that we don't check that the target is a
toplevel window.

this should solve that problem.
(Reporter)

Updated

15 years ago
Attachment #137396 - Flags: superreview?(bz-vacation)
Attachment #137396 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 137396 [details] [diff] [review]
only handle events for top level windows

Um... documents have a contentWindow property?
(Assignee)

Comment 3

15 years ago
Created attachment 137424 [details] [diff] [review]
Alternate approach

This changes the way notifyListeners is set to avoid the problem.
(Assignee)

Comment 4

15 years ago
Comment on attachment 137396 [details] [diff] [review]
only handle events for top level windows

contentWindow isn't a property of a document.
Attachment #137396 - Flags: review?(neil.parkwaycc.co.uk) → review-
(Assignee)

Updated

15 years ago
Attachment #137424 - Flags: review?(varga)
(Reporter)

Comment 5

15 years ago
http://www.mozilla.org/docs/dom/domref/dom_doc_ref.html#1006457

DOM Document Reference
The document Interface 

contentWindow*
	
Returns the window object for the containing window.

--
I'm relying on documentation online.

If it's wrong, please file a bug :). I filed bug 228494 ...
Assignee: timeless → neil.parkwaycc.co.uk
OK, the alternate patch looks good. 
You could have fixed the url.spec in the same time ;)
FYI contentWindow is defined in nsIDOMNSHTMLFrameElement.idl.
(Reporter)

Comment 7

15 years ago
Comment on attachment 137396 [details] [diff] [review]
only handle events for top level windows

ok bug 228532 Submitted
Attachment #137396 - Flags: superreview?(bz-vacation)

Comment 8

15 years ago
Comment on attachment 137424 [details] [diff] [review]
Alternate approach

r=varga
Attachment #137424 - Flags: review?(varga) → review+
(Assignee)

Comment 9

15 years ago
This got merged into the fix for bug 225854.
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
Product: Core → SeaMonkey
You need to log in before you can comment on or make changes to this bug.