-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mousemove and preventDefault() #278
Comments
I feel it shouldn't be cancelable because, as a comment in the bug says, the mouse move itself can't be canceled. |
cc @mustaqahmed |
We (Chromium) attempted to fix this behavior twice already, in 2015 and 2018! Compat problems forced us to revert in both cases!! Interestingly, Safari didn't allow canceling mousemove until 2015 (or may be later), see the bug I linked above. Curious what motivated Safari to introduce this. |
It seems the second revert was due to Chrome's internal use, though. |
According to the spec, a "mousemove" event has no default action. But a "mousedown" event has. That would match Chrome's and Firefox's behavior when AFAIK, Safari's behavior is the same as Chrome's. |
Currently, the test violates the spec. See w3c/uievents#278. However, it's the behavior of all major browsers and the desired one. The spec should be fixed separately in above ticket. Differential Revision: https://phabricator.services.mozilla.com/D106082 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1674658 gecko-commit: 580b096a83eaf535229d0d1bce67f5966570ad29 gecko-reviewers: smaug
Currently, the test violates the spec. See w3c/uievents#278. However, it's the behavior of all major browsers and the desired one. The spec should be fixed separately in above ticket. Differential Revision: https://phabricator.services.mozilla.com/D106082
Currently, the test violates the spec. See w3c/uievents#278. However, it's the behavior of all major browsers and the desired one. The spec should be fixed separately in above ticket. Differential Revision: https://phabricator.services.mozilla.com/D106082 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1674658 gecko-commit: 580b096a83eaf535229d0d1bce67f5966570ad29 gecko-reviewers: smaug
Currently, the test violates the spec. See w3c/uievents#278. However, it's the behavior of all major browsers and the desired one. The spec should be fixed separately in above ticket. Differential Revision: https://phabricator.services.mozilla.com/D106082 UltraBlame original commit: 580b096a83eaf535229d0d1bce67f5966570ad29
Currently, the test violates the spec. See w3c/uievents#278. However, it's the behavior of all major browsers and the desired one. The spec should be fixed separately in above ticket. Differential Revision: https://phabricator.services.mozilla.com/D106082 UltraBlame original commit: 580b096a83eaf535229d0d1bce67f5966570ad29
Currently, the test violates the spec. See w3c/uievents#278. However, it's the behavior of all major browsers and the desired one. The spec should be fixed separately in above ticket. Differential Revision: https://phabricator.services.mozilla.com/D106082 UltraBlame original commit: 580b096a83eaf535229d0d1bce67f5966570ad29
Seems the Firefox behavior has changed to match others 🙂 |
@saschanaz Your comment on Jan 13 is correct, and I convinced myself we should retry removing the |
I think it was per #278 (comment). I still think it's hacky and |
Yes.
Sure, this can be changed. I agree that it would be cleaner. @rniwa: any concerns from your side? |
Change what? |
What's mentioned in #278 (comment). |
What does "removing |
Yeah. |
We at Mozilla found that this is not web compatible since jQuery Mobile calls MouseEvent#preventDefault() on desktop browsers without expecting mousemove. We had to restore our previous behavior after getting regression reports. We should probably prefer selectionchange event for this purpose and make mousemove not cancelable. |
@saschanaz so how does it work with other browsers such as Chrome? There's probably other behavior difference of Firefox vs Chrome beyond the cancelability of mousemove? |
A weird bug in Chrome prevents canceling mousemove default action when CSS |
I got confused with this today after seeing that the WPT is passing in Chrome! I think this is because the test ends too early before catching the Chrome problem. Before I land the change, I wanted to double-check: @saschanaz you meant Mozilla now ignores
Unfortunately, the |
Weird, not sure what happened exactly, but the test suddenly started to pass around October 2022 without any implementation change nor the test change. I wonder any test harness change affected it. |
@jgraham might know what happened? |
Looks like it was actually fixed in July by https://bugzilla.mozilla.org/show_bug.cgi?id=1543337 |
That didn't touch |
A canceled mousemove should not suppress the following selectionchange event. The selectionchange event after mousedown is not relevant here. Bug: 346473 Change-Id: I48f776b68cda4b2294fdd973bf45c2e88d1d47ff Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4081610 Reviewed-by: Kevin Ellis <[email protected]> Commit-Queue: Mustaq Ahmed <[email protected]> Cr-Commit-Position: refs/heads/main@{#1079979}
This is related to w3c/uievents#278. Bug: 346473 Change-Id: I0bc9d732369a0fa5eb8f4a4bcc04c7eabce26e6b
This is related to w3c/uievents#278. Bug: 346473 Change-Id: I0bc9d732369a0fa5eb8f4a4bcc04c7eabce26e6b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4086261 Reviewed-by: Kevin Ellis <[email protected]> Commit-Queue: Mustaq Ahmed <[email protected]> Cr-Commit-Position: refs/heads/main@{#1080459}
This is related to w3c/uievents#278. Bug: 346473 Change-Id: I0bc9d732369a0fa5eb8f4a4bcc04c7eabce26e6b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4086261 Reviewed-by: Kevin Ellis <[email protected]> Commit-Queue: Mustaq Ahmed <[email protected]> Cr-Commit-Position: refs/heads/main@{#1080459}
This is related to w3c/uievents#278. Bug: 346473 Change-Id: I0bc9d732369a0fa5eb8f4a4bcc04c7eabce26e6b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4086261 Reviewed-by: Kevin Ellis <[email protected]> Commit-Queue: Mustaq Ahmed <[email protected]> Cr-Commit-Position: refs/heads/main@{#1080459}
…move doesn't affect drag., a=testonly Automatic update from web-platform-tests [Interop] Add a WPT that canceling mousemove doesn't affect drag. This is related to w3c/uievents#278. Bug: 346473 Change-Id: I0bc9d732369a0fa5eb8f4a4bcc04c7eabce26e6b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4086261 Reviewed-by: Kevin Ellis <[email protected]> Commit-Queue: Mustaq Ahmed <[email protected]> Cr-Commit-Position: refs/heads/main@{#1080459} -- wpt-commits: 295326a59547f180def6ca57e5794fa68e07939f wpt-pr: 37377
This is related to w3c/uievents#278. Bug: 346473 Change-Id: I0bc9d732369a0fa5eb8f4a4bcc04c7eabce26e6b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4086261 Reviewed-by: Kevin Ellis <[email protected]> Commit-Queue: Mustaq Ahmed <[email protected]> Cr-Commit-Position: refs/heads/main@{#1080459}
…move doesn't affect drag., a=testonly Automatic update from web-platform-tests [Interop] Add a WPT that canceling mousemove doesn't affect drag. This is related to w3c/uievents#278. Bug: 346473 Change-Id: I0bc9d732369a0fa5eb8f4a4bcc04c7eabce26e6b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4086261 Reviewed-by: Kevin Ellis <[email protected]> Commit-Queue: Mustaq Ahmed <[email protected]> Cr-Commit-Position: refs/heads/main@{#1080459} -- wpt-commits: 295326a59547f180def6ca57e5794fa68e07939f wpt-pr: 37377
Looking back at this issue after a while, I get a partial picture about compat problems with two orthogonal default actions of
We need to check each event on Chrome, Firefox and Safari for a complete picture. |
Just noticed @mustaqahmed's Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/fyVzOAmQHzU, I guess we can close this issue once Chrome ships it successfully. |
I agree we can close it. Chrome is shipping it on M125 (Stable to be released in ~a week), and the WPT is passing in all browsers. |
Per https://bugzilla.mozilla.org/show_bug.cgi?id=1674658 and https://jsfiddle.net/zu0jpar2/ in particular this seems like some hacky way to prevent text selection in Chrome/Safari that does not work in Firefox. The specification just says that
mousemove
is cancelable, but doesn't describe what that means.The text was updated successfully, but these errors were encountered: