mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 1057256 - Part 3 - Make touch caret handle events before selection carets. r=roc
This commit is contained in:
parent
3277fc6dc5
commit
93c2d2c4b4
@ -6832,24 +6832,29 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||
retargetEventDoc->GetShell() :
|
||||
nullptr;
|
||||
|
||||
nsRefPtr<SelectionCarets> selectionCaret = presShell ?
|
||||
presShell->GetSelectionCarets() :
|
||||
nullptr;
|
||||
if (selectionCaret) {
|
||||
*aEventStatus = selectionCaret->HandleEvent(aEvent);
|
||||
// Bug 1057256: Touch caret should handle the event before selection carets.
|
||||
// Otherwise, a long tap on touch caret will be incorrectly handled by
|
||||
// selection carets which makes moving touch caret failed.
|
||||
nsRefPtr<TouchCaret> touchCaret = presShell ?
|
||||
presShell->GetTouchCaret() :
|
||||
nullptr;
|
||||
if (touchCaret) {
|
||||
*aEventStatus = touchCaret->HandleEvent(aEvent);
|
||||
if (*aEventStatus == nsEventStatus_eConsumeNoDefault) {
|
||||
// If the event is consumed by the touch caret, Cancel APZC panning by
|
||||
// If the event is consumed by the touch caret, cancel APZC panning by
|
||||
// setting mMultipleActionsPrevented.
|
||||
aEvent->mFlags.mMultipleActionsPrevented = true;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
nsRefPtr<TouchCaret> touchCaret = presShell ? presShell->GetTouchCaret() : nullptr;
|
||||
if (touchCaret) {
|
||||
*aEventStatus = touchCaret->HandleEvent(aEvent);
|
||||
nsRefPtr<SelectionCarets> selectionCaret = presShell ?
|
||||
presShell->GetSelectionCarets() :
|
||||
nullptr;
|
||||
if (selectionCaret) {
|
||||
*aEventStatus = selectionCaret->HandleEvent(aEvent);
|
||||
if (*aEventStatus == nsEventStatus_eConsumeNoDefault) {
|
||||
// If the event is consumed by the touch caret, cancel APZC panning by
|
||||
// If the event is consumed by the selection carets, cancel APZC panning by
|
||||
// setting mMultipleActionsPrevented.
|
||||
aEvent->mFlags.mMultipleActionsPrevented = true;
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user