Closed Bug 969156 Opened 12 years ago Closed 12 years ago

Don't fire onNewGlobalObject until the end of nsGlobalWindow::SetNewDocument

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: bholley, Assigned: bholley)

References

Details

Attachments

(1 file, 1 obsolete file)

See bug 964545 comment 19. I think I can whip up a quick patch for this.
Erik, does this solve your problem?
Attachment #8371961 - Flags: feedback?(evold)
Comment on attachment 8371961 [details] [diff] [review] Don't fire onNewGlobalObject until the end of nsGlobalWindow::SetNewDocument. v1 It seems to work \o/ https://tbpl.mozilla.org/?tree=Try&rev=7b2c43093824
Attachment #8371961 - Flags: feedback?(evold) → feedback+
Comment on attachment 8371961 [details] [diff] [review] Don't fire onNewGlobalObject until the end of nsGlobalWindow::SetNewDocument. v1 Great! Flagging Boris for review.
Attachment #8371961 - Flags: review?(bzbarsky)
Comment on attachment 8371961 [details] [diff] [review] Don't fire onNewGlobalObject until the end of nsGlobalWindow::SetNewDocument. v1 So what worries me is sending this notification after DispatchDOMWindowCreated. Wouldn't it be better to do it before people have had a chance to poke at the window? Do we need to enter the compartment of global before calling JS_FireOnNewGlobalObject?
(In reply to Boris Zbarsky [:bz] from comment #6) > So what worries me is sending this notification after > DispatchDOMWindowCreated. Wouldn't it be better to do it before people have > had a chance to poke at the window? Yeah, that's a good point. I'll fix that. > Do we need to enter the compartment of global before calling > JS_FireOnNewGlobalObject? We're already in the compartment of the outer (which is the compartment of the inner, at this point) a bit further up in the function.
Attachment #8371961 - Attachment is obsolete: true
Attachment #8371961 - Flags: review?(bzbarsky)
Attachment #8372767 - Flags: review?(bzbarsky)
Comment on attachment 8372767 [details] [diff] [review] Don't fire onNewGlobalObject until the end of nsGlobalWindow::SetNewDocument. v2 r=me
Attachment #8372767 - Flags: review?(bzbarsky) → review+
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
(In reply to Erik Vold [:erikvold] [:ztatic] from comment #4) > Comment on attachment 8371961 [details] [diff] [review] > Don't fire onNewGlobalObject until the end of > nsGlobalWindow::SetNewDocument. v1 > > It seems to work \o/ https://tbpl.mozilla.org/?tree=Try&rev=7b2c43093824 So v1 seemed to work, and v2 seems to not work. See the try mentioned here: https://bugzilla.mozilla.org/show_bug.cgi?id=964545#c21
Flags: needinfo?(bobbyholley)
(In reply to Erik Vold [:erikvold] [:ztatic] from comment #12) > So v1 seemed to work, and v2 seems to not work. Are you sure? I'd be quite surprised if the failure mode were the same. The problem before was that we were invoking onNewGlobalObject before the new inner window was hooked up to the outer. With this patch, that work has definitely happened. The difference between v1 and v2 is purely the difference between firing onNewGlobalObject before or after DomWindowCreated. > See the try mentioned here: > https://bugzilla.mozilla.org/show_bug.cgi?id=964545#c21 That try run appears green to me.
Flags: needinfo?(bobbyholley)
(In reply to Bobby Holley (:bholley) from comment #13) > (In reply to Erik Vold [:erikvold] [:ztatic] from comment #12) > > So v1 seemed to work, and v2 seems to not work. > > Are you sure? I'd be quite surprised if the failure mode were the same. The > problem before was that we were invoking onNewGlobalObject before the new > inner window was hooked up to the outer. With this patch, that work has > definitely happened. The difference between v1 and v2 is purely the > difference between firing onNewGlobalObject before or after DomWindowCreated. > > > See the try mentioned here: > > https://bugzilla.mozilla.org/show_bug.cgi?id=964545#c21 > > That try run appears green to me. Hmm I tried again https://bugzilla.mozilla.org/show_bug.cgi?id=964545#c22 and it did work!
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: