Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keeping the currently scrolling layer, unless new gesture starts #600

Merged
merged 1 commit into from Dec 21, 2016

Conversation

@gterzian
Copy link
Member

gterzian commented Nov 27, 2016

"If you scroll a long page, and somewhere on that page is a smaller scrollable element, you don't want that element to swallow the rest of your scroll gesture if it suddenly happens to move under your mouse. You want the current scroll gesture to keep scrolling the outer page." servo/servo#13249 (comment)

Page used for testing can be found online here.


This change is Reviewable

@gterzian gterzian changed the title Keeping the currently scrolling layer Keeping the currently scrolling layer, unless new gesture starts Nov 27, 2016
Copy link
Member

kvark left a comment

one nit, otherwise looks good

Some(scroll_layer_id) => scroll_layer_id,
None => return false,
let scroll_layer_id = match (phase, self.get_scroll_layer(&cursor, root_scroll_layer_id),
self.current_scroll_layer_id) {

This comment has been minimized.

@kvark

kvark Nov 28, 2016

Member

the indentation doesn't look right to me. Perhaps, align every tuple element after match (?

@gterzian
Copy link
Member Author

gterzian commented Nov 30, 2016

@kvark thanks for your review, I will address your points in time... By the way this PR, just like Handoff scroll when end of layer reached, and new gesture starts #599, will require additional work because it currently only works on Mac OS, and breaks scrolling on other platforms...

@gterzian gterzian force-pushed the gterzian:keep_scrolling_layer branch from eed1072 to ae1885f Dec 6, 2016
@gterzian gterzian mentioned this pull request Dec 6, 2016
3 of 5 tasks complete
bors-servo added a commit to servo/servo that referenced this pull request Dec 12, 2016
…beck

Implement scroll transactions

<!-- Please describe your changes on the following line: -->
@glennw Here is a first pass at faking Start scroll events by way of 'transactions', as suggested by @mstange at servo/webrender#599 (comment)

Since I still don't have a Linux environment available for testing(and my Mac doesn't have enough resources to run a VM at the moment), I tested this with both servo/webrender#599 and servo/webrender#600 on a Mac by:

* disabling start and end events by removing the content of these two functions: https://github.com/servo/servo/blob/master/components/compositing/compositor.rs#L1080 and https://github.com/servo/servo/blob/master/components/compositing/compositor.rs#L1093

* Setting `CAN_OVERSCROLL` to false for Mac OS in Webrender https://github.com/servo/webrender/blob/master/webrender/src/frame.rs#L29

* This PR also requires a `./mach update-cargo -a`

The desired behavior of both Webrender PR's, based on my manual testing, now also works when there are no end or start scroll events provided by the os. The scroll transactions do not affect normal scrolling on Mac OS, and both PR still work as before on that platform.

Both PR in Webrender need some re-basing and cleaning up, as does this one, and I first wanted to put this proposal forward, and also ask if someone has the time to do some testing in a real Linux environment...

---
<!-- 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 #13249 (github issue number if applicable).

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

<!-- 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/14470)
<!-- Reviewable:end -->
bors-servo added a commit to servo/servo that referenced this pull request Dec 13, 2016
…beck

Implement scroll transactions

<!-- Please describe your changes on the following line: -->
@glennw Here is a first pass at faking Start scroll events by way of 'transactions', as suggested by @mstange at servo/webrender#599 (comment)

Since I still don't have a Linux environment available for testing(and my Mac doesn't have enough resources to run a VM at the moment), I tested this with both servo/webrender#599 and servo/webrender#600 on a Mac by:

* disabling start and end events by removing the content of these two functions: https://github.com/servo/servo/blob/master/components/compositing/compositor.rs#L1080 and https://github.com/servo/servo/blob/master/components/compositing/compositor.rs#L1093

* Setting `CAN_OVERSCROLL` to false for Mac OS in Webrender https://github.com/servo/webrender/blob/master/webrender/src/frame.rs#L29

* This PR also requires a `./mach update-cargo -a`

The desired behavior of both Webrender PR's, based on my manual testing, now also works when there are no end or start scroll events provided by the os. The scroll transactions do not affect normal scrolling on Mac OS, and both PR still work as before on that platform.

Both PR in Webrender need some re-basing and cleaning up, as does this one, and I first wanted to put this proposal forward, and also ask if someone has the time to do some testing in a real Linux environment...

---
<!-- 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 #13249 (github issue number if applicable).

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

<!-- 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/14470)
<!-- Reviewable:end -->
bors-servo added a commit to servo/servo that referenced this pull request Dec 13, 2016
…beck

Implement scroll transactions

<!-- Please describe your changes on the following line: -->
@glennw Here is a first pass at faking Start scroll events by way of 'transactions', as suggested by @mstange at servo/webrender#599 (comment)

Since I still don't have a Linux environment available for testing(and my Mac doesn't have enough resources to run a VM at the moment), I tested this with both servo/webrender#599 and servo/webrender#600 on a Mac by:

* disabling start and end events by removing the content of these two functions: https://github.com/servo/servo/blob/master/components/compositing/compositor.rs#L1080 and https://github.com/servo/servo/blob/master/components/compositing/compositor.rs#L1093

* Setting `CAN_OVERSCROLL` to false for Mac OS in Webrender https://github.com/servo/webrender/blob/master/webrender/src/frame.rs#L29

* This PR also requires a `./mach update-cargo -a`

The desired behavior of both Webrender PR's, based on my manual testing, now also works when there are no end or start scroll events provided by the os. The scroll transactions do not affect normal scrolling on Mac OS, and both PR still work as before on that platform.

Both PR in Webrender need some re-basing and cleaning up, as does this one, and I first wanted to put this proposal forward, and also ask if someone has the time to do some testing in a real Linux environment...

---
<!-- 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 #13249 (github issue number if applicable).

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

<!-- 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/14470)
<!-- Reviewable:end -->
bors-servo added a commit to servo/servo that referenced this pull request Dec 13, 2016
…beck

Implement scroll transactions

<!-- Please describe your changes on the following line: -->
@glennw Here is a first pass at faking Start scroll events by way of 'transactions', as suggested by @mstange at servo/webrender#599 (comment)

Since I still don't have a Linux environment available for testing(and my Mac doesn't have enough resources to run a VM at the moment), I tested this with both servo/webrender#599 and servo/webrender#600 on a Mac by:

* disabling start and end events by removing the content of these two functions: https://github.com/servo/servo/blob/master/components/compositing/compositor.rs#L1080 and https://github.com/servo/servo/blob/master/components/compositing/compositor.rs#L1093

* Setting `CAN_OVERSCROLL` to false for Mac OS in Webrender https://github.com/servo/webrender/blob/master/webrender/src/frame.rs#L29

* This PR also requires a `./mach update-cargo -a`

The desired behavior of both Webrender PR's, based on my manual testing, now also works when there are no end or start scroll events provided by the os. The scroll transactions do not affect normal scrolling on Mac OS, and both PR still work as before on that platform.

Both PR in Webrender need some re-basing and cleaning up, as does this one, and I first wanted to put this proposal forward, and also ask if someone has the time to do some testing in a real Linux environment...

---
<!-- 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 #13249 (github issue number if applicable).

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

<!-- 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/14470)
<!-- Reviewable:end -->
@kvark
kvark approved these changes Dec 14, 2016
Copy link
Member

kvark left a comment

LGTM as long as you sqash it

align match elements
@gterzian gterzian force-pushed the gterzian:keep_scrolling_layer branch from e39a21a to 11edf22 Dec 14, 2016
@gterzian gterzian mentioned this pull request Dec 14, 2016
2 of 5 tasks complete
@gterzian
Copy link
Member Author

gterzian commented Dec 14, 2016

@glennw Ok I've just done some additional testing, and realized my previous implementations of 'scroll transactions' was missing one case see servo/servo#14597 other than that this one shouldn't break scrolling on Linux anymore, and still implement the desired behavior. I've tested this on my mac by disabling overscrolling, as well as manually removing the start/end events from the compositor...

@glennw
Copy link
Member

glennw commented Dec 14, 2016

@gterzian Great, thanks! Once that fix lands for Servo, I'll test this locally and get it merged :)

bors-servo added a commit to servo/servo that referenced this pull request Dec 15, 2016
FIX for Implement scroll transactions

<!-- Please describe your changes on the following line: -->

Follow up on #14470

@mbrubeck @KiChjang @glennw I just found out in the context of servo/webrender#600 I forgot to add a case for the very first scroll event, or else the scrolling on that PR, in a non-Mac OS environment, will only start after an 80ms pause following the initial scroll event...

Sorry this slipped through my initial testing...

---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

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

<!-- 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/14597)
<!-- Reviewable:end -->
@glennw
Copy link
Member

glennw commented Dec 21, 2016

Tested on Linux on a few sites, and this seems to work well. Thanks!

@glennw
Copy link
Member

glennw commented Dec 21, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Dec 21, 2016

📌 Commit 11edf22 has been approved by glennw

@bors-servo
Copy link
Contributor

bors-servo commented Dec 21, 2016

Testing commit 11edf22 with merge 4474785...

bors-servo added a commit that referenced this pull request Dec 21, 2016
Keeping the currently scrolling layer, unless new gesture starts

"If you scroll a long page, and somewhere on that page is a smaller scrollable element, you don't want that element to swallow the rest of your scroll gesture if it suddenly happens to move under your mouse. You want the current scroll gesture to keep scrolling the outer page." servo/servo#13249 (comment)

Page used for testing can be found online [here](https://samuknet.github.io/test_cases/nestedScroll/).

<!-- 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/600)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 21, 2016

☀️ Test successful - status-travis

@bors-servo bors-servo merged commit 11edf22 into servo:master Dec 21, 2016
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@gterzian
Copy link
Member Author

gterzian commented Dec 21, 2016

@glennw thanks for your help!

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Feb 4, 2017
…plement_scroll_transactions); r=mbrubeck

<!-- Please describe your changes on the following line: -->
@glennw Here is a first pass at faking Start scroll events by way of 'transactions', as suggested by @mstange at servo/webrender#599 (comment)

Since I still don't have a Linux environment available for testing(and my Mac doesn't have enough resources to run a VM at the moment), I tested this with both servo/webrender#599 and servo/webrender#600 on a Mac by:

* disabling start and end events by removing the content of these two functions: https://github.com/servo/servo/blob/master/components/compositing/compositor.rs#L1080 and https://github.com/servo/servo/blob/master/components/compositing/compositor.rs#L1093

* Setting `CAN_OVERSCROLL` to false for Mac OS in Webrender https://github.com/servo/webrender/blob/master/webrender/src/frame.rs#L29

* This PR also requires a `./mach update-cargo -a`

The desired behavior of both Webrender PR's, based on my manual testing, now also works when there are no end or start scroll events provided by the os. The scroll transactions do not affect normal scrolling on Mac OS, and both PR still work as before on that platform.

Both PR in Webrender need some re-basing and cleaning up, as does this one, and I first wanted to put this proposal forward, and also ask if someone has the time to do some testing in a real Linux environment...

---
<!-- 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 #13249 (github issue number if applicable).

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

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 92d380c399204d327e74771f5a9b8b2a343acecc
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Feb 4, 2017
…rzian:fix_scroll_transactions); r=mbrubeck

<!-- Please describe your changes on the following line: -->

Follow up on servo/servo#14470

@mbrubeck @KiChjang @glennw I just found out in the context of servo/webrender#600 I forgot to add a case for the very first scroll event, or else the scrolling on that PR, in a non-Mac OS environment, will only start after an 80ms pause following the initial scroll event...

Sorry this slipped through my initial testing...

---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

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

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 139c111091210a5002bda668d14debb2e1c68ca9
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 1, 2019
…plement_scroll_transactions); r=mbrubeck

<!-- Please describe your changes on the following line: -->
glennw Here is a first pass at faking Start scroll events by way of 'transactions', as suggested by mstange at servo/webrender#599 (comment)

