Descriptionmac: 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)
|