You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Home" and "End" keys don't scroll to top/bottom of page #13082
changed the title [-]"Home" and "End" keys don't scroll all the way up / down the page[/-][+]"Home" and "End" keys don't scroll to top/bottom of page[/+]on Aug 29, 2016
Or alternately the new ScrollRequest could also encapsulate the TypedPoint2D<i32, DevicePixel> and TouchEventType, meaning WindowEvent::Scroll would just be Scroll(ScrollRequest).
So, this detail aside, I'm thinking the general things to be done are:
add two more match arms to fn handle_key in ports/glutin/window.rs to queue scroll start/end requests when the home/end keys are pressed.
Modify WindowEvent::Scroll to be made up of the ScrollRequest struct described above.
Refactor fn scroll in webrender_traits to accept the new ScrollRequest struct
Refactor this case to accept a ScrollRequest and refactor other related code involving webrender.scroll calls, namely, fn process_pending_scroll_events
I guess one thing I'm not sure about is at what point we should convert from a ScrollLocation to just a Point2D? I.e. the part where a ScrollLocation::Start is converted to a delta. How far the Delta -> ScrollRequest refactoring should go?
I'm guessing we will still want WebRender::frame's fn scroll to take a delta rather than pass the ScrollRequest (in some form) all the way through to there.
@paulrouget
I have got a working implementation but there are a few details I had to make assumptions for, so I'm going to submit a PR, if that sounds good? The home/end key scrolling is working as expected.
I currently have servo using my webrender fork however I'm unsure how to get servo to use my webrender_traits fork? Am I right in thinking this is what I need to do? So my PR's would be done in the order of webrender_traits, then webrender, then Servo.
Currently I have just webrender_traits directly in the webrender fork but am unsure how to use a my webrender traits fork.
Although when I compile and run it, it uses the webrender_traits from /Users/Sam/servo_fork/webrender/webrender_traits instead. So for now, the webrender_traits changes I have are in /Users/Sam/servo_fork/webrender/webrender_traits. But if I understand correctly, I need to make it use the forked webrender traits if I am to do the PR's.
You should be able to make a single PR for both WR and WR_traits changes,then make a PR for servo after that merges and use ./mach cargo-update -p webrender (possibly the same for webrender_traits, too).
I've updated my webrender fork branch ('home-end-key-scroll') to be up to date with the latest webrender, and I am using paths = [..] in config to select webrender and webrender_traits, however when building Servo I get the error:
Package webrender_traits v0.8.0 (file:///Users/sam/servo/servo_fork/webrender/webrender) does not have these features: serde_macros.
I noticed this is a problem mentioned here, but I couldn't find a fix.
I've also tried the Cargo.toml [replace] method, using: [replace] "webrender:0.6.0" = { path = '/Users/sam/servo/servo_fork/webrender/webrender/' } "webrender_traits:0.6.0" = { path = '/Users/sam/servo/servo_fork/webrender/webrender_traits/' }
but this didn't work either.
@samuknet I had this problem before as well I remember, I think you need to update your servo repo, and then as @paulrouget says indeed replace webrender in Cargo.toml and please make sure it's version 0.8.0
I've tried this, I still get the error unfortunately. I removed paths=[..] in config and added the [replace] in Cargo.toml with 0.8.0 although I get the same error.
But that should have been fixed in Servo by now(#13249 (comment)), @samuknet are you 100% sure you are building your webrender fork using the latest version of the servo repo?
just to make sure, you would have to do something like: git fetch --all git rebase upstream/master (assuming you set up the original repo as the 'upstream' remote on your machine...
Activity
paulrouget commentedon Aug 29, 2016
This should not be too hard to implement. See
fn handle_key()inports/glutin/window.rs.highfive commentedon Aug 29, 2016
Please make a comment here if you intend to work on this issue. Thank you!
jdm commentedon Aug 29, 2016
This isn't appropriate for E-easy unless we also explain how to do the relevant scrolling as well.
[-]"Home" and "End" keys don't scroll all the way up / down the page[/-][+]"Home" and "End" keys don't scroll to top/bottom of page[/+]paulrouget commentedon Aug 29, 2016
You're right. I thought that'd be an easy one, but it doesn't appear to be that straight forward.
webrender expects a delta (
Point2D<f32>). Do we want to change that to:Does it make sense?
Or do we want to pass
f32::INFINITYandf32::NEG_INFINITY?paulrouget commentedon Aug 30, 2016
/cc @glennw
glennw commentedon Aug 30, 2016
Having an enum sounds good. The Start/End types should probably allow you to specify x and/or y direction though?
So perhaps something like:
and then:
Or something like that?
samuknet commentedon Sep 7, 2016
Once we have decided these
ScrollRequestdetails, would this be something I could potentially work on? Thanks!paulrouget commentedon Sep 8, 2016
We should do what Glenn is suggesting.
Go for it. Thank you!
I'm not sure how much I can help here, but feel free to ask questions.
samuknet commentedon Sep 8, 2016
Ok this sounds good. So would
WindowEvent::Scrollbe changed to:?
Or alternately the new
ScrollRequestcould also encapsulate theTypedPoint2D<i32, DevicePixel>andTouchEventType, meaningWindowEvent::Scrollwould just beScroll(ScrollRequest).So, this detail aside, I'm thinking the general things to be done are:
fn handle_keyinports/glutin/window.rsto queue scroll start/end requests when the home/end keys are pressed.WindowEvent::Scrollto be made up of theScrollRequeststruct described above.fn scrollin webrender_traits to accept the newScrollRequeststructScrollRequestand refactor other related code involvingwebrender.scrollcalls, namely,fn process_pending_scroll_eventsI guess one thing I'm not sure about is at what point we should convert from a
ScrollLocationto just aPoint2D? I.e. the part where aScrollLocation::Startis converted to a delta. How far the Delta ->ScrollRequestrefactoring should go?I'm guessing we will still want WebRender::frame's
fn scrollto take a delta rather than pass theScrollRequest(in some form) all the way through to there.paulrouget commentedon Sep 9, 2016
I think it makes sense.
Looks about right.
I'm not sure. Where ever there's an easy access to the page size. Which might be in WebRender.
@glennw ?
11 remaining items
paulrouget commentedon Nov 4, 2016
@samuknet do you want to keep working on this? Do need any help? Or do you want someone else to take over?
samuknet commentedon Nov 4, 2016
@paulrouget
I have got a working implementation but there are a few details I had to make assumptions for, so I'm going to submit a PR, if that sounds good? The home/end key scrolling is working as expected.
I currently have servo using my
webrenderfork however I'm unsure how to get servo to use mywebrender_traitsfork? Am I right in thinking this is what I need to do? So my PR's would be done in the order of webrender_traits, then webrender, then Servo.Currently I have just
webrender_traitsdirectly in thewebrenderfork but am unsure how to use a my webrender traits fork.Currently in
servo/.cargo/configI have:paths = ["/Users/Sam/servo_fork/webrender/", "/Users/Sam/servo_fork/webrender_traits/"]Although when I compile and run it, it uses the webrender_traits from
/Users/Sam/servo_fork/webrender/webrender_traitsinstead. So for now, the webrender_traits changes I have are in/Users/Sam/servo_fork/webrender/webrender_traits. But if I understand correctly, I need to make it use the forked webrender traits if I am to do the PR's.jdm commentedon Nov 4, 2016
You should be able to make a single PR for both WR and WR_traits changes,then make a PR for servo after that merges and use
./mach cargo-update -p webrender(possibly the same for webrender_traits, too).samuknet commentedon Nov 8, 2016
I've updated my webrender fork branch ('home-end-key-scroll') to be up to date with the latest webrender, and I am using
paths = [..]in config to select webrender and webrender_traits, however when building Servo I get the error:Package webrender_traits v0.8.0 (file:///Users/sam/servo/servo_fork/webrender/webrender) does not have these features: serde_macros.I noticed this is a problem mentioned here, but I couldn't find a fix.
I've also tried the
Cargo.toml[replace] method, using:[replace] "webrender:0.6.0" = { path = '/Users/sam/servo/servo_fork/webrender/webrender/' } "webrender_traits:0.6.0" = { path = '/Users/sam/servo/servo_fork/webrender/webrender_traits/' }but this didn't work either.
Any ideas?
Thanks 😃
paulrouget commentedon Nov 8, 2016
Does it work better with
webrender:0.8.0instead ofwebrender:0.6.0?gterzian commentedon Nov 8, 2016
@samuknet I had this problem before as well I remember, I think you need to update your servo repo, and then as @paulrouget says indeed replace webrender in
Cargo.tomland please make sure it's version0.8.0samuknet commentedon Nov 8, 2016
I've tried this, I still get the error unfortunately. I removed
paths=[..]in config and added the[replace]inCargo.tomlwith 0.8.0 although I get the same error.paulrouget commentedon Nov 8, 2016
You use a clone of webrender from servo/webrender?
And in components/servo/Cargo.toml, you added:
?
gterzian commentedon Nov 8, 2016
I had exactly this problem here: #13249 (comment)
But that should have been fixed in Servo by now(#13249 (comment)), @samuknet are you 100% sure you are building your webrender fork using the latest version of the servo repo?
just to make sure, you would have to do something like:
git fetch --allgit rebase upstream/master(assuming you set up the original repo as the 'upstream' remote on your machine...samuknet commentedon Nov 8, 2016
@gterzian Thanks, I think I've got it now. I had to make changes to my old work to account for the latest Servo code.
So now is the procedure to submit a webrender PR alongisde the Servo PR?
Edit:
Servo PR fork: https://github.com/samuknet/servo/tree/home-end-key-scroll2
Webrender PR fork: https://github.com/samuknet/webrender/tree/home-end-key-scroll2
jdm commentedon Nov 8, 2016
Yep!
Auto merge of #540 - samuknet:home-end-key-scroll2, r=glennw
Auto merge of #14141 - samuknet:home-end-key-scroll2, r=glennw
Auto merge of #14141 - samuknet:home-end-key-scroll2, r=glennw