Bug 1457083 - part 4: Replace mHTMLEditor in HTMLEditRules with HTMLEditorRef() r=m_kato

Although, this patch removes first check of mHTMLEditor in each method.  If
this causes some security issues, we should add now.  However, automated
tests don't indicate it.

Anyway, it should be fixed by bug 1454900 in same cycle.

MozReview-Commit-ID: 3LAtOQHyR5J

--HG--
extra : rebase_source : 48b78cb9477c6c47d23a864404ce95ca9edb8588
This commit is contained in:
Masayuki Nakano 2018-04-27 01:42:22 +09:00
Родитель 07772cd672
Коммит 97763c2c92
2 изменённых файлов: 1062 добавлений и 1064 удалений

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -51,17 +51,17 @@ TextEditRules::CheckBidiLevelForDeletion(
return NS_ERROR_FAILURE;
}
nsBidiLevel levelBefore;
nsBidiLevel levelAfter;
RefPtr<nsFrameSelection> frameSelection = aSelection->GetFrameSelection();
NS_ENSURE_TRUE(frameSelection, NS_ERROR_NULL_POINTER);
RefPtr<nsFrameSelection> frameSelection = SelectionRef().GetFrameSelection();
if (NS_WARN_IF(!frameSelection)) {
return NS_ERROR_FAILURE;
}
nsPrevNextBidiLevels levels = frameSelection->
GetPrevNextBidiLevels(aSelectionPoint.GetContainerAsContent(),
aSelectionPoint.Offset(), true);
levelBefore = levels.mLevelBefore;
levelAfter = levels.mLevelAfter;
nsBidiLevel levelBefore = levels.mLevelBefore;
nsBidiLevel levelAfter = levels.mLevelAfter;
nsBidiLevel currentCaretLevel = frameSelection->GetCaretBidiLevel();
@ -87,6 +87,8 @@ TextEditRules::CheckBidiLevelForDeletion(
void
TextEditRules::UndefineCaretBidiLevel(Selection* aSelection)
{
MOZ_ASSERT(IsEditorDataAvailable());
/**
* After inserting text the caret Bidi level must be set to the level of the
* inserted text.This is difficult, because we cannot know what the level is
@ -95,7 +97,7 @@ TextEditRules::UndefineCaretBidiLevel(Selection* aSelection)
* So we set the caret Bidi level to UNDEFINED here, and the caret code will
* set it correctly later
*/
RefPtr<nsFrameSelection> frameSelection = aSelection->GetFrameSelection();
RefPtr<nsFrameSelection> frameSelection = SelectionRef().GetFrameSelection();
if (frameSelection) {
frameSelection->UndefineCaretBidiLevel();
}