Bug 857102 part 5 - Make NS_NewDocumentFragment etc. infallible; r=bz
This commit is contained in:
@@ -35,9 +35,12 @@
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsTreeSanitizer.h"
|
||||
#include "nsHtml5Module.h"
|
||||
#include "mozilla/dom/DocumentFragment.h"
|
||||
|
||||
#define XHTML_DIV_TAG "div xmlns=\"http://www.w3.org/1999/xhtml\""
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsParserUtils,
|
||||
nsIScriptableUnescapeHTML,
|
||||
nsIParserUtils)
|
||||
@@ -192,8 +195,7 @@ nsParserUtils::ParseFragment(const nsAString& aFragment,
|
||||
aReturn);
|
||||
fragment = do_QueryInterface(*aReturn);
|
||||
} else {
|
||||
NS_NewDocumentFragment(aReturn,
|
||||
document->NodeInfoManager());
|
||||
NS_ADDREF(*aReturn = new DocumentFragment(document->NodeInfoManager()));
|
||||
fragment = do_QueryInterface(*aReturn);
|
||||
rv = nsContentUtils::ParseFragmentHTML(aFragment,
|
||||
fragment,
|
||||
|
||||
Reference in New Issue
Block a user