Bug 196511 - Cursor count badge reverts to Zero during Drag & Drop of multiple items
Summary: Cursor count badge reverts to Zero during Drag & Drop of multiple items
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Timothy Hatcher
URL:
Keywords: InRadar
: 181081 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-04-02 15:41 PDT by Timothy Hatcher
Modified: 2019-04-03 11:36 PDT (History)
7 users (show)

See Also:


Attachments
Patch (2.30 KB, patch)
2019-04-02 15:43 PDT, Timothy Hatcher
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2019-04-02 15:41:44 PDT
When you drag & drop multiple files to iCloud Drive or a text field, the mouse cursor gives a Zero (0) file count, regardless of the number of files you have.

<rdar://problem/34373187>
Comment 1 Timothy Hatcher 2019-04-02 15:43:19 PDT
Created attachment 366545 [details]
Patch
Comment 2 Daniel Bates 2019-04-02 19:58:23 PDT
Comment on attachment 366545 [details]
Patch

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

Bade is UI. So, likely no way to test.

> Source/WebCore/page/DragController.cpp:-464
> -            m_numberOfItemsToBeAccepted = numberOfFiles != 1 ? 0 : 1;

I can’t help but wonder, why? Why did we do this? I so want to understand the comment, but it is broken English. Could this be a platform/port-specific hack? Windows? GTK? If so, need to move hack. <—- not cq’ing because of this
Comment 3 Timothy Hatcher 2019-04-02 20:19:57 PDT
Comment on attachment 366545 [details]
Patch

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

>> Source/WebCore/page/DragController.cpp:-464
>> -            m_numberOfItemsToBeAccepted = numberOfFiles != 1 ? 0 : 1;
> 
> I can’t help but wonder, why? Why did we do this? I so want to understand the comment, but it is broken English. Could this be a platform/port-specific hack? Windows? GTK? If so, need to move hack. <—- not cq’ing because of this

This was added by Jon Lee 7 years ago. It was to provide more info to the user what might happen when the drag moves over elements in the page. I think it just wasn’t fully thought out.

https://trac.webkit.org/changeset/99108/webkit
Comment 4 WebKit Commit Bot 2019-04-02 20:46:42 PDT
Comment on attachment 366545 [details]
Patch

Clearing flags on attachment: 366545

Committed r243785: <https://trac.webkit.org/changeset/243785>
Comment 5 WebKit Commit Bot 2019-04-02 20:46:44 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Wenson Hsieh 2019-04-02 20:59:37 PDT
Comment on attachment 366545 [details]
Patch

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

>>> Source/WebCore/page/DragController.cpp:-464
>>> -            m_numberOfItemsToBeAccepted = numberOfFiles != 1 ? 0 : 1;
>> 
>> I can’t help but wonder, why? Why did we do this? I so want to understand the comment, but it is broken English. Could this be a platform/port-specific hack? Windows? GTK? If so, need to move hack. <—- not cq’ing because of this
> 
> This was added by Jon Lee 7 years ago. It was to provide more info to the user what might happen when the drag moves over elements in the page. I think it just wasn’t fully thought out.
> 
> https://trac.webkit.org/changeset/99108/webkit

We should ensure that dragging multiple files over a regular input type=file does not cause the drop to occur.
Comment 7 Wenson Hsieh 2019-04-02 21:00:12 PDT
(In reply to Wenson Hsieh from comment #6)
> Comment on attachment 366545 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=366545&action=review
> 
> >>> Source/WebCore/page/DragController.cpp:-464
> >>> -            m_numberOfItemsToBeAccepted = numberOfFiles != 1 ? 0 : 1;
> >> 
> >> I can’t help but wonder, why? Why did we do this? I so want to understand the comment, but it is broken English. Could this be a platform/port-specific hack? Windows? GTK? If so, need to move hack. <—- not cq’ing because of this
> > 
> > This was added by Jon Lee 7 years ago. It was to provide more info to the user what might happen when the drag moves over elements in the page. I think it just wasn’t fully thought out.
> > 
> > https://trac.webkit.org/changeset/99108/webkit
> 
> We should ensure that dragging multiple files over a regular input type=file
> does not cause the drop to occur.

(Regular file input, as opposed to an <input type=file multiple>)
Comment 8 Wenson Hsieh 2019-04-02 21:10:57 PDT
(In reply to Wenson Hsieh from comment #7)
> (In reply to Wenson Hsieh from comment #6)
> > Comment on attachment 366545 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=366545&action=review
> > 
> > >>> Source/WebCore/page/DragController.cpp:-464
> > >>> -            m_numberOfItemsToBeAccepted = numberOfFiles != 1 ? 0 : 1;
> > >> 
> > >> I can’t help but wonder, why? Why did we do this? I so want to understand the comment, but it is broken English. Could this be a platform/port-specific hack? Windows? GTK? If so, need to move hack. <—- not cq’ing because of this
> > > 
> > > This was added by Jon Lee 7 years ago. It was to provide more info to the user what might happen when the drag moves over elements in the page. I think it just wasn’t fully thought out.
> > > 
> > > https://trac.webkit.org/changeset/99108/webkit
> > 
> > We should ensure that dragging multiple files over a regular input type=file
> > does not cause the drop to occur.
> 
> (Regular file input, as opposed to an <input type=file multiple>)

Oh sorry, I misread the branch. The change looks right — I can't think of any reason why we wouldn't want to update m_numberOfItemsToBeAccepted when dragging a single file, when we're not dropping over a file input.
Comment 9 Timothy Hatcher 2019-04-02 21:25:04 PDT
Comment on attachment 366545 [details]
Patch

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

>>>>>> Source/WebCore/page/DragController.cpp:-464
>>>>>> -            m_numberOfItemsToBeAccepted = numberOfFiles != 1 ? 0 : 1;
>>>>> 
>>>>> I can’t help but wonder, why? Why did we do this? I so want to understand the comment, but it is broken English. Could this be a platform/port-specific hack? Windows? GTK? If so, need to move hack. <—- not cq’ing because of this
>>>> 
>>>> This was added by Jon Lee 7 years ago. It was to provide more info to the user what might happen when the drag moves over elements in the page. I think it just wasn’t fully thought out.
>>>> 
>>>> https://trac.webkit.org/changeset/99108/webkit
>>> 
>>> We should ensure that dragging multiple files over a regular input type=file does not cause the drop to occur.
>> 
>> (Regular file input, as opposed to an <input type=file multiple>)
> 
> Oh sorry, I misread the branch. The change looks right — I can't think of any reason why we wouldn't want to update m_numberOfItemsToBeAccepted when dragging a single file, when we're not dropping over a file input.

Yep, the if (m_fileInputElementUnderMouse) block handles that.
Comment 10 Alexey Proskuryakov 2019-04-03 10:24:51 PDT
Is this the same as bug 181081?
Comment 11 Timothy Hatcher 2019-04-03 11:32:01 PDT
*** Bug 181081 has been marked as a duplicate of this bug. ***
Comment 12 Timothy Hatcher 2019-04-03 11:36:04 PDT
(In reply to Alexey Proskuryakov from comment #10)
> Is this the same as bug 181081?

Yes.