Skip to content

Implement WheelEvent interface - #23154

Merged
bors-servo merged 2 commits into
servo:masterfrom
robert-snakard:issue_22843
Jun 9, 2019
Merged

bors-servo merged 2 commits into
servo:masterfrom
robert-snakard:issue_22843

Conversation

@robert-snakard

@robert-snakard robert-snakard commented Apr 2, 2019 •

Copy link
Copy Markdown
Contributor

Created a new dom interface: "WheelEvent" and added WPT tests to confirm the interface works. To do this I had to do the following:

  • Create a new WheelEvent dom interface. It can be found in script/dom/wheelevent.rs and dom/webidls/WheelEvent.webidl
  • Add a new WheelEvent option to the compositor's CompositorEvent enum
  • Add a new Wheel option to the compositor's WindowEvent enum
  • Add a new WheelDelta type to the script_traits module
  • Modify the scroll_event logic. Now we send a WheelEvent before scrolling. Repeat: we send the WheelEvent notification BEFORE we send the scroll delta.
  • Add two manual wpt tests to the uievents/order-of-events test collection

  • There are tests for these changes OR
  • These changes do not require tests because ___

This change is Reviewable

@highfive

highfive commented Apr 2, 2019

Copy link
Copy Markdown

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @paulrouget (or someone else) soon.

@highfive

highfive commented Apr 2, 2019

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/mod.rs, components/script/dom/mouseevent.rs, components/script/dom/window.rs, components/script/dom/document.rs, components/script/script_thread.rs and 3 more
  • @wafflespeanut: python/servo/build_commands.py
  • @cbrewster: components/constellation/constellation.rs
  • @paulrouget: ports/servo/glutin_app/window.rs, components/servo/lib.rs, ports/servo/browser.rs, components/compositing/compositor.rs, components/compositing/windowing.rs and 1 more
  • @KiChjang: components/script/dom/mod.rs, components/script/dom/mouseevent.rs, components/script/dom/window.rs, components/script_traits/lib.rs, components/script/dom/document.rs and 3 more

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 2, 2019
@highfive

highfive commented Apr 2, 2019

Copy link
Copy Markdown

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

@robert-snakard

Copy link
Copy Markdown
Contributor Author

@jdm

@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

Error syncing changes upstream. Logs saved in error-snapshot-1554165902717.

@jdm

jdm commented Apr 2, 2019

Copy link
Copy Markdown
Member

@robert-snakard Looks like this needs to be rebased in a way that doesn't include commits which are already present on master.

@jdm jdm added the S-needs-rebase There are merge conflict errors. label Apr 2, 2019
@robert-snakard

Copy link
Copy Markdown
Contributor Author

This should just be master with 2 commits on top...

@jdm

jdm commented Apr 2, 2019

Copy link
Copy Markdown
Member

It's possible that because the @bors-servo merge commits are missing it is not actually equivalent to master. I recommend doing a hard reset to master and cherry-picking your two commits, then force pushing.

@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

Opened new PR for upstreamable changes.

Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#16199.

@jdm jdm changed the title Issue 22843 Implement WheelEvent interface Apr 2, 2019
@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

PR title changed; changed existing PR.

Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#16199.

@robert-snakard

Copy link
Copy Markdown
Contributor Author

@jdm Updated the branch version and tested on my machine, the patch still works. Do I need to do anything else?

@jdm

jdm commented Apr 8, 2019

Copy link
Copy Markdown
Member

No, we just need to review these changes now.

@jdm

jdm commented Apr 8, 2019

Copy link
Copy Markdown
Member

@paulrouget Review ping?

@jdm

jdm commented Apr 9, 2019

Copy link
Copy Markdown
Member

@bors-servo try=wpt

bors-servo pushed a commit that referenced this pull request Apr 9, 2019
Implement WheelEvent interface

Created a new dom interface: "WheelEvent" and added WPT tests to confirm the interface works. To do this I had to do the following:

- Create a new `WheelEvent` dom interface. It can be found in `script/dom/wheelevent.rs` and `dom/webidls/WheelEvent.webidl`
- Add a new `WheelEvent` option to the compositor's `CompositorEvent` enum
- Add a new `Wheel` option to the compositor's `WindowEvent` enum
- Add a new `WheelDelta` type to the `script_traits` module
- Modify the `scroll_event` logic. Now we send a `WheelEvent` before scrolling. Repeat: we send the WheelEvent notification BEFORE we send the scroll delta.
- Add two manual wpt tests to the `uievents/order-of-events` test collection

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #22843 (GitHub issue number if applicable)

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/23154)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 9e01a45 with merge cdd4cb0...

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel-css

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Apr 9, 2019
@robert-snakard

