Bug 1413253. Make sure to make it clear that we'd report a JS exception on the ErrorResult in InsertNodeTransaction::DoTransaction. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 07 Nov 2017 15:36:41 -0500
changeset 441405 fd793c9da072eb362b5a6d21edb5828ddb777e23
parent 441404 2a5a80d284b5ef958298cf515867ffbe420478c0
child 441406 f9aafdff7559fb7da5c829d00c874623bf8db2d6
push id8130
push userryanvm@gmail.com
push dateThu, 09 Nov 2017 00:28:20 +0000
treeherdermozilla-beta@a49a6fa54363 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs1413253
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1413253. Make sure to make it clear that we'd report a JS exception on the ErrorResult in InsertNodeTransaction::DoTransaction. r=peterv MozReview-Commit-ID: 2DEPzwwXbX9
editor/libeditor/InsertNodeTransaction.cpp
--- a/editor/libeditor/InsertNodeTransaction.cpp
+++ b/editor/libeditor/InsertNodeTransaction.cpp
@@ -61,16 +61,17 @@ InsertNodeTransaction::DoTransaction()
 
   // Note, it's ok for ref to be null. That means append.
   nsCOMPtr<nsIContent> ref = mParent->GetChildAt(mOffset);
 
   mEditorBase->MarkNodeDirty(GetAsDOMNode(mNode));
 
   ErrorResult rv;
   mParent->InsertBefore(*mNode, ref, rv);
+  rv.WouldReportJSException();
   NS_ENSURE_TRUE(!rv.Failed(), rv.StealNSResult());
 
   // Only set selection to insertion point if editor gives permission
   if (mEditorBase->GetShouldTxnSetSelection()) {
     RefPtr<Selection> selection = mEditorBase->GetSelection();
     NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
     // Place the selection just after the inserted element
     selection->Collapse(mParent, mOffset + 1);