Bug 1872863 - Part 1. Ignore error of GetInlineSpellCheckek. r=masayuki

GeckoView disables spell checker. When disabling it and contenteditable
attribute is changed, we may not initialize editor.

So we should ignore an error of spell check.

Differential Revision: https://phabricator.services.mozilla.com/D202408
This commit is contained in:
Makoto Kato 2024-02-27 15:00:33 +00:00
Родитель 285bf598da
Коммит cf76a88aa0
1 изменённых файлов: 5 добавлений и 3 удалений

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

@ -6319,9 +6319,11 @@ void Document::DeferredContentEditableCountChange(Element* aElement) {
if (aElement) {
if (RefPtr<HTMLEditor> htmlEditor = GetHTMLEditor()) {
nsCOMPtr<nsIInlineSpellChecker> spellChecker;
rv = htmlEditor->GetInlineSpellChecker(false,
getter_AddRefs(spellChecker));
NS_ENSURE_SUCCESS_VOID(rv);
DebugOnly<nsresult> rvIgnored = htmlEditor->GetInlineSpellChecker(
false, getter_AddRefs(spellChecker));
NS_WARNING_ASSERTION(
NS_SUCCEEDED(rvIgnored),
"EditorBase::GetInlineSpellChecker() failed, but ignored");
if (spellChecker &&
aElement->InclusiveDescendantMayNeedSpellchecking(htmlEditor)) {