Skip to content

Scrolling to end of element should start scrolling the parent element. #13249

Closed

Description

@samuknet

In other browsers, if you carry on scrolling an element past the end then its parent element will begin to scroll, if possible.

In Servo, the parent element does not begin to scroll once the inner element has been scrolled all the way down.

Expected behaviour as shown in FF (identical in Chrome):
expected

However, in Servo the parent element does not begin to scroll once the user has scrolled to the very end of the inner element.

Page used for testing can be found online here.

Activity

  1. gterzian commented on Oct 2, 2016

    @gterzian
    Member

    Could I give this one a try?

  2. jdm commented on Oct 2, 2016

    @jdm
    Member

    @mrobinson Would you be able to provide any pointers here?

  3. paulrouget commented on Oct 3, 2016

    @paulrouget
    Contributor

    scroll events lands in compositor.rs here: https://github.com/servo/servo/blob/master/components/compositing/compositor.rs#L1617 then WebRender performs scrolling here: https://github.com/servo/webrender/blob/master/webrender/src/frame.rs#L284 … there, a layer is picked (see get_scroll_layer). I guess the wrong layer is picked (if any). It probably has to do with the ScrollEventPhase.

  4. gterzian commented on Oct 3, 2016

    @gterzian
    Member
  5. gterzian commented on Oct 3, 2016

    @gterzian
    Member

    removed my comment above which refered to older scroll code...

  6. gterzian commented on Oct 8, 2016

    @gterzian
    Member

    Hi everyone, I'm trying to build Servo with my local fork of webrender, seeing this error:

    `error: Package `webrender_traits v0.6.0 (file:///Users/gregory/Projects/servo/../webrender)` does not have these features: `serde_macros`
    
  7. paulrouget commented on Oct 8, 2016

    @paulrouget
    Contributor

    It's because of: servo/webrender#430

    @nox what needs to done on Servo's side?

  8. nox commented on Oct 8, 2016

    @nox
    Contributor

    @gterzian For now you can base your work on the rustup branch of this repository. It will get merged tomorrow.

  9. gterzian commented on Oct 9, 2016

    @gterzian
    Member

    @nox thanks, builds fine now 👍

  10. gterzian commented on Oct 9, 2016

    @gterzian
    Member

    Quick proof of concept here: servo/webrender#436

    It 'works', however not sure if it's right way to approach the problem. For example, if we had more levels of nesting, the scrolling would 'jump' to scrolling the root layer, as opposed to going up the chain of child layers...

    To me it seems the concept of 'overscrolling' is implemented, however what we want do is limit it to the root layer, while in the case of a child layer, the nearest parent should 'take over' the scrolling when the end of the child element is reached....

    What I did now is, in the case of a child layer ovescrolling, simply switching to scrolling the root layer instead, since the root_scroll_layer_id is readily available.

    Please let me know what you think

  11. paulrouget commented on Oct 9, 2016

    @paulrouget
    Contributor
  12. glennw commented on Oct 11, 2016

    @glennw
    Member

    Probably best to get @pcwalton to look at this - he did the overscroll implementation and is able to test on mac (overscroll is not implemented for linux yet).

  13. mstange commented on Oct 11, 2016

    @mstange
    Contributor

    Once we have overscroll in Firefox on macOS, we're going to enable it for all scrollable elements. If a new scroll gesture starts while you're already scrolled all the way to the edge of the scrollable element under the mouse, then the scroll will be handed off to the next outer scrollable element which is actually scrollable in that direction. We don't do handoff in the middle of a scroll gesture.

  14. 10 remaining items

  15. gterzian commented on Oct 24, 2016

    @gterzian
    Member

    By the way, I noticed that when you scroll and you encounter a scrollable child layer, the scroll switches to that layer, which is the opposite of the behaviour we want as per @mstange. This doesn't relate to my changes, yet we might want to try to tackle both at the same time?

    This might be a more general problem 'what layer to scroll' and 'when to switch layer, and when not to'...

    The problem I'm trying to solve now is 'switch to the parent layer, when you've reached the end of the current one(and it's not the root layer), and a new scroll gesture starts'.

    The other problem would be 'do not switch to a child layer you might encounter, while scrolling the parent layer'.

  16. paulrouget commented on Oct 24, 2016

    @paulrouget
    Contributor

    the scroll switches to that layer

    That's because layer is picked in fn scroll no matter the phase.

    This doesn't relate to my changes, yet we might want to try to tackle both at the same time?

    I would say yes. It's very much related. Both problems are about which layer is chosen on scroll.

  17. gterzian commented on Oct 29, 2016

    @gterzian
    Member

    Ok, added another commit, which implements 'keeping the currently scrolling layer, unless a new scroll gesture started'. Also keeping the other part which implements 'switching to the parent layer, when the child has scrolled to the end, and a new scroll is started, unless we're dealing with the root scroll layer'.

    Please have a look: servo/webrender#465

  18. gterzian commented on Oct 31, 2016

    @gterzian
    Member

    I have one question: Now that webrender has been updated to version 0.7, and after rebasing my fork, I'm having troubles building Servo with my local fork, since Servo still expects webrender 0.6.

    How can I update my local Servo to use my local webrender 0.7?

  19. paulrouget commented on Oct 31, 2016

    @paulrouget
    Contributor

    Wait until @glennw updates servo, or try yourself by doing ./mach update-cargo -p webrender.

  20. glennw commented on Nov 1, 2016

    @glennw
    Member

    @gterzian Servo should be all updated with latest WR now. You may find your local [replace] override in Cargo.toml needs to change the version number (to 0.8.0 I think) to select that local override when building.

  21. gterzian commented on Nov 1, 2016

    @gterzian
    Member

    @glennw thank you, yes it all works fine now :)

  22. gterzian commented on Nov 30, 2016

    @gterzian
    Member

    Wanted to point out that this issue has moved somewhat deeper then the stuff we initially discussed here, and there is more info in the PR itself(not sure if we should move that discussion in here btw) see servo/webrender#599

  23. added 4 commits that reference this issue on Dec 12, 2016
    750f666
    b7b056f
    7258375
    92d380c
  24. added a commit that references this issue on Dec 21, 2016
  25. added a commit that references this issue on Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions