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

Implement scroll transactions #14470

Merged
merged 1 commit into from Dec 13, 2016

Conversation

@gterzian
Copy link
Member

gterzian commented Dec 6, 2016

@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:

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...


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #13249 (github issue number if applicable).
  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@glennw
Copy link
Member

glennw commented Dec 8, 2016

@highfive highfive assigned mbrubeck and unassigned metajack Dec 8, 2016
@notriddle
Copy link
Contributor

notriddle commented Dec 8, 2016

@gterzian Maybe you should sign up for https://janitor.technology/? It'll give you a real Linux environment, complete with NoVNC if you want to watch an occasionally-refreshed video feed of Servo running in X.

@gterzian
Copy link
Member Author

gterzian commented Dec 9, 2016

@notriddle thanks! I will check it out..

@@ -396,6 +399,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
last_composite_time: 0,
ready_to_save_state: ReadyState::Unknown,
scroll_in_progress: false,
in_scroll_transaction: None,

This comment has been minimized.

@mbrubeck

mbrubeck Dec 10, 2016

Contributor

Should on_scroll_start_window_event and on_scroll_end_window_event also modify this field?

This comment has been minimized.

@gterzian

gterzian Dec 10, 2016

Author Member

@mbrubeck Thank you for your suggestion. I have done some additional testing to be sure, and it seems that doing anything with in_scroll_transaction in those functions is unnecessary.

That is because, if those two functions are called (when the OS actually sends start/end events, which only Mac OS does at this point) the scroll transaction is, as far as I can tell, completely transparent.

To be precise, there is only one case in which the "transaction" will result in a change in the ScrollZoomEvent that will be sent to Webrender: When scroll_in_progress is false, and we receive a scroll after 80 ms. In this case a new "start event" is simulated by the transaction.

The only risk therefore, in my opinion, is that we would send inappropriate, or double, ScrollEventPhase::Start. This could happen if on_scroll_start_window_event were to be first called, followed by the transaction code sending another start phase after that. That is currently impossible, because on_scroll_start_window_event will always set scroll_in_progress to true.

Off course the scroll event stuff is quite complex, so it is entirely possible I have missed a specific case, yet at this stage I haven't found one yet.

An additional note: I have tried to implement the transactions with scroll_in_progress, however that field is used to implement a concept that overlaps, yet differs significantly from what those 'transactions' currently do. (For example, when the user has stopped actively scrolling, but Mac still sends additional scroll events that reflect the 'natural scrolling' on Mac, scroll_in_progress will be set to false, while we actually still need to keep the transaction open or else the scrolling will stop unnaturally on a Mac).

@mbrubeck
Copy link
Contributor

mbrubeck commented Dec 12, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Dec 12, 2016

📌 Commit 2b623bf has been approved by mbrubeck

@bors-servo
Copy link
Contributor

bors-servo commented Dec 12, 2016

Testing commit 2b623bf with merge 750f666...

bors-servo added a commit 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 -->
@mbrubeck
Copy link
Contributor

mbrubeck commented Dec 12, 2016

@bors-servo r-

  • Oops, I forgot that this has intermediate commits that should be squashed.
working proof of concept transactions

make the transaction transparent on mac

simplify match

further simplify match
@KiChjang KiChjang force-pushed the gterzian:implement_scroll_transactions branch from 2b623bf to 1b9078a Dec 12, 2016
@KiChjang
Copy link
Member

KiChjang commented Dec 12, 2016

@bors-servo r=mbrubeck clean

@bors-servo
Copy link
Contributor

bors-servo commented Dec 12, 2016

📌 Commit 1b9078a has been approved by mbrubeck

@bors-servo
Copy link
Contributor

bors-servo commented Dec 13, 2016

Testing commit 1b9078a with merge b7b056f...

bors-servo added a commit 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
Copy link
Contributor

bors-servo commented Dec 13, 2016

💔 Test failed - mac-rel-wpt2

@KiChjang
Copy link
Member

KiChjang commented Dec 13, 2016

@bors-servo retry

  • Oh great mac-rel-wpt2 builder, are we playing the network error game again?
@bors-servo
Copy link
Contributor

bors-servo commented Dec 13, 2016

Testing commit 1b9078a with merge 7258375...

bors-servo added a commit 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
Copy link
Contributor

bors-servo commented Dec 13, 2016

💔 Test failed - mac-rel-wpt2

@KiChjang
Copy link
Member

KiChjang commented Dec 13, 2016

@bors-servo retry

  • Yup, definitely playing that game
@bors-servo
Copy link
Contributor

bors-servo commented Dec 13, 2016

Testing commit 1b9078a with merge 92d380c...

bors-servo added a commit 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 -->
@KiChjang
Copy link
Member

KiChjang commented Dec 13, 2016

#Winning

@bors-servo
Copy link
Contributor

bors-servo commented Dec 13, 2016

@bors-servo bors-servo merged commit 1b9078a into servo:master Dec 13, 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 gterzian deleted the gterzian:implement_scroll_transactions branch Dec 14, 2016
@gterzian gterzian mentioned this pull request Dec 14, 2016
2 of 5 tasks complete
bors-servo added a commit 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 -->
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
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.

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