Bug 857102 part 2 - Make NS_NewTextNode and nsIDocument::CreateTextNode infallible; r=bz

This commit is contained in:
Aryeh Gregor
2013-04-04 15:01:08 +03:00
parent 62e6c2fc96
commit fd76179457
26 changed files with 86 additions and 155 deletions

View File

@@ -74,6 +74,7 @@
#include "nsAttrValueInlines.h"
#include "mozilla/Selection.h"
#include "nsContentUtils.h"
#include "nsTextNode.h"
#define DEFAULT_COLUMN_WIDTH 20
@@ -1324,10 +1325,8 @@ nsTextControlFrame::UpdateValueDisplay(bool aNotify,
nsIContent *textContent = rootNode->GetChildAt(0);
if (!textContent) {
// Set up a textnode with our value
nsCOMPtr<nsIContent> textNode;
nsresult rv = NS_NewTextNode(getter_AddRefs(textNode),
mContent->NodeInfo()->NodeInfoManager());
NS_ENSURE_SUCCESS(rv, rv);
nsRefPtr<nsTextNode> textNode =
new nsTextNode(mContent->NodeInfo()->NodeInfoManager());
NS_ASSERTION(textNode, "Must have textcontent!\n");