Closed aprotyas closed 10 months ago
cc @flackr @foolip for Chromium input.
cc @EdgarChen @smaug---- for Mozilla input.
I've implemented the test change proposal in https://github.com/web-platform-tests/wpt/pull/42471. Hopefully that makes it easier to review!
The test was initially added to explicitly test selectionchange. See also https://github.com/w3c/uievents/issues/278
Oh, the pr is just moving where selectionchange listener is registered. Yeah, I think that change is fine.
@smaug---- yes, testing for selectionchange
is totally fine here, I'm proposing we don't keep the listener around for the dragstart
test. Thanks!
Based on the comments here and on the PR, I think there's consensus that we want to make this test change. I'll merge https://github.com/web-platform-tests/wpt/pull/42471 to reflect that shortly.
Test List
https://wpt.fyi/results/uievents/mouse/mousemove_prevent_default_action.tentative.html
Rationale
The second subtest in the
mousemove_prevent_default_action.tentative.html
WPT asserts that a cancelledmousemove
event fires adragstart
, which is a fine expectation on its own. Unfortunately, since this behavior is asserted by comparing the logged events (obtained from respective event listeners) against a static set of expected events (["mousemove", "mousedown", "mousemove", "dragstart"]
), the test may listen toselectionchange
events and include anyselectionchange
events in the test assertion, producing an unnecessary test failure.We should not care whether or not a
selectionchange
event was fired in this case, since we only want to assert that adragstart
event fires from a cancelledmousemove
event on adraggable
element. These two events are not mutually exclusive in any manner relevant to this WPT.In fact, the same argument also applies for not listening to
dragstart
events when we only want to assert that aselectionchange
event was fired.We should only be listening for
selectionchange
events, and not alsodragstart
events, in the first subtest. Similarly, we should only be listening fordragstart
events, and not alsoselectionchange
events, in the second subtest.