diff --git a/extensions/xforms/nsXFormsUtils.cpp b/extensions/xforms/nsXFormsUtils.cpp index d1e566b3fe7..7475a27555a 100644 --- a/extensions/xforms/nsXFormsUtils.cpp +++ b/extensions/xforms/nsXFormsUtils.cpp @@ -2500,28 +2500,12 @@ nsXFormsUtils::GetModelFromNode(nsIDOMNode *aNode, nsIDOMNode **aModel) nsXFormsUtils::IsNodeAssocWithModel(nsIDOMNode *aNode, nsIDOMNode *aModel) { - nsCOMPtr modelNode; - - nsAutoString namespaceURI; - aNode->GetNamespaceURI(namespaceURI); - - // If the node is in the XForms namespace and XTF based, then it should - // be able to be handled by GetModel. Otherwise it is probably an instance - // node in a instance document. - if (namespaceURI.EqualsLiteral(NS_NAMESPACE_XFORMS)) { - nsCOMPtr element = do_QueryInterface(aNode); - nsCOMPtr modelPriv = GetModel(element); - modelNode = do_QueryInterface(modelPriv); - } else { - // We are assuming that if the node coming in isn't a proper XForms element, - // then it is an instance element in an instance doc. Now we just have - // to determine if the given model contains this instance document. - nsCOMPtr instNode; - nsresult rv = - nsXFormsUtils::GetInstanceNodeForData(aNode, getter_AddRefs(instNode)); - if (NS_SUCCEEDED(rv) && instNode) { - instNode->GetParentNode(getter_AddRefs(modelNode)); - } + // Determine if the given model contains this instance document. + nsCOMPtr modelNode, instNode; + nsresult rv = + nsXFormsUtils::GetInstanceNodeForData(aNode, getter_AddRefs(instNode)); + if (NS_SUCCEEDED(rv) && instNode) { + instNode->GetParentNode(getter_AddRefs(modelNode)); } return modelNode && (modelNode == aModel); diff --git a/extensions/xforms/nsXFormsUtils.h b/extensions/xforms/nsXFormsUtils.h index ec6b2109e1e..b3bc5957e35 100644 --- a/extensions/xforms/nsXFormsUtils.h +++ b/extensions/xforms/nsXFormsUtils.h @@ -674,14 +674,7 @@ public: * instance() function. * The provided node can be an instance node from an instance * document and thus be associated to the model in that way (model elements - * contain instance elements). Otherwise the node will be an XForms element - * that was used as the context node of the XPath expression (i.e the - * XForms control has an attribute that contains an XPath expression). - * Form controls are associated with model elements either explicitly through - * single-node binding or implicitly (if model cannot by calculated, it - * will use the first model element encountered in the document). The model - * can also be inherited from a containing element like xforms:group or - * xforms:repeat. + * contain instance elements). */ static NS_HIDDEN_(PRBool) IsNodeAssocWithModel(nsIDOMNode *aNode, nsIDOMNode *aModel);