Bug 1964011 - part 2: Make the editor classes log text input r=m_kato

Depends on D248368

Differential Revision: https://phabricator.services.mozilla.com/D248369
This commit is contained in:
Masayuki Nakano
2025-05-09 06:46:53 +00:00
committed by masayuki@d-toybox.com
parent 90e1f5ae9a
commit 8dd9d35fa1
4 changed files with 69 additions and 0 deletions

View File

@@ -31,6 +31,7 @@
#include "mozilla/EditorForwards.h"
#include "mozilla/IntegerRange.h"
#include "mozilla/InternalMutationEvent.h"
#include "mozilla/Logging.h"
#include "mozilla/MathAlgorithms.h"
#include "mozilla/Maybe.h"
#include "mozilla/OwningNonNull.h"
@@ -73,6 +74,8 @@ class nsISupports;
namespace mozilla {
extern LazyLogModule gTextInputLog; // Defined in EditorBase.cpp
using namespace dom;
using EmptyCheckOption = HTMLEditUtils::EmptyCheckOption;
using EmptyCheckOptions = HTMLEditUtils::EmptyCheckOptions;
@@ -1077,6 +1080,12 @@ Result<EditActionResult, nsresult> HTMLEditor::HandleInsertText(
const nsAString& aInsertionString, InsertTextFor aPurpose) {
MOZ_ASSERT(IsTopLevelEditSubActionDataAvailable());
MOZ_LOG(
gTextInputLog, LogLevel::Info,
("%p HTMLEditor::HandleInsertText(aInsertionString=\"%s\", aPurpose=%s)",
this, NS_ConvertUTF16toUTF8(aInsertionString).get(),
ToString(aPurpose).c_str()));
{
Result<EditActionResult, nsresult> result = CanHandleHTMLEditSubAction();
if (MOZ_UNLIKELY(result.isErr())) {
@@ -1147,6 +1156,11 @@ Result<EditActionResult, nsresult> HTMLEditor::HandleInsertText(
}
return GetFirstSelectionStartPoint<EditorDOMPoint>();
}();
MOZ_LOG(gTextInputLog, LogLevel::Info,
("%p HTMLEditor::HandleInsertText(), pointToInsert=%s", this,
ToString(pointToInsert).c_str()));
if (NS_WARN_IF(!pointToInsert.IsSet())) {
return Err(NS_ERROR_FAILURE);
}