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

@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

pcwalton commented Nov 10, 2018

r+

@jdm
Copy link
Member Author

jdm commented Nov 10, 2018

@bors-servo r=pcwalton

@bors-servo
Copy link
Contributor

bors-servo commented Nov 10, 2018

📌 Commit 1eee3c7 has been approved by pcwalton

@bors-servo
Copy link
Contributor

bors-servo commented Nov 10, 2018

Testing commit 1eee3c7 with merge b60006a...

bors-servo added 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 commented Nov 10, 2018

@bors-servo bors-servo merged commit 1eee3c7 into servo:master Nov 10, 2018
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
bors-servo added 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 added 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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

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