Closed Bug 310109 Opened 17 years ago Closed 17 years ago
XForms model-destruct event doesn't work with fastback
Spun off from bug 293386 comment 10 : There's a problem with the way XForms currently does its model-destruct events. It does them via XTF's DocumentChange notification, which happens when UnbindFromTree is called... after the document has been detached from the window. That means that an event listener on the window won't be able to listen for these events. Given the way this event is defined to work, I think the most straightforward solution is to have XForms listen for unload and dispatch this event from there, when the window is still intact. This will have the effect of disabling fastback for documents containing XForms content. If that's no good, another solution would be to add the unload listener only if model-destruct listeners exist, but that could be quite involved.
(In reply to comment #0) > This will have the effect of disabling fastback for documents containing > XForms content. :( That would be sad. Hmmm, the model-destruct event is defined as: "Dispatched by the processor to advise of imminent shutdown of the XForms Processor, which can occur from user action, or from the load XForms Action, or as a result of form submission." Yes, I guess "shutdown" is not inactive/not shown. > If that's no good, another solution would be to add the unload listener only if > model-destruct listeners exist, but that could be quite involved. Yeah, that sounds a bit tricky. I guess, the best easy fix is to just use "unload" as you say, and then ignore caching for now... hhmmm
*** Bug 299258 has been marked as a duplicate of this bug. ***
changed xforms-model-destruct code to cue off of "unload" event. My patch also changes other places that need to get nsIDOMWindowInternal so that we all go through nsXFormsUtils to do the work. Eliminates a lot of duplication of the same code.
Attachment #205685 - Flags: review?(smaug)
Comment on attachment 205685 [details] [diff] [review] proposed fix >- // We may still be waiting on external documents to load. >- MaybeNotifyCompletion(); >- > return NS_OK; >+ > } Extra newline after return >+nsresult >+nsXFormsUtils::GetWindowFromDocument(nsIDOMDocument *aDoc, >+ nsIDOMWindowInternal **aWindow) Align parameters With those, r=me. This patch should do the trick, although it is unfortunate that we have to use unload (and disable bfcache).
Attachment #205685 - Flags: review?(smaug) → review+
this patch fixes smaug's comments. Doron also caught that I introduced some nsresult rv local variables that I ended up not using. So I cleaned those up, too.
Attachment #205685 - Attachment is obsolete: true
checked into trunk
checked into MOZILLA_1_8_BRANCH via bug 323691. Leaving open for now until it gets into 1.8.0
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
verified fixed in MOZILLA_1_8_BRANCH
You need to log in before you can comment on or make changes to this bug.