[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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user