diff --git a/extensions/xforms/nsXFormsControlStub.cpp b/extensions/xforms/nsXFormsControlStub.cpp index 0bfca7d68c2..f3ff1cd9a4c 100644 --- a/extensions/xforms/nsXFormsControlStub.cpp +++ b/extensions/xforms/nsXFormsControlStub.cpp @@ -54,6 +54,7 @@ #include "nsIEventStateManager.h" #include "nsIContent.h" #include "nsIDOM3Node.h" +#include "nsIDOMAttr.h" /** This class is used to generate xforms-hint and xforms-help events.*/ class nsXFormsHintHelpListener : public nsIDOMEventListener { @@ -196,6 +197,18 @@ nsXFormsControlStubBase::ResetBoundNode(const nsString &aBindAttribute, return wrapper->SetIntrinsicState(iState); } + // Check for presence of @xsi:type on bound node and add as a dependency + nsCOMPtr boundEl(do_QueryInterface(mBoundNode)); + if (boundEl) { + nsCOMPtr attrNode; + rv = boundEl->GetAttributeNodeNS(NS_LITERAL_STRING(NS_NAMESPACE_XML_SCHEMA_INSTANCE), + NS_LITERAL_STRING("type"), + getter_AddRefs(attrNode)); + if (NS_SUCCEEDED(rv) && attrNode) { + mDependencies.AppendObject(attrNode); + } + } + return NS_OK; }