Since I still don't have a Linux environment available for testing(and my Mac doesn't have enough resources to run a VM at the moment), I tested this with both servo/webrender#599 and servo/webrender#600 on a Mac by:

* disabling start and end events by removing the content of these two functions: https://github.com/servo/servo/blob/master/components/compositing/compositor.rs#L1080 and https://github.com/servo/servo/blob/master/components/compositing/compositor.rs#L1093

* Setting `CAN_OVERSCROLL` to false for Mac OS in Webrender https://github.com/servo/webrender/blob/master/webrender/src/frame.rs#L29

* This PR also requires a `./mach update-cargo -a`

The desired behavior of both Webrender PR's, based on my manual testing, now also works when there are no end or start scroll events provided by the os. The scroll transactions do not affect normal scrolling on Mac OS, and both PR still work as before on that platform.

Both PR in Webrender need some re-basing and cleaning up, as does this one, and I first wanted to put this proposal forward, and also ask if someone has the time to do some testing in a real Linux environment...

---
<!-- 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 #13249 (github issue number if applicable).

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

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 92d380c399204d327e74771f5a9b8b2a343acecc

UltraBlame original commit: 5e6f51510f8927cd014e93a7c9526da8465612cb
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 1, 2019
…plement_scroll_transactions); r=mbrubeck

<!-- Please describe your changes on the following line: -->
glennw Here is a first pass at faking Start scroll events by way of 'transactions', as suggested by mstange at servo/webrender#599 (comment)

Since I still don't have a Linux environment available for testing(and my Mac doesn't have enough resources to run a VM at the moment), I tested this with both servo/webrender#599 and servo/webrender#600 on a Mac by:

* disabling start and end events by removing the content of these two functions: https://github.com/servo/servo/blob/master/components/compositing/compositor.rs#L1080 and https://github.com/servo/servo/blob/master/components/compositing/compositor.rs#L1093

* Setting `CAN_OVERSCROLL` to false for Mac OS in Webrender https://github.com/servo/webrender/blob/master/webrender/src/frame.rs#L29

* This PR also requires a `./mach update-cargo -a`

The desired behavior of both Webrender PR's, based on my manual testing, now also works when there are no end or start scroll events provided by the os. The scroll transactions do not affect normal scrolling on Mac OS, and both PR still work as before on that platform.

Both PR in Webrender need some re-basing and cleaning up, as does this one, and I first wanted to put this proposal forward, and also ask if someone has the time to do some testing in a real Linux environment...

---
<!-- 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 #13249 (github issue number if applicable).

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

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 92d380c399204d327e74771f5a9b8b2a343acecc

UltraBlame original commit: 5e6f51510f8927cd014e93a7c9526da8465612cb
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 1, 2019
…plement_scroll_transactions); r=mbrubeck

<!-- Please describe your changes on the following line: -->
glennw Here is a first pass at faking Start scroll events by way of 'transactions', as suggested by mstange at servo/webrender#599 (comment)

Since I still don't have a Linux environment available for testing(and my Mac doesn't have enough resources to run a VM at the moment), I tested this with both servo/webrender#599 and servo/webrender#600 on a Mac by:

* disabling start and end events by removing the content of these two functions: https://github.com/servo/servo/blob/master/components/compositing/compositor.rs#L1080 and https://github.com/servo/servo/blob/master/components/compositing/compositor.rs#L1093

* Setting `CAN_OVERSCROLL` to false for Mac OS in Webrender https://github.com/servo/webrender/blob/master/webrender/src/frame.rs#L29

* This PR also requires a `./mach update-cargo -a`

The desired behavior of both Webrender PR's, based on my manual testing, now also works when there are no end or start scroll events provided by the os. The scroll transactions do not affect normal scrolling on Mac OS, and both PR still work as before on that platform.

Both PR in Webrender need some re-basing and cleaning up, as does this one, and I first wanted to put this proposal forward, and also ask if someone has the time to do some testing in a real Linux environment...

---
<!-- 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 #13249 (github issue number if applicable).

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

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 92d380c399204d327e74771f5a9b8b2a343acecc

UltraBlame original commit: 5e6f51510f8927cd014e93a7c9526da8465612cb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.