Revert "Remove code to store the last popup transiently in WebFrameWidgetImpl"
This reverts commit 573f46751824b8dcfbec675291eacc8c581ae441.
Reason for revert: Seems to be causing EffectiveTouchActionPropagatesAcrossNestedFrames to fail https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8927388648425983952/+/steps/content_browsertests_on_Intel_GPU_on_Mac_on_Mac-10.12.6/0/logs/SitePerProcessBrowserTouchActionTest.EffectiveTouchActionPropagatesAcrossNestedFrames/0
Original change's description:
> Remove code to store the last popup transiently in WebFrameWidgetImpl
>
> This code was copied over from WebViewImpl when adding the HidePopups
> call in order to have a pinch zoom or scroll tap outside the current
> popup in a non-main-frame-local-rooted iframe hide the current popup.
>
> This is modifying state on WebViewImpl meant to track between TapDown
> and Tap, to avoid the Tap showing a popup that was hidden by TapDown.
>
> WebFrameWidgetImpl does not show popups on Tap, and if it did, it
> should track this transient state locally not on WebViewImpl.
>
> Also remove the undocumented FALLTHROUGH which was not explained
> in 671732 as it now goes to nothing.
>
> R=dcheng@chromium.org
>
> Change-Id: I9d67539cf0afbb9db239b73bf83418e1a877e6db
> Bug: 912193, 671732
> Reviewed-on: https://chromium-review.googlesource.com/c/1372539
> Reviewed-by: James MacLean <wjmaclean@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: danakj <danakj@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#615708}
TBR=danakj@chromium.org,dcheng@chromium.org,wjmaclean@chromium.org
Change-Id: Ifddbb605fc6165505774105d5618d57b62e3159c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 912193, 671732
Reviewed-on: https://chromium-review.googlesource.com/c/1372110
Reviewed-by: Alice Boxhall <aboxhall@chromium.org>
Commit-Queue: Alice Boxhall <aboxhall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615783}
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 fbc3fb4..5e3cd98 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
@@ -882,15 +882,15 @@
// Touch pinch zoom and scroll on the page (outside of a popup) must hide
// the popup. In case of a touch scroll or pinch zoom, this function is
// called with GestureTapDown rather than a GSB/GSU/GSE or GPB/GPU/GPE.
- // WebViewImpl takes additional steps to avoid the following GestureTap
- // from re-opening the popup being closed here, but since GestureTap will
- // unconditionally close the current popup here, it is not used/needed.
- // TODO(wjmaclean): We should maybe mirror what WebViewImpl does, the
- // HandleGestureEvent() needs to happen inside or before the GestureTap
- // case to do so.
+ // When we close a popup because of a GestureTapDown, we also save it so
+ // we can prevent the following GestureTap from immediately reopening the
+ // same popup.
+ view_impl->SetLastHiddenPagePopup(view_impl->GetPagePopup());
View()->HidePopups();
- break;
+ FALLTHROUGH;
case WebInputEvent::kGestureTapCancel:
+ View()->SetLastHiddenPagePopup(nullptr);
+ break;
case WebInputEvent::kGestureShowPress:
break;
case WebInputEvent::kGestureDoubleTap: