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

Add a transparent hit-testing rectangle for scrollable block content. #22156

Merged
merged 1 commit into from
Nov 10, 2018

Conversation

jdm
Copy link
Member

@jdm jdm commented Nov 9, 2018

This implements the strategy described at servo/webrender#3261 (comment) and which Gecko uses as well. Adding a transparent rectangle below the content and above the background ensures that hit testing correctly associates the background area with the right scrolling node.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix Trackpad scrolling has dead zones #22073
  • These changes do not require tests because the affected codepath requires user input, and we don't support webdriver tests yet.

This change is Reviewable

@highfive
Copy link

highfive commented Nov 9, 2018

Heads up! This PR modifies the following files:

  • @emilio: components/layout/display_list/builder.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 9, 2018
@highfive
Copy link

highfive commented Nov 9, 2018

warning Warning warning

  • These commits modify layout code, but no tests are modified. Please consider adding a test!

@jdm
Copy link
Member Author

jdm commented Nov 9, 2018

r? @pcwalton

@highfive highfive assigned pcwalton and unassigned nox Nov 9, 2018
@jdm
Copy link
Member Author

jdm commented Nov 9, 2018

This allows http://asvd.github.io/dragscroll/ to be scrolled with the trackpad regardless of where the mouse is placed.

@pcwalton
Copy link
Contributor

r+

@jdm
Copy link
Member Author

jdm commented Nov 10, 2018

@bors-servo r=pcwalton

@bors-servo
Copy link
Contributor

📌 Commit 1eee3c7 has been approved by pcwalton

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Nov 10, 2018
@bors-servo
Copy link
Contributor

⌛ Testing commit 1eee3c7 with merge b60006a...

bors-servo pushed a commit that referenced this pull request Nov 10, 2018
Add a transparent hit-testing rectangle for scrollable block content.

This implements the strategy described at servo/webrender#3261 (comment) and which Gecko uses as well. Adding a transparent rectangle below the content and above the background ensures that hit testing correctly associates the background area with the right scrolling node.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22073
- [x] These changes do not require tests because the affected codepath requires user input, and we don't support webdriver tests yet.

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

@bors-servo bors-servo merged commit 1eee3c7 into servo:master Nov 10, 2018
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Nov 10, 2018
bors-servo pushed a commit that referenced this pull request Feb 6, 2019
Ensure transparent hit test region is sized and positioned correctly.

This addresses some edge cases that were missed by #22156. Specifically, in some cases the transparent region was being placed in the display list in front of the scrollable content, rather than behind it, and the size of the region did not account for parent stacking context.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22073 and fix #22216.
- [x] There are tests for these changes

<!-- 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/22839)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this pull request Feb 6, 2019
Ensure transparent hit test region is sized and positioned correctly.

This addresses some edge cases that were missed by #22156. Specifically, in some cases the transparent region was being placed in the display list in front of the scrollable content, rather than behind it, and the size of the region did not account for parent stacking context.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22073 and fix #22216.
- [x] There are tests for these changes

<!-- 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/22839)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trackpad scrolling has dead zones
5 participants