diff --git a/mozilla/extensions/xforms/Makefile.in b/mozilla/extensions/xforms/Makefile.in
index 9c7753b2fd0..2ed12466f82 100644
--- a/mozilla/extensions/xforms/Makefile.in
+++ b/mozilla/extensions/xforms/Makefile.in
@@ -119,8 +119,9 @@ REQUIRES = \
XPIDLSRCS = \
nsIXFormsModelElement.idl \
nsIXFormsNSModelElement.idl \
- nsIInstanceElementPrivate.idl \
nsIModelElementPrivate.idl \
+ nsIXFormsNSInstanceElement.idl \
+ nsIInstanceElementPrivate.idl \
nsIXFormsControl.idl \
nsIXFormsContextControl.idl \
nsIXFormsActionElement.idl \
diff --git a/mozilla/extensions/xforms/nsIInstanceElementPrivate.idl b/mozilla/extensions/xforms/nsIInstanceElementPrivate.idl
index c3373046e3a..f0d7498a967 100644
--- a/mozilla/extensions/xforms/nsIInstanceElementPrivate.idl
+++ b/mozilla/extensions/xforms/nsIInstanceElementPrivate.idl
@@ -36,21 +36,21 @@
*
* ***** END LICENSE BLOCK ***** */
-#include "nsISupports.idl"
+#include "nsIXFormsNSInstanceElement.idl"
-interface nsIDOMDocument;
interface nsIDOMElement;
/**
- * Private interface implemented by the instance element.
+ * Private interface implemented by the \ element.
*/
-[uuid(debb24ef-7ba1-4e01-9f62-18106b25c993)]
-interface nsIInstanceElementPrivate : nsISupports
+[uuid(e9a975d7-616c-4c4b-9413-3aa8001cdb08)]
+interface nsIInstanceElementPrivate : nsIXFormsNSInstanceElement
{
/**
- * The document which holds the live instance data.
+ * Set instance document.
*/
- attribute nsIDOMDocument document;
+ void setInstanceDocument(in nsIDOMDocument document);
+
readonly attribute nsIDOMElement element;
void backupOriginalDocument();
void restoreOriginalDocument();
diff --git a/mozilla/extensions/xforms/nsIXFormsNSInstanceElement.idl b/mozilla/extensions/xforms/nsIXFormsNSInstanceElement.idl
new file mode 100755
index 00000000000..65757fa074f
--- /dev/null
+++ b/mozilla/extensions/xforms/nsIXFormsNSInstanceElement.idl
@@ -0,0 +1,53 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla XForms support.
+ *
+ * The Initial Developer of the Original Code is
+ * Alexander Surkov.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Alexander Surkov
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#include "nsISupports.idl"
+
+interface nsIDOMDocument;
+
+/**
+ * Defines additional post-spec. functions for the \ element.
+ */
+[scriptable, uuid(80669b92-8331-4f92-aaf8-06e80e6827b3)]
+interface nsIXFormsNSInstanceElement : nsISupports
+{
+ /**
+ * Return instance document
+ */
+ nsIDOMDocument getInstanceDocument();
+};
diff --git a/mozilla/extensions/xforms/nsXFormsInstanceElement.cpp b/mozilla/extensions/xforms/nsXFormsInstanceElement.cpp
index f14c5d8296c..b1fbbe053cf 100644
--- a/mozilla/extensions/xforms/nsXFormsInstanceElement.cpp
+++ b/mozilla/extensions/xforms/nsXFormsInstanceElement.cpp
@@ -53,8 +53,9 @@
static const char* kLoadAsData = "loadAsData";
-NS_IMPL_ISUPPORTS_INHERITED5(nsXFormsInstanceElement,
+NS_IMPL_ISUPPORTS_INHERITED6(nsXFormsInstanceElement,
nsXFormsStubElement,
+ nsIXFormsNSInstanceElement,
nsIInstanceElementPrivate,
nsIStreamListener,
nsIRequestObserver,
@@ -78,7 +79,7 @@ nsXFormsInstanceElement::OnDestroyed()
mChannel = nsnull;
}
mListener = nsnull;
- SetDocument(nsnull);
+ SetInstanceDocument(nsnull);
mElement = nsnull;
return NS_OK;
}
@@ -246,7 +247,7 @@ nsXFormsInstanceElement::OnStopRequest(nsIRequest *request, nsISupports *ctx,
PRBool succeeded = NS_SUCCEEDED(status);
if (!succeeded) {
- SetDocument(nsnull);
+ SetInstanceDocument(nsnull);
}
if (mDocument) {
@@ -261,7 +262,7 @@ nsXFormsInstanceElement::OnStopRequest(nsIRequest *request, nsISupports *ctx,
namespaceURI.EqualsLiteral("http://www.mozilla.org/newlayout/xml/parsererror.xml")) {
NS_WARNING("resulting instance document could not be parsed");
succeeded = PR_FALSE;
- SetDocument(nsnull);
+ SetInstanceDocument(nsnull);
}
}
}
@@ -275,17 +276,19 @@ nsXFormsInstanceElement::OnStopRequest(nsIRequest *request, nsISupports *ctx,
return NS_OK;
}
-// nsIInstanceElementPrivate
+// nsIXFormsNSInstanceElement
NS_IMETHODIMP
-nsXFormsInstanceElement::GetDocument(nsIDOMDocument **aDocument)
+nsXFormsInstanceElement::GetInstanceDocument(nsIDOMDocument **aDocument)
{
NS_IF_ADDREF(*aDocument = mDocument);
return NS_OK;
}
+// nsIInstanceElementPrivate
+
NS_IMETHODIMP
-nsXFormsInstanceElement::SetDocument(nsIDOMDocument *aDocument)
+nsXFormsInstanceElement::SetInstanceDocument(nsIDOMDocument *aDocument)
{
nsCOMPtr doc(do_QueryInterface(mDocument));
if (doc) {
@@ -608,7 +611,7 @@ nsXFormsInstanceElement::CreateInstanceDocument(const nsAString &aQualifiedName)
getter_AddRefs(newDoc));
NS_ENSURE_SUCCESS(rv, rv);
- rv = SetDocument(newDoc);
+ rv = SetInstanceDocument(newDoc);
NS_ENSURE_SUCCESS(rv, rv);
// I don't know if not being able to create a backup document is worth
diff --git a/mozilla/extensions/xforms/nsXFormsInstanceElement.h b/mozilla/extensions/xforms/nsXFormsInstanceElement.h
index f4b6eff7e8c..a37f32ef2ef 100644
--- a/mozilla/extensions/xforms/nsXFormsInstanceElement.h
+++ b/mozilla/extensions/xforms/nsXFormsInstanceElement.h
@@ -66,6 +66,7 @@ class nsXFormsInstanceElement : public nsXFormsStubElement,
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIREQUESTOBSERVER
+ NS_DECL_NSIXFORMSNSINSTANCEELEMENT
NS_DECL_NSIINSTANCEELEMENTPRIVATE
NS_DECL_NSISTREAMLISTENER
NS_DECL_NSICHANNELEVENTSINK
diff --git a/mozilla/extensions/xforms/nsXFormsModelElement.cpp b/mozilla/extensions/xforms/nsXFormsModelElement.cpp
index 06b132440b7..53d6bed8489 100644
--- a/mozilla/extensions/xforms/nsXFormsModelElement.cpp
+++ b/mozilla/extensions/xforms/nsXFormsModelElement.cpp
@@ -1350,8 +1350,9 @@ nsXFormsModelElement::FindInstanceDocument(const nsAString &aID)
nsXFormsModelElement::FindInstanceElement(aID, getter_AddRefs(instance));
nsIDOMDocument *doc = nsnull;
- if (instance)
- instance->GetDocument(&doc); // addrefs
+ if (instance) {
+ instance->GetInstanceDocument(&doc); // addrefs
+ }
return doc;
}
@@ -2009,7 +2010,7 @@ nsXFormsModelInstanceDocuments::Item(PRUint32 aIndex, nsIDOMNode** aReturn)
nsIInstanceElementPrivate* instance = mInstanceList.SafeObjectAt(aIndex);
if (instance) {
nsCOMPtr doc;
- if (NS_SUCCEEDED(instance->GetDocument(getter_AddRefs(doc))) && doc) {
+ if (NS_SUCCEEDED(instance->GetInstanceDocument(getter_AddRefs(doc))) && doc) {
NS_ADDREF(*aReturn = doc);
}
}
diff --git a/mozilla/extensions/xforms/nsXFormsSubmissionElement.cpp b/mozilla/extensions/xforms/nsXFormsSubmissionElement.cpp
index 513416d91a0..6e4caa6a97a 100644
--- a/mozilla/extensions/xforms/nsXFormsSubmissionElement.cpp
+++ b/mozilla/extensions/xforms/nsXFormsSubmissionElement.cpp
@@ -535,7 +535,7 @@ nsXFormsSubmissionElement::LoadReplaceInstance(nsIChannel *channel)
// replace the document referenced by this instance element with the info
// returned back from the submission
if (NS_SUCCEEDED(rv) && instanceElement) {
- instanceElement->SetDocument(newDoc);
+ instanceElement->SetInstanceDocument(newDoc);
// refresh everything
model->Rebuild();
diff --git a/mozilla/extensions/xforms/nsXFormsUtils.cpp b/mozilla/extensions/xforms/nsXFormsUtils.cpp
index ffbde915253..2622f9ce46d 100644
--- a/mozilla/extensions/xforms/nsXFormsUtils.cpp
+++ b/mozilla/extensions/xforms/nsXFormsUtils.cpp
@@ -595,7 +595,7 @@ nsXFormsUtils::EvaluateNodeBinding(nsIDOMElement *aElement,
getter_AddRefs(instance));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr domdoc;
- instance->GetDocument(getter_AddRefs(domdoc));
+ instance->GetInstanceDocument(getter_AddRefs(domdoc));
nsCOMPtr instanceDataEle;
nsCOMPtr childReturn;
rv = domdoc->CreateElementNS(namespaceURI, expr,