-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
compositing: Fully implement pinch zoom #40083
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
🔨 Triggering try run (#18721878997) for Linux (WPT), OpenHarmony |
|
🔨 Triggering try run (#18721882069) for Android |
|
Test results for linux-wpt from try job (#18721878997): Flaky unexpected result (23)
Stable unexpected results that are known to be intermittent (18)
|
|
✨ Try run (#18721878997) succeeded. |
|
✨ Try run (#18721882069) succeeded. |
atbrakhi
approved these changes
Oct 23, 2025
This change adds a full implementation of pinch zoom, including center-aware zooming. Before this kind of pinch zooming was only enabled on OpenHarmony. Now all pinch zooms must come with a focal point, which determines the center point of the zoom. This enables full pinch zoom on Android and has OpenHarmony use the same system for pinch zoom. Every WebView now has a `PinchZoom` which describes the viewport of the pinch zoom and handles panning with proper chaining of zoom viewport panning to scroll layer scrolling. In addition, the collection of touch actions is simplified by storing an array and turning each into a ScrollZoomEvent when appropriate. Note: We've noticed some hard to diagnose bugs with clamping the panning viewport, but we'll tackle those later once we figure out how to reliably reproduce them. Fixes servo#4224. Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change adds a full implementation of pinch zoom, including
center-aware zooming. Before this kind of pinch zooming was only enabled
on OpenHarmony. Now all pinch zooms must come with a focal point, which
determines the center point of the zoom. This enables full pinch zoom on
Android and has OpenHarmony use the same system for pinch zoom.
Every WebView now has a
PinchZoomwhich describes the viewport of thepinch zoom and handles panning with proper chaining of zoom viewport
panning to scroll layer scrolling. In addition, the collection of touch
actions is simplified by storing an array and turning each into a
ScrollZoomEvent when appropriate.
Caveats:
viewport, but we'll tackle those later once we figure out how to
reliably reproduce them.
viewport. This will be handled in a followup.
Testing: There are currently no tests for this kind of touch interaction
as there's no way to read the pinch zoom from a WebView. It's processed
asynchronously. Once that API is added, we should be able to add some
simple tests, but many things are still unaccessible such as the pan
position in the pinch zoom viewport.
Fixes #4224.