Open Bug 732593 Opened 13 years ago Updated 3 years ago

mTabProgressListener onStateChange error if iframe onload moves the iframe

Categories

(Firefox :: Tabbed Browser, defect)

defect

Tracking

()

Tracking Status
firefox-esr52 --- wontfix
firefox56 --- wontfix
firefox57 --- wontfix
firefox58 --- wontfix
firefox59 --- ?

People

(Reporter: jruderman, Unassigned)

References

Details

(Keywords: testcase)

Attachments

(1 file)

Attached file testcase
Loading the testcase triggers: JavaScript error: , line 0: uncaught exception: [Exception... "Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsIWebProgress.DOMWindow]" nsresult: "0x80004002 (NS_NOINTERFACE)" location: "JS frame :: chrome://browser/content/tabbrowser.xml :: <TOP_LEVEL> :: line 545" data: no] Seems to be this line: http://hg.mozilla.org/mozilla-central/annotate/343ec916dfd5/browser/base/content/tabbrowser.xml#l549
OS: Mac OS X → All
Hardware: x86_64 → All
http://mxr.mozilla.org/comm-central/search?string=.DOMWindow&case=on&filter=DOMWindow\b Hardly anywhere do we expect DOMWindow to throw. Can it return null instead? Alternatively, can nsIWebProgress get a flag for whether it relates to a top-level window?
I have encountered the same problem today. I was directly doing something in a function that called from onload() of an iframe. In an iframe: window.onload=function() { parent.aFunctionOnParent(); } In parent: function aFunctionOnParent() { codes... } Then I have used setTimeOut and then worked without exception. These changes fixed my problem: function aFunctionOnParent() { setTimeOut(){ function() { codes... }, 1} }
Still happens on trunk. http://hg.mozilla.org/mozilla-central/rev/a8a547fb44a8 changed the error message to: JavaScript error: chrome://browser/content/tabbrowser.xml, line 562: NS_NOINTERFACE: Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsIWebProgress.isTopLevel]
(In reply to Dão Gottwald [:dao] from comment #1) > Hardly anywhere do we expect DOMWindow to throw. Can it return null instead? I guess this would be relatively simple to implement. But I wonder whether it would instead be better to suppress firing web progress notifications in the cases where it would return null.
Bug 866748 filed for the case that is affecting tabbrowser. I guess we can maybe morph this into the more general case of "what should the nsIWebProgressListener behavior be" in this situation?
Has Regression Range: --- → no
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: