Bug 90159

Summary: user-select: none cursor turns to I-beam on mouse dragging
Product: WebKit Reporter: Yves Van Goethem <yves.vangoethem>
Component: UI EventsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: ap, commit-queue, darin, enrica, mitz, rniwa, vani.hegde, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://yves.vg/testcases/chrome/user_select_none_dragging.html
Attachments:
Description Flags
Patch
none
Patch none

Description Yves Van Goethem 2012-06-28 04:11:59 PDT
Observation:
When you start selecting an area that has user-select:none; and drag the cursor around, it changes to a text cursor.

Expected:
The cursor should be default as defined.
Comment 1 Vani Hegde 2013-09-24 22:07:25 PDT
Created attachment 212536 [details]
Patch
Comment 2 Vani Hegde 2013-09-24 22:13:36 PDT
This has got nothing to do with user-select:none. The bug here is cursor type being changed to text cursor(I-Beam cursor) during selection, even when the cursor type is explicitly set to be something else.

This is committed in blink https://codereview.chromium.org/23461040/
Comment 3 Ryosuke Niwa 2013-09-25 10:41:42 PDT
It seems like this is done intentionally. I'm not sure changing this behavior is desirable.
Comment 4 Ryosuke Niwa 2013-09-25 10:49:09 PDT
Hm... looking more closely, maybe this is a regression from http://trac.webkit.org/changeset/11490.
Comment 5 Ryosuke Niwa 2013-09-25 10:53:35 PDT
Comment on attachment 212536 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=212536&action=review

> Source/WebCore/page/EventHandler.cpp:1371
> +        // During selection, use an I-beam no matter what we're over.

We should probably rephrase this comment to something along the line of "use an I-beam regardless of the content beneath the cursor when cursor is not explicitly specified."
since now we're respecting cursor CSS property during text selection.
Comment 6 Ryosuke Niwa 2013-09-25 10:56:03 PDT
Comment on attachment 212536 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=212536&action=review

> LayoutTests/editing/caret/selection-with-caret-type-progress.html:10
> +    description('Tests whether explicitly set caret style is retained on performing text selection');

The description can be outside of this if.
It would be nice if you had something like debug("This test requires eventSender") in the else clause. Better yet, explain how to manually test it.
Comment 7 Radar WebKit Bug Importer 2013-09-25 11:17:09 PDT
<rdar://problem/15078860>
Comment 8 Vani Hegde 2013-09-25 20:14:06 PDT
(In reply to comment #5)
> (From update of attachment 212536 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=212536&action=review
> 
> > Source/WebCore/page/EventHandler.cpp:1371
> > +        // During selection, use an I-beam no matter what we're over.
> 
> We should probably rephrase this comment to something along the line of "use an I-beam regardless of the content beneath the cursor when cursor is not explicitly specified."
> since now we're respecting cursor CSS property during text selection.

Will do.
Comment 9 Vani Hegde 2013-09-25 20:43:39 PDT
Created attachment 212658 [details]
Patch
Comment 10 Vani Hegde 2013-09-25 20:44:33 PDT
Uploaded patch with review comments incorporated.
Comment 11 WebKit Commit Bot 2013-09-30 00:11:29 PDT
Comment on attachment 212658 [details]
Patch

Clearing flags on attachment: 212658

Committed r156635: <http://trac.webkit.org/changeset/156635>
Comment 12 WebKit Commit Bot 2013-09-30 00:11:33 PDT
All reviewed patches have been landed.  Closing bug.
Comment 13 mitz 2014-01-17 15:34:46 PST
(In reply to comment #11)
> (From update of attachment 212658 [details])
> Clearing flags on attachment: 212658
> 
> Committed r156635: <http://trac.webkit.org/changeset/156635>

This caused bug 127197.
Comment 14 Ryosuke Niwa 2014-04-22 16:02:36 PDT
(In reply to comment #13)
> (In reply to comment #11)
> > (From update of attachment 212658 [details] [details])
> > Clearing flags on attachment: 212658
> > 
> > Committed r156635: <http://trac.webkit.org/changeset/156635>
> 
> This caused bug 127197.

As I suspect, the old behavior was indeed intended.  Revering the patch.
Comment 15 Ryosuke Niwa 2014-04-22 16:06:29 PDT
Reverted the patch in http://trac.webkit.org/changeset/167688.