Last Comment Bug 378702 - fix deferred events
: fix deferred events
Status: RESOLVED FIXED
: fixed1.8.0.12, fixed1.8.1.4
Product: Core Graveyard
Classification: Graveyard
Component: XForms (show other bugs)
: Trunk
: x86 Windows XP
: -- normal (vote)
: ---
Assigned To: aaronr
: Stephen Pride
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-24 22:29 PDT by aaronr
Modified: 2016-07-15 14:46 PDT (History)
2 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
testcase (1.61 KB, application/xhtml+xml)
2007-04-24 22:29 PDT, aaronr
no flags Details
patch (4.04 KB, patch)
2007-04-24 22:33 PDT, aaronr
bugs: review+
Details | Diff | Splinter Review
patch2 (3.96 KB, patch)
2007-04-24 23:25 PDT, aaronr
surkov.alexander: review+
Details | Diff | Splinter Review

Description aaronr 2007-04-24 22:29:46 PDT
Created attachment 262726 [details]
testcase

my patch for bug 377878 had a bug in it where I didn't correctly convert the nsisupports* back over to a nsIModelElementPrivate*.  I also previously forgot to handle the recalculate, revalidate and refresh events.  Doh!
Comment 1 Olli Pettay [:smaug] (TPAC) 2007-04-24 22:32:24 PDT
And I reviewed bug 377878, oops.
Comment 2 aaronr 2007-04-24 22:33:02 PDT
Created attachment 262727 [details] [diff] [review]
patch
Comment 3 aaronr 2007-04-24 22:42:35 PDT
(In reply to comment #1)
> And I reviewed bug 377878, oops.
> 

Nah, the bug wasn't in the patch.  The bug was the fact that I changed what went into the hashtable but I didn't change how we got the value back inside the ennumeration function.
Comment 4 Olli Pettay [:smaug] (TPAC) 2007-04-24 22:51:10 PDT
Comment on attachment 262727 [details] [diff] [review]
patch


> PR_STATIC_CALLBACK(PLDHashOperator) DoDeferredActions(nsISupports * aModel, 
>                                                       PRUint32 aDeferred,
>                                                       void * data)
> {
>   if (aModel && aDeferred) {
>-    nsCOMPtr<nsIModelElementPrivate> model =
>-      NS_STATIC_CAST(nsIModelElementPrivate*, aModel);
>+    nsCOMPtr<nsISupports> modelSupp =
>+      NS_STATIC_CAST(nsISupports*, aModel);

aModel is already nsISupports* so no need to cast.

I think the whole problem could be fixed in some better way, but let's do this now for 0.8.
(The better way might be to use nsIModelElementPrivate as the key in the hashtable)
Comment 5 aaronr 2007-04-24 23:22:21 PDT
(In reply to comment #4)
> (From update of attachment 262727 [details] [diff] [review])
> 
> > PR_STATIC_CALLBACK(PLDHashOperator) DoDeferredActions(nsISupports * aModel, 
> >                                                       PRUint32 aDeferred,
> >                                                       void * data)
> > {
> >   if (aModel && aDeferred) {
> >-    nsCOMPtr<nsIModelElementPrivate> model =
> >-      NS_STATIC_CAST(nsIModelElementPrivate*, aModel);
> >+    nsCOMPtr<nsISupports> modelSupp =
> >+      NS_STATIC_CAST(nsISupports*, aModel);
> 
> aModel is already nsISupports* so no need to cast.
> 

I thought we had to cast to a comptr to do a QI.  But you are right, it works w/o it.

> I think the whole problem could be fixed in some better way, but let's do this
> now for 0.8.
> (The better way might be to use nsIModelElementPrivate as the key in the
> hashtable)
> 

That's what the problem was to begin with.  QI'ing the same nsIDOMElement model to a nsIModelElementPrivate was giving back different nsIModelElementPrivate values, so looking for the values in the hashtable didn't work.
Comment 6 aaronr 2007-04-24 23:25:58 PDT
Created attachment 262731 [details] [diff] [review]
patch2

fixes qi nit olli found
Comment 7 aaronr 2007-04-25 17:32:23 PDT
checked into trunk, 1.8 and 1.8.0

Note You need to log in before you can comment on or make changes to this bug.