-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
Heads up! This PR modifies the following files:
|
r? @pcwalton |
This allows http://asvd.github.io/dragscroll/ to be scrolled with the trackpad regardless of where the mouse is placed. |
r+ |
@bors-servo r=pcwalton |
📌 Commit 1eee3c7 has been approved by |
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 -->
☀️ Test successful - android, android-mac, android-x86, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, status-taskcluster, windows-msvc-dev |
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 -->
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 -->
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 errorsThis change is