Bug 1460509 - part 45: Test if HTMLEditRules::PromoteRange() won't get range in Selection r=m_kato

PromoteRange() related methods do not change Selection nor the DOM tree.
Therefore, they must be safe.  However, only PromoteRange() takes an nsRange
instance and modifies it.  If it's in Selection, that causes selectionchange
event.  Therefore, we should check if given range is in Selection with
MOZ_ASSERT().

MozReview-Commit-ID: AXkmHFB4P08

--HG--
extra : rebase_source : 539b39d0217a7dc06f76e70546096d30b2734c02
This commit is contained in:
Masayuki Nakano 2018-05-15 18:39:27 +09:00
Родитель d388cab96a
Коммит 981ebf6352
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -6661,6 +6661,7 @@ HTMLEditRules::PromoteRange(nsRange& aRange,
EditAction aOperationType)
{
MOZ_ASSERT(IsEditorDataAvailable());
MOZ_ASSERT(!aRange.IsInSelection());
if (!aRange.IsPositioned()) {
return;