Skip to content
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

Send touch events to root pipeline, and allow forwarding to iframes. #13633

Merged
merged 1 commit into from Oct 8, 2016

Conversation

@glennw
Copy link
Member

glennw commented Oct 7, 2016

Instead of letting the compositor try to find the correct scroll
layer for a touch event, switch touch events to work the same way
that mouse events do.

Touch events are now dispatched to the root pipeline, and then
forwarded to child iframes as required.


This change is Reviewable

@highfive
Copy link

highfive commented Oct 7, 2016

Heads up! This PR modifies the following files:

  • @asajeffrey: components/constellation/constellation.rs
  • @KiChjang: components/script/script_thread.rs, components/script/dom/document.rs, components/script_traits/script_msg.rs, components/script_traits/script_msg.rs
@highfive
Copy link

highfive commented Oct 7, 2016

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@glennw
Copy link
Member Author

glennw commented Oct 7, 2016

r? @mbrubeck

This contains the event forwarding for touch events we discussed on IRC. See #8811 for details.

I've tested this on my (Linux) touchscreen laptop and as far as I can tell it's all working as previously. I've tested touch events, and touch scrolling on normal pages, and also within iframes (via browser.html).

@highfive highfive assigned mbrubeck and unassigned pcwalton Oct 7, 2016
@bors-servo
Copy link
Contributor

bors-servo commented Oct 7, 2016

The latest upstream changes (presumably #13596) made this pull request unmergeable. Please resolve the merge conflicts.

@mbrubeck
Copy link
Contributor

mbrubeck commented Oct 7, 2016

-S-awaiting-review +S-needs-code-changes

r=mbrubeck with a minor nit fixed:


Reviewed 4 of 5 files at r1.
Review status: 4 of 5 files reviewed at latest revision, 5 unresolved discussions, some commit checks failed.


components/compositing/compositor.rs, line 1534 at r1 (raw file):

        self.send_event_to_root_pipeline(TouchEvent(TouchEventType::Down,
                                                    identifier,
                                                    translated_point.to_untyped()));

Nit: .to_untyped() is not needed here, because translated_point is already "untyped."


components/compositing/compositor.rs, line 1561 at r1 (raw file):

                self.send_event_to_root_pipeline(TouchEvent(TouchEventType::Move,
                                                            identifier,
                                                            translated_point.to_untyped()));

.to_untyped() not needed.


components/compositing/compositor.rs, line 1572 at r1 (raw file):

        self.send_event_to_root_pipeline(TouchEvent(TouchEventType::Up,
                                                    identifier,
                                                    translated_point.to_untyped()));

.to_untyped() not needed.


components/compositing/compositor.rs, line 1585 at r1 (raw file):

        self.send_event_to_root_pipeline(TouchEvent(TouchEventType::Cancel,
                                                    identifier,
                                                    translated_point.to_untyped()));

.to_untyped() not needed.


components/compositing/compositor.rs, line 1595 at r1 (raw file):

            let dppx = self.page_zoom * self.device_pixels_per_screen_px();
            let translated_point = (point / dppx).to_untyped();
            self.send_event_to_root_pipeline(TouchpadPressureEvent(translated_point.to_untyped(),

.to_untyped() not needed.


Comments from Reviewable

Instead of letting the compositor try to find the correct scroll
layer for a touch event, switch touch events to work the same way
that mouse events do.

Touch events are now dispatched to the root pipeline, and then
forwarded to child iframes as required.
@glennw glennw force-pushed the glennw:forward-touch-events branch from 8f0db71 to 291af9d Oct 7, 2016
@glennw
Copy link
Member Author

glennw commented Oct 7, 2016

Addressed comments and rebased.

@jdm jdm removed the S-needs-rebase label Oct 7, 2016
@mbrubeck
Copy link
Contributor

mbrubeck commented Oct 8, 2016

@bors-servo r+


Reviewed 1 of 5 files at r1, 3 of 3 files at r2.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@bors-servo
Copy link
Contributor

bors-servo commented Oct 8, 2016

📌 Commit 291af9d has been approved by mbrubeck

@bors-servo
Copy link
Contributor

bors-servo commented Oct 8, 2016

Testing commit 291af9d with merge 9d3fc76...

bors-servo added a commit that referenced this pull request Oct 8, 2016
Send touch events to root pipeline, and allow forwarding to iframes.

Instead of letting the compositor try to find the correct scroll
layer for a touch event, switch touch events to work the same way
that mouse events do.

Touch events are now dispatched to the root pipeline, and then
forwarded to child iframes as required.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13633)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Oct 8, 2016

@bors-servo bors-servo merged commit 291af9d into servo:master Oct 8, 2016
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@glennw glennw deleted the glennw:forward-touch-events branch Dec 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants
You can’t perform that action at this time.