A11y code doesn't seem to trigger pointer events
Categories
(Core :: Disability Access APIs, defect)
Tracking
()
People
(Reporter: smaug, Unassigned)
References
Details
Assuming I'm reading the code correctly https://searchfox.org/mozilla-central/rev/754074e05178e017ef6c3d8e30428ffa8f1b794d/accessible/generic/LocalAccessible.cpp#2532-2565 uses a bit unusual code paths and thus bypasses the code which would normally generate pointer events from the incoming mouse events. (well, pointer events are also generated from touch events)
In normal event dispatching we end up here https://searchfox.org/mozilla-central/rev/754074e05178e017ef6c3d8e30428ffa8f1b794d/layout/base/PresShell.cpp#7321-7324
Bug 1911736 added a temporary tweak because of this issue.
Updated•1 year ago
|
Comment 1•1 year ago
|
||
Do I understand correctly that touch events emulate mouse events?
What would you recommend calling to simulate a touch interaction so that we generate touch, mouse and pointer events, just as if a user had tapped on a touch screen? Currently, we use WidgetTouchEvent, WidgetMouseEvent and aPresShell::HandleEventWithTarget.
| Reporter | ||
Comment 2•1 year ago
|
||
APZ code triggers a click using
https://searchfox.org/mozilla-central/rev/6d5be71ac78856ab388a1a5a923c666080f61e6a/gfx/layers/apz/util/APZCCallbackHelper.cpp#565
And I guess touchdown/up could happen before that in a11y case.
Comment 3•1 year ago
|
||
I don't think we can always use HandleEventUsingCoordinates. An a11y action can be triggered on any element, even if that element is off-screen, behind some other element in z-order, etc. If we use HandleEventUsingCoordinates, we might end up firing an event on the wrong element.
We've discussed potentially firing an event based on coordinates in most cases: when the originating element isn't off-screen, when hit testing the centre point of the originating element returns the same element or a descendant of the originating element, etc. See bug 1017322. I guess that would solve this for those cases, but there would still be rare cases where we don't fire pointer events.
Can we reasonably dispatch pointer events explicitly using PresShell::HandleEventWithTarget, just as we do for mouse and touch events?
| Reporter | ||
Comment 4•1 year ago
|
||
Yeah, that should work, given that it is already used when creating pointer events from lower level mouse/touch events
https://searchfox.org/mozilla-central/rev/5da13af5e6be251b70e994c8b4bd35fb5271f1e3/dom/events/PointerEventHandler.cpp#756,769-770
Description
•