Bug 1195722 - On desktop, allow the context menu to pop up concurrently with text selection. r?tylin
On desktop, the context menu is shown when the user lifts their finger after
a long press, but only if the eMouseLongTap event is not cancelled. So by
not cancelling it, we allow both the text selection and the context menu.
On Android, the context menu takes priority over text selection, so this
has no effect (i.e. if the context menu is shown, then the AccessibleCaret
code never even gets the eMouseLongTap event). Also on Android nothing
else relies on the cancellation of the eMouseLongTap event, so this change
is a no-op.
MozReview-Commit-ID: LPc4oGljXeh
--- a/layout/base/AccessibleCaretEventHub.cpp
+++ b/layout/base/AccessibleCaretEventHub.cpp
@@ -317,23 +317,18 @@ class AccessibleCaretEventHub::LongTapSt
: public AccessibleCaretEventHub::State
{
public:
virtual const char* Name() const override { return "LongTapState"; }
virtual nsEventStatus OnLongTap(AccessibleCaretEventHub* aContext,
const nsPoint& aPoint) override
{
- nsEventStatus rv = nsEventStatus_eIgnore;
-
- if (NS_SUCCEEDED(aContext->mManager->SelectWordOrShortcut(aPoint))) {
- rv = nsEventStatus_eConsumeNoDefault;
- }
-
- return rv;
+ aContext->mManager->SelectWordOrShortcut(aPoint);
+ return nsEventStatus_eIgnore;
}
virtual nsEventStatus OnRelease(AccessibleCaretEventHub* aContext) override
{
aContext->SetState(aContext->NoActionState());
// Do not consume the release since the press is not consumed in
// PressNoCaretState either.