diff --git a/extensions/xforms/nsXFormsDelegateStub.cpp b/extensions/xforms/nsXFormsDelegateStub.cpp index 1eb939ee555..f33faa33161 100644 --- a/extensions/xforms/nsXFormsDelegateStub.cpp +++ b/extensions/xforms/nsXFormsDelegateStub.cpp @@ -250,9 +250,13 @@ nsXFormsDelegateStub::SetMozTypeAttribute() NS_NAMED_LITERAL_STRING(mozTypeList, "typelist"); NS_NAMED_LITERAL_STRING(mozRejectedType, "rejectedtype"); - if (mModel && mBoundNode) { + // can't use mBoundNode here since mBoundNode can exist for xf:output, for + // example, even if there is no binding attribute. + nsCOMPtr boundNode; + GetBoundNode(getter_AddRefs(boundNode)); + if (mModel && boundNode) { nsAutoString type, nsOrig; - if (NS_FAILED(mModel->GetTypeAndNSFromNode(mBoundNode, type, nsOrig))) { + if (NS_FAILED(mModel->GetTypeAndNSFromNode(boundNode, type, nsOrig))) { mElement->RemoveAttributeNS(mozTypeNs, mozType); mElement->RemoveAttributeNS(mozTypeNs, mozTypeList); mElement->RemoveAttributeNS(mozTypeNs, mozRejectedType);