Copy link
Copy Markdown
Contributor Author

This failed because tests that were supposed to fail are now passing, looking for the idlharness now to update it

@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Apr 9, 2019
@robert-snakard

Copy link
Copy Markdown
Contributor Author

@bors-servo try=wpt

@bors-servo

Copy link
Copy Markdown
Contributor

@robert-snakard: 🔑 Insufficient privileges: not in try users

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jun 7, 2019
@jdm

jdm commented Jun 7, 2019

Copy link
Copy Markdown
Member

  ▶ Unexpected subtest result in /uievents/idlharness.window.html:
  └ PASS [expected FAIL] MouseEvent interface: new WheelEvent("event") must inherit property "buttons" with the proper type

@robert-snakard

robert-snakard commented Jun 7, 2019 via email

Copy link
Copy Markdown
Contributor Author

@jdm

jdm commented Jun 7, 2019

Copy link
Copy Markdown
Member

You can run individual tests or directories with ./mach test-wpt /uievents/idlharness.window.html or ./mach test-wpt /uievents/ (for example), but running all of the tests locally is a mostly futile effort because there are so many of them.

@jdm

jdm commented Jun 7, 2019

Copy link
Copy Markdown
Member

Looks like these tests as well:

  ▶ Unexpected subtest result in /dom/events/Event-subclasses-constructors.html:
  └ PASS [expected FAIL] WheelEvent constructor (no argument)

  ▶ Unexpected subtest result in /dom/events/Event-subclasses-constructors.html:
  └ PASS [expected FAIL] WheelEvent constructor (undefined argument)

  ▶ Unexpected subtest result in /dom/events/Event-subclasses-constructors.html:
  └ PASS [expected FAIL] WheelEvent constructor (null argument)

  ▶ Unexpected subtest result in /dom/events/Event-subclasses-constructors.html:
  └ PASS [expected FAIL] WheelEvent constructor (empty argument)

  ▶ Unexpected subtest result in /dom/events/Event-subclasses-constructors.html:
  └ PASS [expected FAIL] WheelEvent constructor (argument with default values)

Otherwise it should be ready :)

@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Jun 8, 2019
@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

Error syncing changes upstream. Logs saved in error-snapshot-1559972947848.

@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

Error syncing changes upstream. Logs saved in error-snapshot-1559972971985.

Note: The WheelEvent interface supports rotation in all 3 spatial
dimensions. This implementation only supports two due to limitations
in the Glutin compositor.

The wheelevent interface is a dom interface that triggers for any
attached device that can rotate in one or more spatial dimensions.
Traditionally this is the mouse wheel though other devices could be
used as well. E.g. the trackball on a trackball mouse.
The wheelevent sends a signal when a supported device is rotated in the
x, y, or z rotational dimensions. These tests only check whether this
signal is received for any rotation at all.
@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

Transplanted upstreamable changes to existing PR.

Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#16199.

@jdm

jdm commented Jun 9, 2019

Copy link
Copy Markdown
Member

@bors-servo r=paulrouget

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 52a8f5a has been approved by paulrouget

@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 Jun 9, 2019
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 52a8f5a with merge 973a344...

bors-servo pushed a commit that referenced this pull request Jun 9, 2019
Implement WheelEvent interface

Created a new dom interface: "WheelEvent" and added WPT tests to confirm the interface works. To do this I had to do the following:

- Create a new `WheelEvent` dom interface. It can be found in `script/dom/wheelevent.rs` and `dom/webidls/WheelEvent.webidl`
- Add a new `WheelEvent` option to the compositor's `CompositorEvent` enum
- Add a new `Wheel` option to the compositor's `WindowEvent` enum
- Add a new `WheelDelta` type to the `script_traits` module
- Modify the `scroll_event` logic. Now we send a `WheelEvent` before scrolling. Repeat: we send the WheelEvent notification BEFORE we send the scroll delta.
- Add two manual wpt tests to the `uievents/order-of-events` test collection

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #22843 (GitHub issue number if applicable)

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/23154)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - arm64, linux-rel-css, linux-rel-wpt, status-taskcluster
Approved by: paulrouget
Pushing 973a344 to master...

@bors-servo
bors-servo merged commit 52a8f5a into servo:master Jun 9, 2019
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jun 9, 2019
@robert-snakard

Copy link
Copy Markdown
Contributor Author

Thanks for finishing the merge up for me @jdm / @paulrouget

@jdm

jdm commented Jul 17, 2019

Copy link
Copy Markdown
Member

Thanks for doing the hard work :)

@robert-snakard

Copy link
Copy Markdown
Contributor Author

Haha, we must have different definitions of hard work, that merge took forever!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement WheelEvent interface

7 participants