Bug 1432186 part 9. Remove nsIDOMNode::CloneNode. r=mccr8

MozReview-Commit-ID: 3x3wJ9H38Wx
This commit is contained in:
Boris Zbarsky 2018-01-29 23:10:51 -05:00
Родитель df23390565
Коммит baca310fed
3 изменённых файлов: 6 добавлений и 18 удалений

Просмотреть файл

@ -10116,12 +10116,15 @@ nsIDocument::CreateStaticClone(nsIDocShell* aCloneContainer)
// Make document use different container during cloning.
RefPtr<nsDocShell> originalShell = mDocumentContainer.get();
SetContainer(static_cast<nsDocShell*>(aCloneContainer));
nsCOMPtr<nsIDOMNode> clonedNode;
nsresult rv = thisAsDoc->CloneNode(true, 1, getter_AddRefs(clonedNode));
ErrorResult rv;
nsCOMPtr<nsINode> clonedNode = thisAsDoc->CloneNode(true, rv);
SetContainer(originalShell);
RefPtr<nsDocument> clonedDoc;
if (NS_SUCCEEDED(rv)) {
if (rv.Failed()) {
// Don't return yet; we need to reset mCreatingStaticClone
rv.SuppressException();
} else {
nsCOMPtr<nsIDocument> tmp = do_QueryInterface(clonedNode);
if (tmp) {
clonedDoc = static_cast<nsDocument*>(tmp.get());

Просмотреть файл

@ -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<nsINode> 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 \

Просмотреть файл

@ -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);
};