Bug 952973: Perform some content/base decom r=bz

This commit is contained in:
David Zbarsky
2014-01-15 09:26:51 -05:00
parent c8aee840cd
commit 6eecc62d8e
9 changed files with 34 additions and 56 deletions

View File

@@ -24,7 +24,6 @@
#include "nsIDocumentInlines.h"
#include "nsIDocumentEncoder.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMDocument.h"
#include "nsIContentIterator.h"
#include "nsEventListenerManager.h"
#include "nsFocusManager.h"
@@ -87,7 +86,6 @@
#include "nsNodeInfoManager.h"
#include "nsICategoryManager.h"
#include "nsIDOMDocumentType.h"
#include "nsIDOMUserDataHandler.h"
#include "nsGenericHTMLElement.h"
#include "nsIEditor.h"
@@ -2704,18 +2702,15 @@ FragmentOrElement::SetInnerHTMLInternal(const nsAString& aInnerHTML, ErrorResult
nsContentUtils::FireMutationEventsForDirectParsing(doc, target,
oldChildCount);
} else {
nsCOMPtr<nsIDOMDocumentFragment> df;
aError = nsContentUtils::CreateContextualFragment(target, aInnerHTML,
true,
getter_AddRefs(df));
nsCOMPtr<nsINode> fragment = do_QueryInterface(df);
nsRefPtr<DocumentFragment> df =
nsContentUtils::CreateContextualFragment(target, aInnerHTML, true, aError);
if (!aError.Failed()) {
// Suppress assertion about node removal mutation events that can't have
// listeners anyway, because no one has had the chance to register mutation
// listeners on the fragment that comes from the parser.
nsAutoScriptBlockerSuppressNodeRemoved scriptBlocker;
static_cast<nsINode*>(target)->AppendChild(*fragment, aError);
static_cast<nsINode*>(target)->AppendChild(*df, aError);
mb.NodesAdded();
}
}