Bug 105516 - PDFPlugin: Cannot drop files/URLs on PDFPlugin
Summary: PDFPlugin: Cannot drop files/URLs on PDFPlugin
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: PDF (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-12-20 02:14 PST by Tim Horton
Modified: 2012-12-21 02:35 PST (History)
0 users

See Also:


Attachments
patch (8.52 KB, patch)
2012-12-20 02:29 PST, Tim Horton
ap: review+
ap: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.