Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement home end key scrolling #14141
Conversation
highfive
commented
Nov 8, 2016
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @nox (or someone else) soon. |
|
|
Implement Home end key scroll Addressing issue servo/servo#13082. Supporting servo/servo#14141. * Adds `ScrollLocation` type in `webrender_traits`. * Refactor api to use new `ScrollLocation` * Implement home/end scrolling in `webrender/src/frame.rs` `fn scroll(...)` using new `ScrollLocation` struct passed in. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/540) <!-- Reviewable:end -->
|
@samuknet Have you considered rebasing off the latest Servo? I think it might make the build pass, since this PR is using I'm waiting for this one to land to be able to further test servo/webrender#599 |
|
@gterzian Working on it, should be up soon. servo/webrender#599 looks cool :) |
|
@gterzian So what's happening is the render_backend is just sending through the deltas with: Although what's unusual is that |
|
@samuknet thanks for doing all this research! I think the You can see in the new repo that the Also you could take a look at this PR because it looks like @glennw has done some work on the Servo side to integrate I'm not sure why "when testing the home/end key scrolling doesn't actually happen", but maybe with the info above you can get an idea why? |
|
@gterzian - thanks for this info. Found the issue - changes to coordinates in WR meant the home/end safety checks were stopping the scroll in the wrong when they should have been allowing it. Waiting now on servo/webrender#656. |
|
|
|
That PR merged, so this is ready for review. |
|
It looks like this PR updates a bunch of other dependencies, though, which we probably want to avoid! |
d1977a3
to
259d4c2
|
@jdm any idea why the travis CI build failed? I suspect something is wrong with the Thanks! :) |
|
The travis error is because our script that verifies that no accidental Cargo.lock changes were committed triggered. |
| @@ -15,6 +15,7 @@ gfx_traits = {path = "../gfx_traits"} | |||
| gleam = "0.2.8" | |||
| image = "0.12" | |||
| ipc-channel = "0.5" | |||
| layers = {git = "https://github.com/servo/rust-layers", features = ["plugins"]} | |||
This comment has been minimized.
This comment has been minimized.
jdm
Jan 15, 2017
Member
This line was added and is not necessary. Probably a mistake while rebasing?
|
r? @glennw |
1a8c5c3
to
0c9c343
|
@glennw All done and squashed - ready to go hopefully |
|
@bors-servo: r=glennw |
|
|
Implement home end key scrolling <!-- Please describe your changes on the following line: --> * Refactor all scroll related code to use a new `ScrollLocation` struct which can either be a `delta` (as before) or a `Start` or `End` request, to represent the desire to scroll to the start and end of the page. Effectively, everywhere a delta was used, there is now a `ScrollLocation` struct instead. * Add key press listeners for HOME and END keys so as to cause a scroll to be queued with `ScrollLocation::Start` (in HOME case) or `ScrollLocation::End` (in END case). * These changes depend on added support for the new `ScrollLocation` in webrender and webrender_traits. See servo/webrender#540. --- <!-- 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 #13082 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because scrolling I/O <!-- 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/14141) <!-- Reviewable:end -->
|
|
|
@jdm Looks like this could be fixed by changing the macro in this.downcast().send_window_event(WindowEvent::Scroll(ScrollLocation::Delta(delta),
origin,
TouchEventType::Move))This compilation error doesn't occur on my machine, I'm guessing because it depends on the platform? |
|
Have you tried running |
|
@Ms2ger Thanks for this - I've just pushed the nescessary changes in |
|
@bors-servo: r=glennw |
|
|
Implement home end key scrolling <!-- Please describe your changes on the following line: --> * Refactor all scroll related code to use a new `ScrollLocation` struct which can either be a `delta` (as before) or a `Start` or `End` request, to represent the desire to scroll to the start and end of the page. Effectively, everywhere a delta was used, there is now a `ScrollLocation` struct instead. * Add key press listeners for HOME and END keys so as to cause a scroll to be queued with `ScrollLocation::Start` (in HOME case) or `ScrollLocation::End` (in END case). * These changes depend on added support for the new `ScrollLocation` in webrender and webrender_traits. See servo/webrender#540. --- <!-- 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 #13082 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because scrolling I/O <!-- 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/14141) <!-- Reviewable:end -->
|
|
samuknet commentedNov 8, 2016
•
edited
Refactor all scroll related code to use a new
ScrollLocationstruct which can either be adelta(as before) or aStartorEndrequest, to represent the desire to scroll to the start and end of the page.Effectively, everywhere a delta was used, there is now a
ScrollLocationstruct instead.Add key press listeners for HOME and END keys so as to cause a scroll to be queued with
ScrollLocation::Start(in HOME case) orScrollLocation::End(in END case).These changes depend on added support for the new
ScrollLocationin webrender and webrender_traits. See servo/webrender#540../mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is