Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: cherry-pick 05a0d99c9715 from chromium (#35929)
* chore: cherry-pick 05a0d99c9715 from chromium * chore: cherry-pick 05a0d99c9715 from chromium Co-authored-by: Adam Prasil <adamprasil@microsoft.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
- Loading branch information
1 parent
53b6270
commit 0858a08
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: David Bokan <bokan@chromium.org> | ||
Date: Thu, 28 Jul 2022 18:09:13 +0000 | ||
Subject: Prevent handling input for provisional frames | ||
|
||
Bug: 1347644,1322812 | ||
Change-Id: Ifd60f6aa593ce23ca6cbb65552fc9fb8f8690035 | ||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3791883 | ||
Commit-Queue: David Bokan <bokan@chromium.org> | ||
Reviewed-by: Dave Tapuska <dtapuska@chromium.org> | ||
Cr-Commit-Position: refs/heads/main@{#1029361} | ||
|
||
diff --git a/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc b/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc | ||
index fe775337fbc22817d7489df143821eea2d9425ec..13a241273090e54fabdba9d82510e36d2386c4a4 100644 | ||
--- a/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc | ||
+++ b/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc | ||
@@ -2460,10 +2460,15 @@ WebInputEventResult WebFrameWidgetImpl::HandleInputEvent( | ||
DCHECK(!WebInputEvent::IsTouchEventType(input_event.GetType())); | ||
CHECK(LocalRootImpl()); | ||
|
||
+ // Clients shouldn't be dispatching events to a provisional frame but this | ||
+ // can happen. Ensure that event handling can assume we're in a committed | ||
+ // frame. | ||
+ if (IsProvisional()) | ||
+ return WebInputEventResult::kHandledSuppressed; | ||
+ | ||
// Only record metrics for the root frame. | ||
- if (ForTopMostMainFrame()) { | ||
+ if (ForTopMostMainFrame()) | ||
GetPage()->GetVisualViewport().StartTrackingPinchStats(); | ||
- } | ||
|
||
// If a drag-and-drop operation is in progress, ignore input events except | ||
// PointerCancel and GestureLongPress. |