Bug 105516

Summary: PDFPlugin: Cannot drop files/URLs on PDFPlugin
Product: WebKit Reporter: Tim Horton <thorton>
Component: PDFAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal Keywords: InRadar
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch ap: review+, ap: commit-queue-

Description Tim Horton 2012-12-20 02:14:52 PST
<rdar://problem/12729443>

DragController has rejected drags onto PluginDocument since the beginning of time. PDFPlugin would rather this weren't the case, as we can guarantee it doesn't have anything else handling drags.
Comment 1 Tim Horton 2012-12-20 02:29:24 PST
Created attachment 180306 [details]
patch
Comment 2 Alexey Proskuryakov 2012-12-20 09:55:06 PST
Comment on attachment 180306 [details]
patch

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

> we can guarantee it doesn't have anything else handling drags.

Not even text fields in PDF forms?

> Source/WebCore/page/DragController.cpp:413
> +    if (doc->isPluginDocument()) {

There is a null check for doc below. Either it's not needed, or this new code can crash.

> Source/WebCore/page/DragController.cpp:415
> +        const PluginViewBase* pluginView = widget && widget->isPluginViewBase() ? static_cast<const PluginViewBase*>(widget) : 0;

I like to have braces around ternary conditions FWIW - it makes them look more like if () conditions.
Comment 3 Tim Horton 2012-12-20 10:11:35 PST
(In reply to comment #2)
> (From update of attachment 180306 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=180306&action=review
> 
> > we can guarantee it doesn't have anything else handling drags.
> 
> Not even text fields in PDF forms?

Ugh. I will test.
Comment 4 Tim Horton 2012-12-21 02:32:46 PST
http://trac.webkit.org/changeset/138361
Comment 5 Tim Horton 2012-12-21 02:35:46 PST
(In reply to comment #3)
> (In reply to comment #2)
> > (From update of attachment 180306 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=180306&action=review
> > 
> > > we can guarantee it doesn't have anything else handling drags.
> > 
> > Not even text fields in PDF forms?
> 
> Ugh. I will test.

These are OK because they're handled as they would be in a normal page. They get the drag and not the document.