WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
42660
mousedown in canvas should not trigger selection in document
https://bugs.webkit.org/show_bug.cgi?id=42660
Summary
mousedown in canvas should not trigger selection in document
Tony Gentilcore
Reported
2010-07-20 13:07:57 PDT
1. Open
http://alteredqualia.com/canvasmol/
2. Click down on the rotating molecule 3. With the mouse button depressed, drag outside of the molecule to another point on the page Notice that text in the page becomes selected. There are a lot of cool HTML5 canvas demos that show off capabilities equivalent to flash. However, when interacting with them, I always get really annoyed by the fact that I frequently accidentally select other text/elements on the page. This doesn't seem to happen for plugins. Rather than swallowing the events like plugins do, I think a reasonable heuristic would be to simply disallow selection if the selection begins inside of a canvas. But the mouseup/mousemove events would still go to the rest of the page in every other way. Thoughts?
Attachments
test case: click and drag or double click the canvas; compare to img
(344 bytes, text/html)
2011-07-23 13:18 PDT
,
Evan Jones
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Erik Arvidsson
Comment 1
2010-07-20 13:27:43 PDT
This is easy. All we need to do is to make canStartSelection return false for HTMLCanvasElement. The question is if we want to do this?
Ojan Vafai
Comment 2
2010-07-20 13:42:45 PDT
My first reaction was that the current behavior is correct and that web developers can cancel mousedown if they don't want to perform a selection. But all the elements I can think of the are atomic (img, input type=radio, button, etc) the way canvas is don't allow starting selections. So, I think it makes sense to make canvas the same. FWIW, not selectioning also matches Firefox.
Evan Jones
Comment 3
2011-07-23 13:18:11 PDT
Created
attachment 101819
[details]
test case: click and drag or double click the canvas; compare to img Double clicks cause the same "unexpected" behaviour: It causes the text following the <canvas> to be selected, whereas an <img> element does not do the same (attaching a stupid test case for this).
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug