Bug 1482825 - Only prevent dispatching mouse-move events targeted at a slider frame to web content, if the scrollbar is being dragged. r=smaug

Otherwise, if the mouse is just moving over the scrollbar, mouse-move
events are dispatched to web content.

Differential Revision: https://phabricator.services.mozilla.com/D4800

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Botond Ballo 2018-09-01 15:00:31 +00:00
Родитель fa4326d0f2
Коммит 08a635ccc8
2 изменённых файлов: 4 добавлений и 3 удалений

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

@ -1196,7 +1196,7 @@ nsSliderFrame::DragThumb(bool aGrabMouseEvents)
}
bool
nsSliderFrame::isDraggingThumb()
nsSliderFrame::isDraggingThumb() const
{
return (nsIPresShell::GetCapturingContent() == GetContent());
}
@ -1567,7 +1567,8 @@ nsSliderFrame::OnlySystemGroupDispatch(EventMessage aMessage) const
// If we are in a native anonymous subtree, do not dispatch mouse-move events
// targeted at this slider frame to web content. This matches the behaviour
// of other browsers.
return aMessage == eMouseMove && GetContent()->IsInNativeAnonymousSubtree();
return aMessage == eMouseMove && isDraggingThumb() &&
GetContent()->IsInNativeAnonymousSubtree();
}
NS_IMPL_ISUPPORTS(nsSliderMediator,

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

@ -162,7 +162,7 @@ private:
void DragThumb(bool aGrabMouseEvents);
void AddListener();
void RemoveListener();
bool isDraggingThumb();
bool isDraggingThumb() const;
void SuppressDisplayport();
void UnsuppressDisplayport();