mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 942246 - Event fluffing fails to generate a click under certain conditions. r=smaug
This commit is contained in:
parent
293391fdad
commit
738ac97473
@ -2621,6 +2621,7 @@ nsFrame::HandlePress(nsPresContext* aPresContext,
|
||||
// the mouse on the nearest scrollable frame. If there isn't a scrollable
|
||||
// frame, or something else is already capturing the mouse, there's no
|
||||
// reason to capture.
|
||||
bool hasCapturedContent = false;
|
||||
if (!nsIPresShell::GetCapturingContent()) {
|
||||
nsIScrollableFrame* scrollFrame =
|
||||
nsLayoutUtils::GetNearestScrollableFrame(this,
|
||||
@ -2630,6 +2631,7 @@ nsFrame::HandlePress(nsPresContext* aPresContext,
|
||||
nsIFrame* capturingFrame = do_QueryFrame(scrollFrame);
|
||||
nsIPresShell::SetCapturingContent(capturingFrame->GetContent(),
|
||||
CAPTURE_IGNOREALLOWED);
|
||||
hasCapturedContent = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2673,6 +2675,13 @@ nsFrame::HandlePress(nsPresContext* aPresContext,
|
||||
// let the user move the caret by tapping and dragging.
|
||||
if (!offsets.content->IsEditable() &&
|
||||
Preferences::GetBool("browser.ignoreNativeFrameTextSelection", false)) {
|
||||
// On touchables devices, mouse events are generated if the gesture is a tap.
|
||||
// Such events are never going to generate a drag action, so let's release
|
||||
// captured content if any.
|
||||
if (hasCapturedContent) {
|
||||
nsIPresShell::SetCapturingContent(nullptr, 0);
|
||||
}
|
||||
|
||||
return fc->HandleClick(offsets.content, offsets.StartOffset(),
|
||||
offsets.EndOffset(), false, false,
|
||||
offsets.associateWithNext);
|
||||
|
Loading…
Reference in New Issue
Block a user