atk_text_scroll_substring_to_point() only works if the accessible object is offscreen
Categories
(Core :: Disability Access APIs, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox74 | --- | fixed |
People
(Reporter: jdiggs, Assigned: samuel.thibault)
References
Details
Attachments
(3 files, 1 obsolete file)
Steps to reproduce:
- Load the attached test case and size the window so that Heading #1, #2, and #3 are the only visible headings.
- In Accerciser, perform the following in the iPython console:
# Select the document and get its bounding box.
In: acc.queryComponent().getExtents(DESKTOP_COORDS)
Out: [1970, 161, 876, 498]
# Select the on-screen "Heading #3" and scroll its substring to the top.
In: acc.queryText().scrollSubstringToPoint(0, 9, DESKTOP_COORDS, 1970, 161)
Out: True
^^^ Heading #3 hasn't actually moved though ^^^
# Select the off-screen "Heading #4" and scroll its substring to the top.
In: acc.queryText().scrollSubstringToPoint(0, 9, DESKTOP_COORDS, 1970, 161)
Out: True
^^^ Heading #4 is now at the top of the screen as expected ^^^
# Select the on-screen "Heading #5" and scroll its substring to the top.
In: acc.queryText().scrollSubstringToPoint(0, 9, DESKTOP_COORDS, 1970, 161)
Out: True
^^^ Heading #5 hasn't actually moved though ^^^
# Select the off-screen "Heading #3" and scroll its substring to the top.
In: acc.queryText().scrollSubstringToPoint(0, 9, DESKTOP_COORDS, 1970, 161)
Out: True
^^^ Heading #3 is now at the top of the screen as expected ^^^
Impact: Orca cannot reliably scroll substrings to the desired location.
Reporter | ||
Comment 1•5 years ago
|
||
Hey Jamie. Is this behavior intentional? I think it's a bug, but it's so consistent as to seem like it's on purpose. :)
Comment 2•5 years ago
|
||
Ug. Looking at the code, I don't see anything that does this "on purpose", nor can I think of any reason we'd enforce this deliberately. That said, I'm far from familiar with this area of the code, especially as it calls into layout.
Comment 3•5 years ago
|
||
I could not test this yet (will try and do so in the upcoming days), but this should fix ScrollSubstringToPoint()
so that it actually does scroll to the requested location in all cases.
Currently, ScrollSubstringToPoint()
implicitly uses the WhereToScroll::IfNotFullyVisible
flag, which leads to the described behavior: if the target location is fully visible, nothing happens. This really sounds like a bug in all platforms to me as this method explicitly gets a precise location to where the content is expected to be scrolled to; but if it's actually what is expected by a11y layers other than ATK, then fixing this will be a little more involved (either duplicating some of the code or adding an extra flag somewhere to control what the caller expects).
Assignee | ||
Comment 4•5 years ago
|
||
Oh, that looks like a very good culprit indeed, you have my +1 on that change :) (after checking that it does fix it)
I believe that on all platforms *ToPoint() are supposed to always scroll: their documentation talk about bringing the piece to a given position on the screen, they do not talk about visibility.
Comment 5•5 years ago
|
||
I just tested this, and the patch works nicely as promised on my end, and fixes the issue.
Assignee | ||
Comment 6•5 years ago
|
||
invisible r=jamie
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 7•5 years ago
|
||
Here is the patch on phabricator, a try is going on on https://treeherder.mozilla.org/#/jobs?repo=try&revision=4c47245b297a4fecc7431f3a833f8a3c752ec92c&selectedJob=285223388 , it's looking good.
Comment 9•5 years ago
|
||
Comment 10•5 years ago
|
||
Comment 11•5 years ago
|
||
Backed out changeset 1ad80659be06 (bug 1597742) for mochitest failures at test_scrollSubstringToPoint.html.
https://hg.mozilla.org/integration/autoland/rev/b207525a697640caf0084673cbf4c5378067df2d
Failure log:
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=285334334&repo=autoland&lineNumber=3180
Assignee | ||
Comment 12•5 years ago
|
||
So the test shows a discrepancy of a dozen pixels. I am actually not very surprised, since HyperTextAccessible::ScrollSubstringToPoint converts the position into an integer number of percent and requests that amount of scrolling, so there is some rounding here, we can not expect a completely perfect scrolling. Perhaps just reducing the number of pixel of the padding (currently 10000) could help here.
Very tall webpages however aren't that uncommon, 10000 pixels is just worth about a dozen pages , and much taller pages can be found online. Since integer values are not precise enough, perhaps we can make WhereToScroll a floating-point value, or perhaps a fixed-point value if performance really matters here? (but that'd make the code more confusing)
Comment 13•5 years ago
|
||
bugherder |
Assignee | ||
Comment 14•5 years ago
|
||
I've made that in https://treeherder.mozilla.org/#/jobs?repo=try&revision=f396eab55c1740aa24c4e7efb17b736054abf5c3&selectedJob=285337625 , just to see how well it goes.
Assignee | ||
Comment 15•5 years ago
|
||
Hum, it's worse, more investigation needed :)
Assignee | ||
Comment 16•5 years ago
|
||
Joanmarie, can you perhaps verify that today's nightly build, which contains the fix, behaves as you wish? (except the precision part for very long pagaes)
Reporter | ||
Comment 17•5 years ago
|
||
Yeah, that seems to work nicely! Way to go guys, and thanks!!
Assignee | ||
Comment 18•5 years ago
|
||
Perhaps this could go into firefox 72 and 73?
Comment 19•5 years ago
|
||
(In reply to Samuel Thibault from comment #18)
Perhaps this could go into firefox 72 and 73?
Definitely not going to happen for 72. It might be possible for 73 if I can get the test to pass.
Comment 20•5 years ago
|
||
Comment 21•5 years ago
|
||
Backed out changeset 093a40a347df (Bug 1597742) for causing perma a11y failures in test_scrollSubstringToPoint.html CLOSED TREE
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=285742535&repo=autoland&lineNumber=3658
Comment 22•5 years ago
|
||
Ug. I ran this against try and it passed. I don't get it.
Comment 23•5 years ago
|
||
Comment 24•5 years ago
|
||
I'm going to close this and spin off a separate bug for the tests, since the actual patch has already landed and reopening this is confusing.
Comment 25•5 years ago
|
||
Comment on attachment 9121441 [details]
Bug 1597742: Add tests for HyperTextAccessible::ScrollSubstringToPoint.
Revision D60207 was moved to bug 1610461. Setting attachment 9121441 [details] to obsolete.
Description
•