Bug 1121468 - Go to NoActionState after receiving release on LongTapState. r=roc

This makes the state change match the user action. No functionality
changes is expected.
This commit is contained in:
Ting-Yu Lin 2016-01-25 15:50:28 +08:00
parent daa0b4cece
commit 37f9909722
4 changed files with 12 additions and 4 deletions

View File

@ -327,9 +327,16 @@ public:
rv = nsEventStatus_eConsumeNoDefault;
}
return rv;
}
virtual nsEventStatus OnRelease(AccessibleCaretEventHub* aContext) override
{
aContext->SetState(aContext->NoActionState());
return rv;
// Do not consume the release since the press is not consumed in
// PressNoCaretState either.
return nsEventStatus_eIgnore;
}
virtual void OnReflow(AccessibleCaretEventHub* aContext) override

View File

@ -24,7 +24,7 @@ digraph event_hub_states {
PressNoCaret -> Scroll [label="Scroll start", constraint=false];
LongTap [color="#E8C516"]
LongTap -> NoAction;
LongTap -> NoAction [label="Release"];
Scroll [color="#FF9022"]
Scroll -> PostScroll [label="Scroll end"];

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 94 KiB

View File

@ -60,6 +60,7 @@ public:
using AccessibleCaretEventHub::PressNoCaretState;
using AccessibleCaretEventHub::ScrollState;
using AccessibleCaretEventHub::PostScrollState;
using AccessibleCaretEventHub::LongTapState;
using AccessibleCaretEventHub::FireScrollEnd;
explicit MockAccessibleCaretEventHub()
@ -461,7 +462,7 @@ AccessibleCaretEventHubTester::TestLongTapWithSelectWordSuccessful(
nsEventStatus_eIgnore);
HandleEventAndCheckState(CreateLongTapEvent(0, 0),
MockAccessibleCaretEventHub::NoActionState(),
MockAccessibleCaretEventHub::LongTapState(),
nsEventStatus_eConsumeNoDefault);
HandleEventAndCheckState(aReleaseEventCreator(0, 0),
@ -502,7 +503,7 @@ AccessibleCaretEventHubTester::TestLongTapWithSelectWordFailed(
nsEventStatus_eIgnore);
HandleEventAndCheckState(CreateLongTapEvent(0, 0),
MockAccessibleCaretEventHub::NoActionState(),
MockAccessibleCaretEventHub::LongTapState(),
nsEventStatus_eIgnore);
HandleEventAndCheckState(aReleaseEventCreator(0, 0),