Skip to content

Very basic touch events and touch scrolling - #7204

Merged
bors-servo merged 4 commits into
servo:masterfrom
mbrubeck:touchevent
Oct 22, 2015
Merged

bors-servo merged 4 commits into
servo:masterfrom
mbrubeck:touchevent

Conversation

@mbrubeck

Copy link
Copy Markdown
Contributor

This implements just enough of Touch Events to enable scrolling on Android without regressing basic single-touch interaction like clicking on links.

Dragging a page will scroll it, unless the page calls preventDefault on the "touchstart" event.

Does not yet support pinch zooming or other multi-touch gestures or events.

Includes a -Z convert-mouse-to-touch command line flag for testing on non-touch platforms. This is also enabled by default on Android because Glutin currently translates touch input to mouse events on Android.

Review on Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Aug 14, 2015
@mbrubeck

Copy link
Copy Markdown
Contributor Author

Fixes #7036.

@mbrubeck

Copy link
Copy Markdown
Contributor Author

If this PR is used for the upcoming demos, it also depends on servo/servoexperiments.com#2.

@mbrubeck
mbrubeck force-pushed the touchevent branch 3 times, most recently from 268674c to 2422c60 Compare August 14, 2015 03:41
@metajack

Copy link
Copy Markdown
Collaborator
/home/jack/src/servo/components/compositing/compositor.rs:15:5: 15:27 warning: unused import, #[warn(unused_imports)] on by default
/home/jack/src/servo/components/compositing/compositor.rs:15 use euclid::length::Length;
                                                                 ^~~~~~~~~~~~~~~~~~~~~~

@mbrubeck
mbrubeck force-pushed the touchevent branch 3 times, most recently from 2fa28a1 to 05e5a34 Compare August 14, 2015 04:14
@metajack

Copy link
Copy Markdown
Collaborator

Dragging in the physics demo on a device doesn't seem to work.

@mbrubeck

Copy link
Copy Markdown
Contributor Author

Dragging in the physics demo on a device doesn't seem to work.

This is working for me, though it's a bit slower to react than desktop (I think partly because of how the page is "zoomed out" on mobile, so the physical speed of the particles is smaller).

@metajack

Copy link
Copy Markdown
Collaborator

I'll retest this again today.

Have you gotten the photo gallery slider to work on mobile?

@mbrubeck

Copy link
Copy Markdown
Contributor Author

Have you gotten the photo gallery slider to work on mobile?

No. It's working in other mobile browsers, but not in Servo. Investigating...

@mbrubeck

Copy link
Copy Markdown
Contributor Author

Have you gotten the photo gallery slider to work on mobile?

Fixed by adding in a missing reflow() call in the Servo code.

@bors-servo

Copy link
Copy Markdown
Contributor

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

@highfive highfive added S-needs-rebase There are merge conflict errors. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Aug 16, 2015
@metajack

metajack commented Sep 1, 2015

Copy link
Copy Markdown
Collaborator

r? @glennw

@mbrubeck
mbrubeck force-pushed the touchevent branch 2 times, most recently from d984dbc to cfa6830 Compare September 1, 2015 17:37
@glennw

glennw commented Sep 2, 2015

Copy link
Copy Markdown
Member

Reviewed 6 of 10 files at r2.
Review status: 6 of 18 files reviewed at latest revision, all discussions resolved, all commit checks successful.


Comments from the review on Reviewable.io

@glennw

glennw commented Sep 2, 2015

Copy link
Copy Markdown
Member

I've reviewed the compositor parts, and I've also tested this successfully on an android device.

Who would like to look at the DOM parts - @jdm @Ms2ger or @nox ?

@bors-servo

Copy link
Copy Markdown
Contributor

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

@highfive highfive added S-needs-rebase There are merge conflict errors. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Sep 2, 2015
@Ms2ger Ms2ger assigned Ms2ger and unassigned glennw Sep 2, 2015
@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Oct 22, 2015
@jdm

jdm commented Oct 22, 2015

Copy link
Copy Markdown
Member

Looks like dom/events/EventTarget-dispatchEvent.html might have new test results, too.
Edit: Nevermind, that relies on createEvent.

@bors-servo

Copy link
Copy Markdown
Contributor

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

@highfive highfive added S-needs-rebase There are merge conflict errors. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Oct 22, 2015
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Oct 22, 2015
This is currently limited to simple single-touch actions. It does not include
momentum scrolling or pinch zooming.
This is enabled by default on Android, because Glutin currently sends mouse
events instead of touch events on Android.  It's also useful for testing on
non-touch platforms.
@mbrubeck mbrubeck removed the S-needs-rebase There are merge conflict errors. label Oct 22, 2015
@mbrubeck

Copy link
Copy Markdown
Contributor Author

Modified interfaces.html, and added a new commit implementing createTouch which allows some of the WPT tests to run (such as they are). Filed issue #8160 for document.createEvent.


Review status: 6 of 21 files reviewed at latest revision, all discussions resolved, some commit checks pending.


Comments from the review on Reviewable.io

@jdm

jdm commented Oct 22, 2015

Copy link
Copy Markdown
Member

@bors-servo: r+


Reviewed 9 of 10 files at r5.
Review status: 15 of 21 files reviewed at latest revision, all discussions resolved, all commit checks successful.


Comments from the review on Reviewable.io

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 316802e has been approved by jdm

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Oct 22, 2015
@larsbergstrom

Copy link
Copy Markdown
Contributor

@bors-servo retry force

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 316802e with merge dcd207f...

bors-servo pushed a commit that referenced this pull request Oct 22, 2015
Very basic touch events and touch scrolling

This implements just enough of [Touch Events](http://w3c.github.io/touch-events/) to enable scrolling on Android without regressing basic single-touch interaction like clicking on links.

Dragging a page will scroll it, unless the page calls `preventDefault` on the "touchstart" event.

Does **not** yet support pinch zooming or other multi-touch gestures or events.

Includes a `-Z convert-mouse-to-touch` command line flag for testing on non-touch platforms.  This is also enabled by default on Android because Glutin currently translates touch input to mouse events on Android.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7204)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt

@bors-servo
bors-servo merged commit 316802e into servo:master Oct 22, 2015
@mbrubeck
mbrubeck deleted the touchevent branch May 11, 2016 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants