diff --git a/layout/base/AccessibleCaret.cpp b/layout/base/AccessibleCaret.cpp index 64144e67a9b2..35bc98c70c6d 100644 --- a/layout/base/AccessibleCaret.cpp +++ b/layout/base/AccessibleCaret.cpp @@ -112,7 +112,7 @@ AccessibleCaret::SetSelectionBarEnabled(bool aEnabled) return; } - AC_LOG("%s, enabled %d", __FUNCTION__, aEnabled); + AC_LOG("Set selection bar %s", __FUNCTION__, aEnabled ? "Enabled" : "Disabled"); ErrorResult rv; CaretElement()->ClassList()->Toggle(NS_LITERAL_STRING("no-bar"), diff --git a/layout/base/AccessibleCaretEventHub.cpp b/layout/base/AccessibleCaretEventHub.cpp index fc1478ae0f5d..183227a35f57 100644 --- a/layout/base/AccessibleCaretEventHub.cpp +++ b/layout/base/AccessibleCaretEventHub.cpp @@ -611,8 +611,17 @@ AccessibleCaretEventHub::HandleKeyboardEvent(WidgetKeyboardEvent* aEvent) { switch (aEvent->mMessage) { case eKeyUp: + AC_LOGV("eKeyUp, state: %s", mState->Name()); + mManager->OnKeyboardEvent(); + break; + case eKeyDown: + AC_LOGV("eKeyDown, state: %s", mState->Name()); + mManager->OnKeyboardEvent(); + break; + case eKeyPress: + AC_LOGV("eKeyPress, state: %s", mState->Name()); mManager->OnKeyboardEvent(); break; diff --git a/layout/base/AccessibleCaretManager.cpp b/layout/base/AccessibleCaretManager.cpp index 95ae4aba4cad..fe6df170208e 100644 --- a/layout/base/AccessibleCaretManager.cpp +++ b/layout/base/AccessibleCaretManager.cpp @@ -175,7 +175,7 @@ AccessibleCaretManager::UpdateCaretsForCursorMode() void AccessibleCaretManager::UpdateCaretsForSelectionMode() { - AC_LOG("%s, selection: %p", __FUNCTION__, GetSelection()); + AC_LOG("%s: selection: %p", __FUNCTION__, GetSelection()); int32_t startOffset = 0; nsIFrame* startFrame = FindFirstNodeWithFrame(false, &startOffset); @@ -189,21 +189,24 @@ AccessibleCaretManager::UpdateCaretsForSelectionMode() return; } - auto updateSingleCaret = [](AccessibleCaret * aCaret, nsIFrame * aFrame, - int32_t aOffset)->PositionChangedResult + auto updateSingleCaret = [](AccessibleCaret* aCaret, nsIFrame* aFrame, + int32_t aOffset) -> PositionChangedResult { PositionChangedResult result = aCaret->SetPosition(aFrame, aOffset); aCaret->SetSelectionBarEnabled(true); + switch (result) { - case PositionChangedResult::NotChanged: - // Do nothing - break; - case PositionChangedResult::Changed: - aCaret->SetAppearance(Appearance::Normal); - break; - case PositionChangedResult::Invisible: - aCaret->SetAppearance(Appearance::NormalNotShown); - break; + case PositionChangedResult::NotChanged: + // Do nothing + break; + + case PositionChangedResult::Changed: + aCaret->SetAppearance(Appearance::Normal); + break; + + case PositionChangedResult::Invisible: + aCaret->SetAppearance(Appearance::NormalNotShown); + break; } return result; };