[CTW] Y coordinate incorrect for characters when textarea is scrolled
Categories
(Core :: Disability Access APIs, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox110 | --- | fixed |
People
(Reporter: Jamie, Assigned: Jamie)
References
Details
(Whiteboard: [ctw-m4])
Attachments
(1 file)
Spun off bug 1801756 comment 33.
STR:
- Open this test case:
data:text/html,<textarea style="height: 10px;">a%0ab%0ac
- Focus the textarea.
- Get the Accessible for the textarea.
- Call CharBounds on the textarea with offset 4. Note the coordinates.
- Move the caret to the last line by pressing down arrow twice.
- Call CharBounds on the textarea with offset 4.
- Expected: The y coordinate should be smaller because this line has scrolled into view.
- Actual: The y coordinate is the same as in step 4.
We use text leaf nodes to get text bounds. BoundsWithOffset already applies the scroll offset for ancestors, so I would've thought it should handle this already. However, it seems that the textarea cache doesn't have scroll-position. I wonder if there's a frame between the textarea frame and the text leaf frame that we're missing? Note that the text leaf Accessibles don't have scroll-position either.
Assignee | ||
Comment 1•1 year ago
|
||
Calling .scrollTop on the textarea using the web console returns a larger value when the textarea is scrolled. Element::ScrollTop ends up using GetScrollTargetFrame and GetScrollPositionCSSPixels. The a11y code uses GetScrollTargetFrame and GetScrollPosition (without CSSPixels) too. I confirmed that the scroll event is definitely firing and DocAccessible::HandleScroll is catching it, but we fail to get an Accessible. I'm now starting to suspect the event might be fired by an anonymous node inside the textarea or something like that.
Assignee | ||
Comment 3•1 year ago
|
||
Yup, the event is coming from native anonymous content. I have a working fix, now just have to write a test.
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 4•1 year ago
|
||
textareas contain an anonymous div which fires the scroll event.
We don't have an Accessible for this div, so previously, we were just ignoring the scroll event.
Now, we'll redirect it to the textarea and get its Accessible.
Pushed by jteh@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/661be0caf687 If a scroll event is fired on inaccessible anonymous content, redirect it to the closest non-anonymous ancestor. r=morgan
Comment 6•1 year ago
|
||
bugherder |
Description
•