synthesizePlainDragAndDrop() should supress a11y checks for expectCancelDragStart
Categories
(Testing :: Mochitest, defect)
Tracking
(firefox159 fixed)
| Tracking | Status | |
|---|---|---|
| firefox159 | --- | fixed |
People
(Reporter: jsudiaman, Assigned: Kayano04, Mentored)
Details
(Whiteboard: [good-first-bug][lang=js])
Attachments
(1 external file)
This block, meant to simulate a drop (rather than click), may cause a11y failures:
if (expectCancelDragStart) {
synthesizeMouse(
srcElement,
finalX,
finalY,
{ type: "mouseup", id },
srcWindow
);
return;
}
Note that in synthesizeDropAfterDragOver(), this is handled correctly:
// Don't run accessibility checks for this click, since we're not actually
// clicking. It's just generated as part of the drop.
// this.AccessibilityUtils might not be set if this isn't a browser test or
// if a browser test has loaded its own copy of EventUtils for some reason.
// In the latter case, the test probably shouldn't do that.
this.AccessibilityUtils?.suppressClickHandling(true);
synthesizeMouse(aDestElement, 2, 2, { type: "mouseup" }, aDestWindow);
this.AccessibilityUtils?.suppressClickHandling(false);
| Reporter | ||
Comment 1•4 months ago
|
||
In testing/mochitest/tests/SimpleTest/EventUtils.js, I believe we just need to wrap the synthesizeMouse() call with this.AccessibilityUtils?.suppressClickHandling(true); and this.AccessibilityUtils?.suppressClickHandling(false); – as done in the block above.
To verify, remove the AccessibilityUtils.setEnv({ mustHaveAccessibleRule: false }); and AccessibilityUtils.resetEnv(); lines from the following tests:
And make sure the tests still pass:
./mach test --enable-a11y-checks \
browser/components/tabbrowser/test/browser/dragdrop/browser_drag_horizontal_overflow.js \
browser/components/tabbrowser/test/browser/dragdrop/browser_drag_splitview.js
| Reporter | ||
Updated•4 months ago
|
Comment 2•4 months ago
|
||
The severity field is not set for this bug.
:florian, could you have a look please?
For more information, please visit BugBot documentation.
Updated•4 months ago
|
I'd like to take this on. I'll reproduce the issue first and then submit a patch via Phabricator.
| Reporter | ||
Comment 4•1 month ago
|
||
(In reply to 赤坂理子 from comment #3)
I'd like to take this on. I'll reproduce the issue first and then submit a patch via Phabricator.
Sounds good! I've assigned you. Let me know how it goes.
Follow the existing synthesizeDropAfterDragOver pattern and suppress accessibility click handling only around the cancellation-path mouseup, as suggested in bug 2044440 comment 1.
Remove the horizontal-overflow test waiver and add a real cancelled-drag regression that also verifies subsequent button clicks still run accessibility checks. The splitview test no longer has the old waiver.
Description
•