Keyboard scrolling not working while zoomed in with touchpad
Categories
(Core :: Panning and Zooming, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox83 | --- | verified |
People
(Reporter: hujq, Assigned: tnikkel)
References
Details
Attachments
(2 files, 1 obsolete file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:81.0) Gecko/20100101 Firefox/81.0
Steps to reproduce:
Set apz.allow_zooming to true.
Navigate to any web page, e.g. https://en.wikipedia.org/wiki/Main_Page .
Pinch to zoom-in with touchpad.
Try to scroll on the page with arrow keys on the keyboard.
Actual results:
For horizontal (left and right arrow key), the page is not moving at all.
For vertical (up and down arrow key), it will start scrolling, but at the same time jump to the leftmost side of the page. It also won't scroll past a certain point towards the bottom of the page.
Expected results:
It should be possible to use arrow keys to scroll over the whole page, without jumping or cutoff.
Comment 1•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Comment 2•4 years ago
•
|
||
I think this boils down do "main-thread keyboard scrolling code needs to scroll the visual viewport".
(Marking as blocking desktop-zoom-nightly for triage purposes only, I'm not necessarily arguing that it needs to block nightly.)
Assignee | ||
Comment 3•4 years ago
|
||
I expect that the code added in bug 1651332 fixed this, but that code is currently disabled because the pref apz.force_disable_desktop_zooming_scrollbars is set to true by default.
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
This is only partially fixed by the flipping apz.force_disable_desktop_zooming_scrollbars to false. There is another issue, patch coming up for it.
Assignee | ||
Comment 5•4 years ago
|
||
Keyboard arrow key scrolls go through PresShell::ScrollLine/ScrollCharacter. When these look for a scroll frame they eventually end up at nsLayoutUtils::GetNearestScrollableFrameForDirection.
nsLayoutUtils::GetNearestScrollableFrameForDirection does two things wrong when determining if the scroll frame is scrollable by apz: it disallows overflow hidden scrolling, and it uses GetAvailableScrollingDirections which is based on the layout scroll range.
Using GetAvailableScrollingDirectionsForUserInputEvents takes into account both of these factors.
GetNearestScrollableFrameForDirection is used by:
-gfx/layers/apz/src/FocusTarget.cpp
-EventStateManager::DoContentCommandScrollEvent
-PageMove, ScrollPage, ScrollLine, ScrollCharacter, CompleteScroll of PresShell
All of these should want the more apz aware function.
Assignee | ||
Comment 6•4 years ago
|
||
Assignee | ||
Comment 7•4 years ago
|
||
The current formulation is inconsistent. If you call it with ScrollableDirection::Either it goes into nsLayoutUtils::GetNearestScrollableFrame which will return the first scroll frame with a non-hidden overflow. If you call it with any other ScrollableDirection it calls nsLayoutUtils::GetNearestScrollableFrameForDirection which returns the first scrollframe it finds that has non-hidden overflow AND has at least one dev pixel of scroll range.
So remove that function and call nsLayoutUtils::GetNearestScrollableFrameForDirection directly. This is a slight change of behaviour but it seems desirable for all callers.
Comment 8•4 years ago
|
||
Comment on attachment 9177554 [details]
Bug 1656689. Remove PresShell::GetNearestScrollableFrame. r?kats
Revision D91236 was moved to bug 1666991. Setting attachment 9177554 [details] to obsolete.
Comment 10•4 years ago
|
||
Comment 11•4 years ago
|
||
bugherder |
Comment 12•4 years ago
|
||
Backed out for failures on test_group_zoom-2.html
backout: https://hg.mozilla.org/integration/autoland/rev/90e7c137c0edc740f29424745a1252b874b0d4f0
failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=316689719&repo=autoland&lineNumber=12048
[task 2020-09-25T07:02:01.940Z] 07:02:01 INFO - TEST-PASS | gfx/layers/apz/test/mochitest/test_group_zoom-2.html | helper_zoom_keyboardscroll.html | shouldn't have scrolled
[task 2020-09-25T07:02:01.942Z] 07:02:01 INFO - Buffered messages finished
[task 2020-09-25T07:02:01.943Z] 07:02:01 INFO - TEST-UNEXPECTED-FAIL | gfx/layers/apz/test/mochitest/test_group_zoom-2.html | helper_zoom_keyboardscroll.html | shouldn't have scrolled - got 8, expected +0
[task 2020-09-25T07:02:01.943Z] 07:02:01 INFO - SimpleTest.is@SimpleTest/SimpleTest.js:500:14
[task 2020-09-25T07:02:01.944Z] 07:02:01 INFO - spawnTest/w.is@gfx/layers/apz/test/mochitest/apz_test_utils.js:420:18
[task 2020-09-25T07:02:01.944Z] 07:02:01 INFO - test@gfx/layers/apz/test/mochitest/helper_zoom_keyboardscroll.html:41:9
[task 2020-09-25T07:02:01.947Z] 07:02:01 INFO - driveTest@gfx/layers/apz/test/mochitest/apz_test_utils.js:644:36
[task 2020-09-25T07:02:01.947Z] 07:02:01 INFO - TEST-PASS | gfx/layers/apz/test/mochitest/test_group_zoom-2.html | helper_zoom_keyboardscroll.html | shouldn't have scrolled
Comment 13•4 years ago
|
||
Backed out 66c2fb744703 for causing Bug 1667275
backout: https://hg.mozilla.org/integration/autoland/rev/11d61fa7276a0b9b0fda8e346d5cbc97f061b097
Updated•4 years ago
|
Comment 14•4 years ago
|
||
Comment 15•4 years ago
|
||
Backed out for causing high failure rate on test_scroll_space_no_range_overflow_scroll.html.
Backout link: https://hg.mozilla.org/integration/autoland/rev/4668c7b5e842a7afef9e4c183c8a85af950eb1ad
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 16•4 years ago
|
||
This new failure in test_scroll_space_no_range_overflow_scroll.html is fun. The test calls pageMove. PresShell::PageMove calls GetNearestScrollableFrameForDirection. The root scroll frame of the test is scrollable (there is a 200 vh spacer in it), however when run within the mochitest testing harness iframe it is not scrollable (ie GetScrollStyles returns overflow hidden) because we set scrolling=no on it here
And the blame for that line appears to go back to 2007 when we first introducted mochitest. Long time viewers may remember bug 1199023, where I discovered that mochitest-chrome was using scrolling=no and removed it. I guess I didn't find this use of scrolling=no because it is applying the scrolling=no in a different way that a search wouldn't be able to easily find. If I remove that we fail maybe around 10ish tests:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=a50f3facfb0e1236a92c295dc9ef41d584229d6b
Now, back to the problem at hand. So the root scroll frame of the test is determined to not be scrollable and so we traverse to the parent document, the one housing the mochitest harness. Before the patch of this bug we determine that there is no layout scrolling that can be done on the root scroll frame of the mochitest harness document and return null. After this patch we determine that there is apz scrolling that can be done and so return the root scroll frame of the mochitest harness document.
Then, without this patch, since we got a null frame we call nsFrameSelection::GetFrameToPageSelect to get the frame to use. With this patch we have a frame. Now we call nsFrameSelection::PageMove with the frame that we have. nsFrameSelection::PageMove calls GetOffsetTo between the passed in frame and the frame that the caret is in (the focused frame). Before this patch this is the root frame of the test document and a div in the test document. After this patch this is the root frame of the mochitest testing harness parent document, and a div in the test document. GetOffsetTo is not to be used on frames in different documents so this asserts, and then I think we try to scroll the test harness document, so the test doesn't see the scroll it is expecting.
So we need to remove scrolling=no from the mochitest iframe, but that looks to be a bit time consuming dealing with multiple tests and potential fallout. And we need to fix this code, as it is broken even with that problem. That seems a little more tractable in the short term to get this bug fixed. Initial question in my mind for that task is: if we don't find a scrollable scroll frame in the document of PresShell, should we ignore the PageMove call or forward the PageMove to a parent PresShell? Reading the description of the function in the idl it sounds like we should ignore it
because it is specifically dealing with the selection in one specific document. But it looks like there are two things going on: expanding the selection and scrolling. And while the selection may be limited within some subtree, the scrolling looks like it can maybe go above that:
Assignee | ||
Comment 17•4 years ago
|
||
The resulting ScrollFrameRectIntoView call looks like it will scroll all ancestors no matter what, so I think we just need to make sure the frames we pass to nsFrameSelection::PageMove are in the same document.
Assignee | ||
Comment 18•4 years ago
|
||
Bug 1668966 fixes an issue that comes up with the test here.
Assignee | ||
Comment 19•4 years ago
|
||
Bug 1668969 is filed the the scrolling=no on mochitest harness iframe issue.
Comment 20•4 years ago
|
||
Comment 21•4 years ago
|
||
bugherder |
Comment 22•4 years ago
|
||
Comment 23•4 years ago
|
||
bugherder |
Comment 24•4 years ago
|
||
Verified as fixed on Windows 10 ARM, Windows 10 Surface Pro Touchscreen, Dell laptop with Windows 10, MacOS 10.15 on Firefox Nightly 83.0a1.
Description
•