Bug 15106 - REGRESSION: Can't drag text as element when user-select is set to none
Summary: REGRESSION: Can't drag text as element when user-select is set to none
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 523.x (Safari 3)
Hardware: Macintosh OS X 10.4
: P1 Normal
Assignee: Mark Rowe (bdash)
URL:
Keywords: InRadar, Regression
Depends on:
Blocks:
 
Reported: 2007-08-29 01:20 PDT by Dustin MacDonald
Modified: 2009-07-22 21:31 PDT (History)
9 users (show)

See Also:


Attachments
Test case (79 bytes, text/html)
2007-08-29 06:52 PDT, David Kilzer (:ddkilzer)
no flags Details
Patch (9.84 KB, patch)
2009-06-20 14:45 PDT, Mark Rowe (bdash)
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dustin MacDonald 2007-08-29 01:20:10 PDT
Dragging text as an element using the -khtml-user-drag selector does not work. The text selector cursor appears as if the text was selectable and the element cannot be dragged. This used to work in previous WebKit builds. Try code example below:

<div style="-khtml-user-select:none;-khtml-user-drag:element;">drag text</div>
Comment 1 mitz 2007-08-29 03:25:06 PDT
Probably regressed in <http://trac.webkit.org/projects/webkit/changeset/25057>.
Comment 2 David Kilzer (:ddkilzer) 2007-08-29 06:51:45 PDT
<rdar://problem/5446484>
Comment 3 David Kilzer (:ddkilzer) 2007-08-29 06:52:24 PDT
Created attachment 16155 [details]
Test case
Comment 4 Darin Adler 2007-08-29 16:59:42 PDT
Is there a real site depending on this? How did you discover this problem? It's important that we understand the impact of this so we can gauge the importance of a quick fix.
Comment 5 Dustin MacDonald 2007-08-29 17:27:37 PDT
I am working on a WebKit-based app for Mac OS X which uses JavaScript drag and drop extensively. I noticed the change in the latest Leopard seed (9A527).

After reviewing the 25057 changeset that mitz@webkit.org posted, it appears that the desired functionality can now be obtained using "-khtml-user-select: ignore". So, a workaround is available, but I imagine this change could break lots of third party WebKit-based apps and Dashboard widgets.
Comment 6 Darin Adler 2007-08-29 17:30:23 PDT
(In reply to comment #5)
> I imagine this change could break lots of third party WebKit-based apps and Dashboard widgets.

Please add a note here if anyone reading this discovers a specific WebKit-based application or Dashboard widget that is affected.
Comment 7 mitz 2007-09-19 11:19:17 PDT
(In reply to comment #1)
> Probably regressed in <http://trac.webkit.org/projects/webkit/changeset/25057>.

That change has been rolled out and eventually replaced by <http://trac.webkit.org/projects/webkit/changeset/25641>.
Comment 8 mitz 2007-09-19 11:39:07 PDT
(In reply to comment #5)
> After reviewing the 25057 changeset that mitz@webkit.org posted, it appears
> that the desired functionality can now be obtained using "-khtml-user-select:
> ignore".

After r25641, this workaround is no longer possible.
Comment 9 Tom Brown 2007-11-06 09:35:43 PST
This bug is causing the drag and drop feature in my web application to not work. Have any other workarounds been found?

My web application is: http://www.bungeelabs.com/
Comment 10 Mirela Correa 2009-03-03 10:15:08 PST
I am facing this problem in my we application.

Any news on this bug? Will it be fixed? Any workarounds?

Thanks!

Comment 11 Jessie Berlin 2009-06-19 17:24:21 PDT
A temporary workaround:

<span style="-webkit-user-drag: element;" ondragstart="SpanDragHandler()">
<span style="z-index: -1; position: relative; -webkit-user-select: none;">drag me</span>
</span>

The z-index makes it so that the outer span is hit-tested first.
Comment 12 Mark Rowe (bdash) 2009-06-19 20:52:38 PDT
I've got a fix for this, and will post it after I've come up with a regression test.
Comment 13 Mark Rowe (bdash) 2009-06-20 14:45:59 PDT
Created attachment 31600 [details]
Patch
Comment 14 mitz 2009-06-20 14:51:34 PDT
Comment on attachment 31600 [details]
Patch

> +        RenderStyle *style = renderer()->style();

The * should go next to RenderStyle. r=me
Comment 15 Mark Rowe (bdash) 2009-06-20 14:55:06 PDT
Fixed in r44902.
Comment 16 David Kilzer (:ddkilzer) 2009-07-22 21:31:56 PDT
(In reply to comment #15)
> Fixed in r44902.

http://trac.webkit.org/changeset/44902