Closed Bug 310109 Opened 19 years ago Closed 19 years ago

XForms model-destruct event doesn't work with fastback

Categories

(Core Graveyard :: XForms, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bryner, Assigned: aaronr)

References

Details

(Keywords: fixed1.8.0.2, fixed1.8.1)

Attachments

(1 file, 1 obsolete file)

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
Blocks: 278448
Priority: -- → P1
*** Bug 299258 has been marked as a duplicate of this bug. ***
Attached patch proposed fix (obsolete) (deleted) — Splinter Review
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)
Attachment #205685 - Flags: review?(doronr)
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+
Attachment #205685 - Flags: review?(doronr) → review+
Attached patch patch fixing smaugs comments (deleted) — Splinter 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
Status: NEW → ASSIGNED
checked into trunk
Whiteboard: xf-to-branch
checked into MOZILLA_1_8_BRANCH via bug 323691. Leaving open for now until it gets into 1.8.0
Whiteboard: xf-to-branch
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Keywords: fixed1.8.0.2
Resolution: --- → FIXED
verified fixed in MOZILLA_1_8_BRANCH
Keywords: fixed1.8.1
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: