Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Issue 300863002: mac: History swiping doesn't work right with iframes. (Closed)

Created:
6 years, 7 months ago by erikchen
Modified:
6 years, 6 months ago
Reviewers:
Avi (use Gerrit), Nico
CC:
chromium-reviews, yusukes+watch_chromium.org, yukishiino+watch_chromium.org, jam, penghuang+watch_chromium.org, nona+watch_chromium.org, darin-cc_chromium.org, James Su, miu+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

mac: History swiping doesn't work right with iframes. This CL was originally intended to be a reland of https://codereview.chromium.org/227043012/. There have been sufficient changes that this CL should be given a full review. In the previous behavior, the history swiper tried to be very conservative about the gestures it recognized as a history swipe. Once a gesture was recognized, events would be consumed and not sent to the renderer. This has two fundamental flaws. 1. It is difficult to tell whether a gesture is going to be a history swipe from the initial events. Waiting for longer introduces lag in the appearance of the history swipe UI, which is janky. 2. NSEvents with phase NSEventPhaseChanged are coalesced before they are sent to the renderer. This loss of information makes it more difficult to determine which of the uncoalesced events the renderer would have handled, which adds to the difficulty of determining whether a gesture should be recognized as a history swipe. In the new behavior, the history swiper (in conjunction with the logic in ScrollElasticityController in Blink) aggressively attempts to recognize the initial events of every gesture as the beginning events of a history swipe. The recognition process is primarily gated by whether the renderer consumes the NSEvent with phase NSEventPhaseBegan. Once a gesture has been recognized as a potential history swipe, the history swipe UI is shown, and the history swiper will process new events to update its internal state, but the events will continue to be forwarded to the renderer. While the history swiper is determining whether the gesture was actually intended as a horizontal, history swipe, both itself and the renderer will get to process events and update their respective UIs. To combat the ease with which history swiping was entered, the history swiper aggressively attempts to cancel out of history swiping. If the gesture progresses sufficiently such that it appears to be intended for a history swipe, then the events will be consumed and no longer forwarded to the renderer. As an aside: the renderer callbacks for scrollOffsetPinnedToLeft and setHasHorizontalScrollbar are no longer useful. The former was not accurate to begin with, since the callback only occured when the content scrolled, but not after a history navigation. They should be removed at a convenient time. BUG=321437 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=274906

Patch Set 1 : Spacing. #

Patch Set 2 : Fix unit tests. #

Total comments: 13

Patch Set 3 : Comments from avi. #

Patch Set 4 : Rebase against top of tree. #

Total comments: 2

Patch Set 5 : Comment from thakis. #

Patch Set 6 : Rebase against top of tree. #

Messages

Total messages: 16 (0 generated)
erikchen
avi: Please review.
6 years, 6 months ago (2014-05-28 23:14:10 UTC) #1
Avi (use Gerrit)
I pretty much only have nits. LGTM. About the scrollbar plumbing and stuff that will ...
6 years, 6 months ago (2014-05-29 15:02:01 UTC) #2
erikchen
https://codereview.chromium.org/300863002/diff/180001/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h File chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h (right): https://codereview.chromium.org/300863002/diff/180001/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h#newcode110 chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h:110: // -> kPotential. On 2014/05/29 15:02:01, Avi wrote: > ...
6 years, 6 months ago (2014-05-29 20:42:38 UTC) #3
erikchen
thakis: Looking for an OWNER review of chrome/browser/renderer_host/*
6 years, 6 months ago (2014-05-29 20:45:26 UTC) #4
Avi (use Gerrit)
https://codereview.chromium.org/300863002/diff/180001/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.mm File chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.mm (right): https://codereview.chromium.org/300863002/diff/180001/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.mm#newcode32 chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.mm:32: } // namespace Gotcha. Good to hear that you're ...
6 years, 6 months ago (2014-05-29 20:48:56 UTC) #5
Nico
lgtm https://codereview.chromium.org/300863002/diff/220001/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h File chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h (right): https://codereview.chromium.org/300863002/diff/220001/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h#newcode48 chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h:48: kCancelled (nit: keep a trailling ',', then it's ...
6 years, 6 months ago (2014-05-30 00:41:36 UTC) #6
erikchen
https://codereview.chromium.org/300863002/diff/220001/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h File chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h (right): https://codereview.chromium.org/300863002/diff/220001/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h#newcode48 chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h:48: kCancelled On 2014/05/30 00:41:37, Nico (traveling) wrote: > (nit: ...
6 years, 6 months ago (2014-05-30 00:54:01 UTC) #7
erikchen
The CQ bit was checked by erikchen@chromium.org
6 years, 6 months ago (2014-06-04 17:23:51 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/erikchen@chromium.org/300863002/300001
6 years, 6 months ago (2014-06-04 17:25:00 UTC) #9
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_chromium_gn_compile_rel on tryserver.chromium ...
6 years, 6 months ago (2014-06-04 20:38:01 UTC) #10
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-04 20:44:25 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_gn_rel on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/linux_chromium_gn_rel/builds/13351)
6 years, 6 months ago (2014-06-04 20:44:26 UTC) #12
erikchen
The CQ bit was checked by erikchen@chromium.org
6 years, 6 months ago (2014-06-04 20:48:41 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/erikchen@chromium.org/300863002/300001
6 years, 6 months ago (2014-06-04 20:52:02 UTC) #14
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_chromium_gn_rel on tryserver.chromium ...
6 years, 6 months ago (2014-06-04 21:02:26 UTC) #15
commit-bot: I haz the power
6 years, 6 months ago (2014-06-04 21:13:30 UTC) #16
Message was sent while issue was closed.
Change committed as 274906

Powered by Google App Engine
This is Rietveld 408576698