WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
13897
Dragging a file onto <input type="file"> should give distinct visual feedback
https://bugs.webkit.org/show_bug.cgi?id=13897
Summary
Dragging a file onto <input type="file"> should give distinct visual feedback
David Kilzer (:ddkilzer)
Reported
2007-05-28 06:12:37 PDT
When dragging files onto an <input type="file"> element, visual feedback is required so that the user knows where to drop the file so that it will be set as the file upload path instead of being opened in the browser. Regarding visual feedback, I think either a cursor change or a focus ring around the input element (or both) would be sufficient. See: <
rdar://problem/4728842
> Can't drag-and-drop files onto <input type="file">
Attachments
Patch
(9.29 KB, patch)
2011-11-04 16:36 PDT
,
Jon Lee
no flags
Details
Formatted Diff
Diff
Patch
(9.30 KB, patch)
2011-11-05 10:02 PDT
,
Jon Lee
mitz: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
David Kilzer (:ddkilzer)
Comment 1
2007-05-28 06:14:17 PDT
<
rdar://problem/5232483
>
mitz
Comment 2
2007-05-28 06:34:39 PDT
The previous implementation applied a tint to the background of the control when it was being targeted.
Oliver Hunt
Comment 3
2007-05-28 15:38:14 PDT
I see a (+) cursor when i drag a file over the input. But yes, it would probably help if there was some kind of feedback that was more distinguishable
David Kilzer (:ddkilzer)
Comment 4
2007-05-28 15:42:13 PDT
(In reply to
comment #3
)
> I see a (+) cursor when i drag a file over the input.
That's true for any document type that Safari will accept, like an image or HTML. The (+) cursor starts when you enter the page boundary, not when you get to the input element, so you don't know what will happen when you drop it. :(
David Kilzer (:ddkilzer)
Comment 5
2007-10-29 21:19:48 PDT
***
Bug 15753
has been marked as a duplicate of this bug. ***
Eric Seidel (no email)
Comment 6
2008-02-18 11:24:25 PST
When I initially added type=file drops, it drew a focus ring. it was a bit strange looking on some sites, but it worked. That support was lost when forms moved out of NSViews, it seems.
David Kilzer (:ddkilzer)
Comment 7
2008-02-20 07:47:25 PST
***
Bug 17024
has been marked as a duplicate of this bug. ***
Alexey Proskuryakov
Comment 8
2009-12-14 15:49:39 PST
***
Bug 32493
has been marked as a duplicate of this bug. ***
Jon Lee
Comment 9
2011-09-30 16:02:30 PDT
<
rdar://problem/5232483
>
Jon Lee
Comment 10
2011-11-01 14:38:08 PDT
Split out some tasks for the multiple file case. This bug can track the single file drag case.
Jon Lee
Comment 11
2011-11-04 16:36:53 PDT
Created
attachment 113733
[details]
Patch
mitz
Comment 12
2011-11-04 16:50:44 PDT
Comment on
attachment 113733
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=113733&action=review
r- because of the potential stale pointer issue. Other than that I think the patch is okay!
> Source/WebCore/page/DragController.h:121 > + HTMLInputElement* m_fileInputElementUnderMouse;
I am not convinced that using a raw pointer here is safe. For example, it seems like a script could remove the element from the document while the user is dragging.
Jon Lee
Comment 13
2011-11-05 10:02:52 PDT
Created
attachment 113757
[details]
Patch
mitz
Comment 14
2011-11-05 11:06:07 PDT
Comment on
attachment 113757
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=113757&action=review
> Source/WebCore/page/DragController.cpp:91 > + , m_fileInputElementUnderMouse(0)
No need to initialize a RefPtr to 0.
Jon Lee
Comment 15
2011-11-05 21:27:57 PDT
Committed
r99369
: <
http://trac.webkit.org/changeset/99369
>
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