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
parent fa4326d0f2
commit 08a635ccc8
2 changed files with 4 additions and 3 deletions

View File

@ -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,

View File

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