Bug 1612085 - part 3: Remove dirty hack of Selection::mCachedRange r=smaug
Previously, I added `Selection::mCachedRange` to save allocation cost of `nsRange`. However, with the previous patch, we don't need the hack anymore since ranges removed by `Selection::RemoveAllRanges()` are always kept in the global cache of `nsRange`. Therefore, we can remove the ugly hack right now. Differential Revision: https://phabricator.services.mozilla.com/D61239
This commit is contained in:
@@ -2834,10 +2834,10 @@ bool TextControlState::SetValueWithTextEditor(
|
||||
if (selection) {
|
||||
// Since we don't use undo transaction, we don't need to store
|
||||
// selection state. SetText will set selection to tail.
|
||||
// Note that textEditor will collapse selection to the end.
|
||||
// Therefore, it's safe to use RemoveAllRangesTemporarily()
|
||||
// here.
|
||||
selection->RemoveAllRangesTemporarily();
|
||||
IgnoredErrorResult ignoredError;
|
||||
selection->RemoveAllRanges(ignoredError);
|
||||
NS_WARNING_ASSERTION(!ignoredError.Failed(),
|
||||
"Selection::RemoveAllRanges() failed, but ignored");
|
||||
}
|
||||
|
||||
// In this case, we makes the editor stop dispatching "input"
|
||||
|
||||
Reference in New Issue
Block a user