From fd2c4816540acf301bb416a901a68c2c93714ff1 Mon Sep 17 00:00:00 2001 From: Edgar Chen Date: Fri, 16 Oct 2020 12:27:55 +0000 Subject: [PATCH] Bug 1669673 - Part 1: setPointerCapture shoult not make a draggable element to be undraggable; r=smaug See https://w3c.github.io/pointerevents/#the-pointercancel-event. Differential Revision: https://phabricator.services.mozilla.com/D93294 --- dom/events/PointerEventHandler.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/dom/events/PointerEventHandler.cpp b/dom/events/PointerEventHandler.cpp index b419464ddc92..423e0a348544 100644 --- a/dom/events/PointerEventHandler.cpp +++ b/dom/events/PointerEventHandler.cpp @@ -122,10 +122,6 @@ void PointerEventHandler::UpdateActivePointerState(WidgetMouseEvent* aEvent) { void PointerEventHandler::SetPointerCaptureById(uint32_t aPointerId, Element* aElement) { MOZ_ASSERT(aElement); - if (MouseEvent_Binding::MOZ_SOURCE_MOUSE == GetPointerType(aPointerId)) { - PresShell::SetCapturingContent(aElement, CaptureFlags::PreventDragStart); - } - PointerCaptureInfo* pointerCaptureInfo = GetPointerCaptureInfo(aPointerId); if (pointerCaptureInfo) { pointerCaptureInfo->mPendingElement = aElement; @@ -146,10 +142,6 @@ PointerCaptureInfo* PointerEventHandler::GetPointerCaptureInfo( void PointerEventHandler::ReleasePointerCaptureById(uint32_t aPointerId) { PointerCaptureInfo* pointerCaptureInfo = GetPointerCaptureInfo(aPointerId); if (pointerCaptureInfo && pointerCaptureInfo->mPendingElement) { - if (MouseEvent_Binding::MOZ_SOURCE_MOUSE == GetPointerType(aPointerId)) { - // XXX Why do we need CaptureFlags::PreventDragStart here? - PresShell::SetCapturingContent(nullptr, CaptureFlags::PreventDragStart); - } pointerCaptureInfo->mPendingElement = nullptr; } }