XForms model-destruct event doesn't work with fastback

RESOLVED FIXED

Status

Core Graveyard
XForms
P1
normal
RESOLVED FIXED
12 years ago
a year ago

People

(Reporter: Brian Ryner (not reading), Assigned: aaronr)

Tracking

({fixed1.8.0.2, fixed1.8.1})

Trunk
fixed1.8.0.2, fixed1.8.1

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

17.68 KB, patch
Details | Diff | Splinter Review
(Reporter)

Description

12 years ago
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.

Comment 1

12 years ago
(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
(Assignee)

Updated

12 years ago
Blocks: 278448
Priority: -- → P1
(Assignee)

Comment 2

12 years ago
*** Bug 299258 has been marked as a duplicate of this bug. ***
(Assignee)

Comment 3

12 years ago
Created attachment 205685 [details] [diff] [review]
proposed fix

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)
(Assignee)

Updated

12 years ago
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+

Updated

12 years ago
Attachment #205685 - Flags: review?(doronr) → review+
(Assignee)

Comment 5

12 years ago
Created attachment 205748 [details] [diff] [review]
patch fixing smaugs comments

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
(Assignee)

Updated

12 years ago
Status: NEW → ASSIGNED

Comment 6

12 years ago
checked into trunk
Whiteboard: xf-to-branch
(Assignee)

Comment 7

12 years ago
checked into MOZILLA_1_8_BRANCH via bug 323691.  Leaving open for now until it gets into 1.8.0

Updated

12 years ago
Whiteboard: xf-to-branch

Updated

12 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Keywords: fixed1.8.0.2
Resolution: --- → FIXED
(Assignee)

Comment 8

11 years ago
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.