This provides feedback to the user, otherwise nothing happens and the user doesn't know if their input was accepted or not. This matches what Chrome does.
We add a new flag for ZoomToRect that only double tap uses. We also need to add the cursor position to the ZoomTarget struct as that is what we will be zooming in on. (CalculateRectToZoomTo has a little bit of refactoring to calculate this point sooner and without an intermediate variable.)
The rest of the patch is some logic in ZoomToRect to decide when to do this, and some math to compute the zoom to rect (which is similar to the zoom out code).
Differential Revision: https://phabricator.services.mozilla.com/D116370
This is essentially dead-code removal. Since the GetNormalizedAppVersion()
now always returns 86, the value of the `migration` variable in
GetMouseWheelAnimationDurations() is always 100. And thus the function
always returns the unmodified minMS and maxMS values stored in the prefs.
We can therefore remove the function entirely and just use the pref
values directly in the callers.
Differential Revision: https://phabricator.services.mozilla.com/D116322
This is accomplished by the overscroll transform being part of the visual
component of the root content APZC's async transform.
We were already doing this right in AsyncPanZoomController (as of bug
1699868), but the call sites in AsyncCompositionManager needed to be
updated.
Differential Revision: https://phabricator.services.mozilla.com/D112221
This is accomplished by the overscroll transform being part of the visual
component of the root content APZC's async transform.
We were already doing this right in AsyncPanZoomController (as of bug
1699868), but the call sites in AsyncCompositionManager needed to be
updated.
Differential Revision: https://phabricator.services.mozilla.com/D112221
If we double tap on an element that is narrower than the viewport at maximum we can get into a situation where we zoom on part (say the bottom half) of that element but we could easily fit the entire element.
This happens because the code that calculate the rect to zoom to (CalculateRectToZoomTo) doesn't know about the maximum zoom. So it proceeds as though we will fit the width of the element. Under that assumption we will have to cut off part of the element vertically, so the code centers the rect on the users tap point.
This ends up cutting off part of the element vertically when it is clear that the whole element can fit on screen, which is a pretty ugly result.
This is not my favourite patch. This seemed to make the most sense. Another option I considered was passing the tap point through to AsyncPanZoomController::ZoomToRect but I think this approach came out better: the calculation all happens in one place at one time.
Differential Revision: https://phabricator.services.mozilla.com/D110538
We do want APZEventResult to have a valid mHandledResult in the case of
nsEventStatus_eConsumeDoDefault.
Note that when we call SetStatusAsConsumeDoDefault() with a InputBlockState,
in ReceiveScrollWheelInput() for example, we need to keep the block alive there,
so each block is now RefPtr-ed instead of a raw pointer in such functions (the
raw pointer is sometimes the active one (mActiveWheelBlock etc.) which will be
discarded in ProcessQueue()).
Differential Revision: https://phabricator.services.mozilla.com/D103417
Thus, we can easily get more information from ReceiveInputEvent calls by adding
the information into APZEventResult such as overscroll-behavior etc. (instead
of adding more arguments to ReceiveInputEvent)
Differential Revision: https://phabricator.services.mozilla.com/D103414
We do want APZEventResult to have a valid mHandledResult in the case of
nsEventStatus_eConsumeDoDefault.
Note that when we call SetStatusAsConsumeDoDefault() with a InputBlockState,
in ReceiveScrollWheelInput() for example, we need to keep the block alive there,
so each block is now RefPtr-ed instead of a raw pointer in such functions (the
raw pointer is sometimes the active one (mActiveWheelBlock etc.) which will be
discarded in ProcessQueue()).
Differential Revision: https://phabricator.services.mozilla.com/D103417
Thus, we can easily get more information from ReceiveInputEvent calls by adding
the information into APZEventResult such as overscroll-behavior etc. (instead
of adding more arguments to ReceiveInputEvent)
Differential Revision: https://phabricator.services.mozilla.com/D103414
Note that there's still a little plugin related code in
widget/ and gfx/ etc after this. That can be removed
once we remove plugin support from dom/ etc.
The removal from layout/ should be pretty complete though.
Differential Revision: https://phabricator.services.mozilla.com/D102140
This ID allows the compositor to track per-frame information from frame
generation, through APZ sampling, to the NotifyDidRender notification.
Differential Revision: https://phabricator.services.mozilla.com/D97535
This change has a couple of tests but they are for scrollable/non-scrollable
contents, they are not for non-scrollable contents but covered by the dynamic
toolbar cases, e.g. 100vh body element. Those cases will be introduced in the
subsequent change.
Differential Revision: https://phabricator.services.mozilla.com/D93915
Moving the ExternalPixel types from APZPublicUtils.h to Units.h to
reduce the transitive include graph from that dependency.
Signed-off-by: Joey Salazar <grey.lila@yahoo.com>
Differential Revision: https://phabricator.services.mozilla.com/D94932
The displayport is aligned to screen pixels by an alignment number; there was
code to increase that alignment number for the WebRender codepath. This is
desirable because it causes the displayport to move less frequently, which
provides better performance characteristics with WebRender. However, the
way that was implemented, it was possible for the aligned displayport to not
completely enclose the unaligned displayport, which could then result in
perma-checkerboarding.
This patch removes that code and replaces it with a simpler approach to scale
up the existing alignment number by a factor based on the size of the scroller's
base rect (roughly how much of the scroller is visible to the user).
This does make the displayports larger, more so for scrollers with more visible
area. This has negative performance implications, so we mitigate that by also
scaling down the displayport margin multiplier by the same scaling factor. This
isn't perfect, but seems to work well enough in practice.
Differential Revision: https://phabricator.services.mozilla.com/D90503
This is just moving code to make it reusable in APZ. As part of this, I replace
use of Preferences::* with the StaticPrefs::* API, because we can't use
Preferences:: in the GPU process and we'll want to be able to invoke this code
from there.
Differential Revision: https://phabricator.services.mozilla.com/D89665
This introduces a linear interpolation when computing the wheel animation
durations, based on the migration percentage of the user. Initially the
migration percentage defaults to 100 (fully migrated) for new users and for
existing users who have customized these prefs. The migration percentage
defaults to zero for existing users without customizations, so they will
still get the old default values of min=200,max=400. Over time we can adjust
the migration pref clamping to move that percentage up and migrate those
users to get the new values.
Differential Revision: https://phabricator.services.mozilla.com/D88163
GeckoView uses these flags for the same purpose: to determine
whether or not to allow certain effects, such as pull to refresh
or dynamic toolbar movement, that should be limited to cases
where an event manipulates the root scrollable.
In a subsequent patch, we will enhance the API between APZ and
GeckoView such that in cases where we don't know for sure whether
an event will manipulate the root scrollable until it is
dispatched to content, we tell GV the answer asynchronously.
This is easier if there is only one flag to report.
Differential Revision: https://phabricator.services.mozilla.com/D79929
GeckoView uses these flags for the same purpose: to determine
whether or not to allow certain effects, such as pull to refresh
or dynamic toolbar movement, that should be limited to cases
where an event manipulates the root scrollable.
In a subsequent patch, we will enhance the API between APZ and
GeckoView such that in cases where we don't know for sure whether
an event will manipulate the root scrollable until it is
dispatched to content, we tell GV the answer asynchronously.
This is easier if there is only one flag to report.
Differential Revision: https://phabricator.services.mozilla.com/D79929
AsyncCompositionManager is a Layers-only component, and a bunch of
APZ code common to Layers and WR was including it for this one
utility.
Differential Revision: https://phabricator.services.mozilla.com/D87405
By moving the few things that need to be exposed to other components
to APZPublicUtils.h, APZUtils.h becomes much less widely included
(and thus changing it triggers a quicker recompile) while retaining
most of its utilities.
Differential Revision: https://phabricator.services.mozilla.com/D87404
GeckoView uses these flags for the same purpose: to determine
whether or not to allow certain effects, such as pull to refresh
or dynamic toolbar movement, that should be limited to cases
where an event manipulates the root scrollable.
In a subsequent patch, we will enhance the API between APZ and
GeckoView such that in cases where we don't know for sure whether
an event will manipulate the root scrollable until it is
dispatched to content, we tell GV the answer asynchronously.
This is easier if there is only one flag to report.
Differential Revision: https://phabricator.services.mozilla.com/D79929
This makes the sample time more "strongly typed" by using a variant-style
class instead of a raw TimeStamp. The sample time can come from different
sources (vsync, testing, Now()) and it is useful to save that information
as we pass around the sample time. It would have been helpful with some
of the debugging I did recently, and it also is needed for the next patch.
Differential Revision: https://phabricator.services.mozilla.com/D86244