Bug 1671768 - Part 4: Use MOZ_CAN_RUN_SCRIPT for Selection::RemoveAllRanges r=masayuki

Differential Revision: https://phabricator.services.mozilla.com/D103780
This commit is contained in:
Kagami Sascha Rosylight
2021-02-03 21:52:48 +00:00
parent 0dba2fb895
commit 7057dbdc56
13 changed files with 26 additions and 19 deletions

View File

@@ -2802,7 +2802,7 @@ bool TextControlState::SetValueWithTextEditor(
// Since we don't use undo transaction, we don't need to store
// selection state. SetText will set selection to tail.
IgnoredErrorResult ignoredError;
selection->RemoveAllRanges(ignoredError);
MOZ_KnownLive(selection)->RemoveAllRanges(ignoredError);
NS_WARNING_ASSERTION(!ignoredError.Failed(),
"Selection::RemoveAllRanges() failed, but ignored");
}