diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index f313ab5bd213..7917b673e92b 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -10116,12 +10116,15 @@ nsIDocument::CreateStaticClone(nsIDocShell* aCloneContainer) // Make document use different container during cloning. RefPtr originalShell = mDocumentContainer.get(); SetContainer(static_cast(aCloneContainer)); - nsCOMPtr clonedNode; - nsresult rv = thisAsDoc->CloneNode(true, 1, getter_AddRefs(clonedNode)); + ErrorResult rv; + nsCOMPtr clonedNode = thisAsDoc->CloneNode(true, rv); SetContainer(originalShell); RefPtr clonedDoc; - if (NS_SUCCEEDED(rv)) { + if (rv.Failed()) { + // Don't return yet; we need to reset mCreatingStaticClone + rv.SuppressException(); + } else { nsCOMPtr tmp = do_QueryInterface(clonedNode); if (tmp) { clonedDoc = static_cast(tmp.get()); diff --git a/dom/base/nsINode.h b/dom/base/nsINode.h index 92de03089ed5..466e103162f0 100644 --- a/dom/base/nsINode.h +++ b/dom/base/nsINode.h @@ -2301,19 +2301,6 @@ ToCanonicalSupports(nsINode* aPointer) { \ *aResult = nsINode::HasChildNodes(); \ return NS_OK; \ - } \ - NS_IMETHOD CloneNode(bool aDeep, uint8_t aArgc, nsIDOMNode** aResult) __VA_ARGS__ override \ - { \ - if (aArgc == 0) { \ - aDeep = true; \ - } \ - mozilla::ErrorResult rv; \ - nsCOMPtr clone = nsINode::CloneNode(aDeep, rv); \ - if (rv.Failed()) { \ - return rv.StealNSResult(); \ - } \ - *aResult = clone.forget().take()->AsDOMNode(); \ - return NS_OK; \ } #define NS_FORWARD_NSIDOMNODE_TO_NSINODE \ diff --git a/dom/interfaces/core/nsIDOMNode.idl b/dom/interfaces/core/nsIDOMNode.idl index faf96e87aa6f..e76747358f77 100644 --- a/dom/interfaces/core/nsIDOMNode.idl +++ b/dom/interfaces/core/nsIDOMNode.idl @@ -41,6 +41,4 @@ interface nsIDOMNode : nsISupports // Modified in DOM Level 2: readonly attribute nsIDOMDocument ownerDocument; boolean hasChildNodes(); - // Modified in DOM Level 4: - [optional_argc] nsIDOMNode cloneNode([optional] in boolean deep); };