Last Comment Bug 377878 - Wrong ordering of dispatched events
: Wrong ordering of dispatched events
: fixed1.8.0.12, fixed1.8.1.4
Product: Core Graveyard
Classification: Graveyard
Component: XForms (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: aaronr
: Stephen Pride
Depends on:
  Show dependency treegraph
Reported: 2007-04-18 06:55 PDT by Steve Speicher
Modified: 2016-07-15 14:46 PDT (History)
2 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---

test case (for rebuild only) (1.58 KB, application/xhtml+xml)
2007-04-18 06:56 PDT, Steve Speicher
no flags Details
patch (1.40 KB, patch)
2007-04-23 14:50 PDT, aaronr
doronr: review+
bugs: review+
Details | Diff | Splinter Review

Description Steve Speicher 2007-04-18 06:55:04 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a4pre) Gecko/20070416 Minefield/3.0a4pre
Build Identifier: 

This is for all 4 Rebuild(a), Recalculate(b), Rebuild(c), Refresh(d) as well as all together(e).  These are all normative W3C test cases 10.1.1.(a-e)

Reproducible: Always
Comment 1 Steve Speicher 2007-04-18 06:56:17 PDT
Created attachment 261943 [details]
test case (for rebuild only)

see test suite link for all other scenarios
Comment 2 Olli Pettay [:smaug] 2007-04-18 07:37:11 PDT
I pretty sure rebuild, recalculate, revalidate and refresh used
to work according to spec at some point. So is this a regression?
Comment 3 Olli Pettay [:smaug] 2007-04-18 07:37:43 PDT
Comment 4 Olli Pettay [:smaug] 2007-04-18 07:46:15 PDT
What does this actually mean: "This action causes the processing of xforms-rebuild to happen, bypassing the normal event flow"
What is the normal event flow?
Comment 5 Olli Pettay [:smaug] 2007-04-18 07:47:37 PDT
Right now model->Rebuild(); is called, but should we just dispatch
xforms-rebuild to model?
Comment 6 aaronr 2007-04-18 12:01:37 PDT
My bad.  I asked SteveS to open this bug.  I looked at this last night and thought it was a bug since I know that even with deferred actions, when rebuild is called directly it executes right away.  I forgot all about it being a direct action that bypassed the event flow.

(In reply to comment #4)
> What does this actually mean: "This action causes the processing of
> xforms-rebuild to happen, bypassing the normal event flow"
> What is the normal event flow?

according to the errata, this means:

So looking at the errata:, there shouldn't even be an xforms-rebuild event dispatched in this testcase the way I read it.  The xf:insert will defer a rebuild, but then the direct invocation of rebuild should cause the rebuild to happen without dispatching an event and clear the flag for the deferred rebuild.

Can someone else look at this and see if they read this the same way that I do?  So in short I believe the testcase is wrong to say that there should be a rebuild and I think we are wrong since we do send a xforms-rebuild event. 
Comment 7 aaronr 2007-04-19 17:45:16 PDT
ok, all of the logic in the code is correct for the most part.  The issue is that when nsXFormsRebuildElement::HandleAction calls nsXFormsUtils::GetModel(mElement), it gets a different value back EVERY TIME.  So when aParentAction->SetRebuild(model, PR_FALSE) is called, it is passing in a different value for model every time.  So when action goes to look to see if that model has already had some deferred flags set on it, like DEFERRED_REBUILD, it won't find the model to clear the flag.  That is why we are doing the deferred rebuild even though we don't need to.
Comment 8 aaronr 2007-04-23 14:50:19 PDT
Created attachment 262558 [details] [diff] [review]

fixed bug by qi'ing to nsISupports before storing, retrieving from mDeferredUpdates hashtable in nsXFormsActionElement.
Comment 9 aaronr 2007-04-24 01:38:07 PDT
checked into trunk
Comment 10 aaronr 2007-04-24 19:16:55 PDT
checked into 1.8 and 1.8.0 branches

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