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
This commit is contained in:
Edgar Chen 2020-10-16 12:27:55 +00:00
Родитель 4590354bf7
Коммит fd2c481654
1 изменённых файлов: 0 добавлений и 8 удалений

Просмотреть файл

@ -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;
}
}