Bug 1367765 - Propagate the mHandledByAPZ flag when dispatching a touch event to the DOM. r=rhunt draft
authorBotond Ballo <botond@mozilla.com>
Wed, 06 Sep 2017 23:42:04 -0400
changeset 663396 94ac60bc8b38dad3d8abaa39b5a94de88ec0f6b0
parent 663395 2e1420a9ae2b9b16c54b89a9cafa0aa9926434b2
child 663397 e89fe4eefe615d3f65d2471ff59aa9d51d9ae5e2
push id79426
push userbballo@mozilla.com
push dateTue, 12 Sep 2017 23:39:18 +0000
reviewersrhunt
bugs1367765
milestone57.0a1
Bug 1367765 - Propagate the mHandledByAPZ flag when dispatching a touch event to the DOM. r=rhunt This ensures that, if the touch event is over a scrollbar thumb and makes it into nsSliderFrame::StartAPZDrag(), nsSliderFrame knows that the event went through APZ and that therefore APZ will handle the drag. MozReview-Commit-ID: 92wAc1l9Pqz
layout/base/PresShell.cpp
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -8458,16 +8458,17 @@ PresShell::DispatchTouchEventToDOM(Widge
       }
       content = capturingContent;
     }
     // copy the event
     WidgetTouchEvent newEvent(touchEvent->IsTrusted(),
                               touchEvent->mMessage, touchEvent->mWidget);
     newEvent.AssignTouchEventData(*touchEvent, false);
     newEvent.mTarget = targetPtr;
+    newEvent.mFlags.mHandledByAPZ = touchEvent->mFlags.mHandledByAPZ;
 
     RefPtr<PresShell> contentPresShell;
     if (doc == mDocument) {
       contentPresShell = static_cast<PresShell*>(doc->GetShell());
       if (contentPresShell) {
         //XXXsmaug huge hack. Pushing possibly capturing content,
         //         even though event target is something else.
         contentPresShell->PushCurrentEventInfo(