[XForms] Actions inside itemsets behave incorrectly. Bug 374994, r=surkov+olli

git-svn-id: svn://10.0.0.236/trunk@224026 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
aaronr%us.ibm.com
2007-04-02 20:21:08 +00:00
parent f1c5253bda
commit cfca86c098
19 changed files with 501 additions and 303 deletions

View File

@@ -72,6 +72,12 @@ nsXFormsActionModuleBase::OnCreated(nsIXTFElementWrapper *aWrapper)
aWrapper->GetElementNode(getter_AddRefs(node));
mElement = node;
NS_ASSERTION(mElement, "Wrapper is not an nsIDOMElement, we'll crash soon");
aWrapper->SetNotificationMask(nsIXTFElement::NOTIFY_WILL_CHANGE_DOCUMENT |
nsIXTFElement::NOTIFY_WILL_CHANGE_PARENT |
nsIXTFElement::NOTIFY_DOCUMENT_CHANGED |
nsIXTFElement::NOTIFY_PARENT_CHANGED);
return NS_OK;
}
@@ -81,9 +87,46 @@ NS_IMETHODIMP nsXFormsActionModuleBase::OnDestroyed()
return NS_OK;
}
NS_IMETHODIMP
nsXFormsActionModuleBase::WillChangeParent(nsIDOMElement *aNewParent)
{
SetRepeatState(eType_Unknown);
return NS_OK;
}
NS_IMETHODIMP
nsXFormsActionModuleBase::ParentChanged(nsIDOMElement *aNewParent)
{
nsXFormsStubElement::ParentChanged(aNewParent);
UpdateRepeatState(aNewParent);
return NS_OK;
}
NS_IMETHODIMP
nsXFormsActionModuleBase::WillChangeDocument(nsIDOMDocument *aNewDocument)
{
SetRepeatState(eType_Unknown);
return NS_OK;
}
NS_IMETHODIMP
nsXFormsActionModuleBase::DocumentChanged(nsIDOMDocument *aNewDocument)
{
nsXFormsStubElement::DocumentChanged(aNewDocument);
nsCOMPtr<nsIDOMNode> parent;
mElement->GetParentNode(getter_AddRefs(parent));
UpdateRepeatState(parent);
return NS_OK;
}
NS_IMETHODIMP
nsXFormsActionModuleBase::HandleEvent(nsIDOMEvent* aEvent)
{
if (GetRepeatState() == eType_Template) {
return NS_OK;
}
return nsXFormsUtils::EventHandlingAllowed(aEvent, mElement) ?
HandleAction(aEvent, nsnull) : NS_OK;
}