Repository navigation
script: Add DragGesture and DragHandler abstractions - #47329
Merged
Merged
Conversation
mrobinson
force-pushed
the
drag-handler
branch
2 times, most recently
from
August 18, 2026 13:38
69475f4 to
95c3317
Compare
SimonSapin
approved these changes
Aug 18, 2026
| } | ||
| } | ||
|
|
||
| #[cfg_attr(crown, expect(crown::unrooted_must_root))] |
Member
There was a problem hiding this comment.
Why is triggering this lint ok? Should this get a &NoGC parameter?
Member
Author
There was a problem hiding this comment.
This is necessary because it takes a "must root" type as an argument. It's fine to accept this because it is placed immediately into a traced struct.
This change adds two abstractions that allow drags to be updated even when they extend outside the boundaries of the element that starts them. This allows continuing to select text in an input box even when the cursor leaves the box. In addition, this will make it more straight-forward to properly implement document selection which will be different variant of `DragHandler`. Notes: - This cannot reuse the pointer capture code because these kind of drag gestures do not change the target of input events. - Cross document drags are not supported yet. - Moving drag updates to before event handling means that `preventDefault()` on the input events won't prevent drag updates, which is what we want. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Simon Sapin <simon@igalia.com>
mrobinson
force-pushed
the
drag-handler
branch
from
August 18, 2026 20:14
95c3317 to
730f4ee
Compare
mrobinson
marked this pull request as ready for review
August 18, 2026 20:14
mrobinson
enabled auto-merge
August 18, 2026 20:15
RichardTjokroutomo
pushed a commit
to RichardTjokroutomo/servo
that referenced
this pull request
Oct 6, 2026
This change adds two abstractions that allow drags to be updated even when they extend outside the boundaries of the element that starts them. This allows continuing to select text in an input box even when the cursor leaves the box. In addition, this will make it more straight-forward to properly implement document selection which will be different variant of `DragHandler`. Notes: - This cannot reuse the pointer capture code because these kind of drag gestures do not change the target of input events. - Cross document drags are not supported yet. - Moving drag updates to before event handling means that `preventDefault()` on the input events won't prevent drag updates, which is what we want. Testing: This change includes new and updated Servo-specific WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Simon Sapin <simon@igalia.com>
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
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 two abstractions that allow drags to be updated even
when they extend outside the boundaries of the element that starts them.
This allows continuing to select text in an input box even when the
cursor leaves the box. In addition, this will make it more
straight-forward to properly implement document selection which will be
different variant of
DragHandler.Notes:
gestures do not change the target of input events.
preventDefault()on the input events won't prevent drag updates,which is what we want.
Testing: This change includes new and updated Servo-specific WPT tests.