From 854e3b246a52a4d94497a0792421452d839c6399 Mon Sep 17 00:00:00 2001 From: "aaronr%us.ibm.com" Date: Tue, 4 Apr 2006 21:09:57 +0000 Subject: [PATCH] [XForms] Initializing SetIntrinsicState too early. Bug 331911, r=allan+smaug --- extensions/xforms/nsXFormsControlStub.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/extensions/xforms/nsXFormsControlStub.cpp b/extensions/xforms/nsXFormsControlStub.cpp index 55573b1d1ebf..c19a7dd0a2ac 100644 --- a/extensions/xforms/nsXFormsControlStub.cpp +++ b/extensions/xforms/nsXFormsControlStub.cpp @@ -512,9 +512,6 @@ nsXFormsControlStubBase::Create(nsIXTFElementWrapper *aWrapper) ResetHelpAndHint(PR_TRUE); - // enabled is on pr. default - aWrapper->SetIntrinsicState(NS_EVENT_STATE_ENABLED); - #ifdef DEBUG_smaug sControlList->AppendElement(this); #endif @@ -561,7 +558,16 @@ nsXFormsControlStubBase::DocumentChanged(nsIDOMDocument *aNewDocument) { // We need to re-evaluate our instance data binding when our document // changes, since our context can change - return aNewDocument ? ForceModelRebind() : NS_OK; + + if (aNewDocument) { + // The intrinsic state needs to be initialized here since + // SetIntrinsicState will do nothing until the element lives in a document. + ResetProperties(); + + return ForceModelRebind(); + } + + return NS_OK; } nsresult