Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: cherry-pick 05a0d99c9715 from chromium #35929

Merged
merged 4 commits into from Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions patches/chromium/.patches
Expand Up @@ -126,3 +126,4 @@ cherry-pick-51daffbf5cd8.patch
dpwa_enable_window_controls_overlay_by_default.patch
create_browser_v8_snapshot_file_name_fuse.patch
cherry-pick-1eb1e18ad41d.patch
cherry-pick-05a0d99c9715.patch
34 changes: 34 additions & 0 deletions patches/chromium/cherry-pick-05a0d99c9715.patch
@@ -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.