Commit 1625e181 authored by ggaren@apple.com's avatar ggaren@apple.com

WebCore:

2009-05-21  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Sam Weinig.
        
        Test for <rdar://problem/6910832> | https://bugs.webkit.org/show_bug.cgi?id=25907
        Incorrect URL returned to the DOM while the user drags a file

        * page/DragController.cpp:
        (WebCore::DragController::dragExited):
        (WebCore::DragController::tryDHTMLDrag): Don't base our decision on KURL,
        since that only looks at the text of the document's URL. Do base our
        decision on the securityOrigin(), which knows more about the document's
        actual origin.

LayoutTests:

2009-05-21  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Sam Weinig.
        
        Tests for <rdar://problem/6910832> | https://bugs.webkit.org/show_bug.cgi?id=25907
        Incorrect URL returned to the DOM while the user drags a file

        * http/tests/local/drag-over-remote-content-expected.txt: Added.
        * http/tests/local/drag-over-remote-content.html: Added.
        * http/tests/security/drag-over-remote-content-iframe-expected.txt: Added.
        * http/tests/security/drag-over-remote-content-iframe.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@44010 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4d8c3b53
2009-05-21 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Tests for <rdar://problem/6910832> | https://bugs.webkit.org/show_bug.cgi?id=25907
Incorrect URL returned to the DOM while the user drags a file
* http/tests/local/drag-over-remote-content-expected.txt: Added.
* http/tests/local/drag-over-remote-content.html: Added.
* http/tests/security/drag-over-remote-content-iframe-expected.txt: Added.
* http/tests/security/drag-over-remote-content-iframe.html: Added.
2009-05-21 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
Fixing test to actually use the correct names for the frames.
2009-05-21 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Test for <rdar://problem/6910832> | https://bugs.webkit.org/show_bug.cgi?id=25907
Incorrect URL returned to the DOM while the user drags a file
* page/DragController.cpp:
(WebCore::DragController::dragExited):
(WebCore::DragController::tryDHTMLDrag): Don't base our decision on KURL,
since that only looks at the text of the document's URL. Do base our
decision on the securityOrigin(), which knows more about the document's
actual origin.
2009-05-21 Dan Bernstein <mitz@apple.com>
Rubber-stamped by Mark Rowe.
......@@ -155,7 +155,7 @@ void DragController::dragExited(DragData* dragData)
Frame* mainFrame = m_page->mainFrame();
if (RefPtr<FrameView> v = mainFrame->view()) {
ClipboardAccessPolicy policy = mainFrame->loader()->baseURL().isLocalFile() ? ClipboardReadable : ClipboardTypesReadable;
ClipboardAccessPolicy policy = m_documentUnderMouse->securityOrigin()->isLocal() ? ClipboardReadable : ClipboardTypesReadable;
RefPtr<Clipboard> clipboard = dragData->createClipboard(policy);
clipboard->setSourceOperation(dragData->draggingSourceOperationMask());
mainFrame->eventHandler()->cancelDragAndDrop(createMouseEvent(dragData), clipboard.get());
......@@ -163,6 +163,7 @@ void DragController::dragExited(DragData* dragData)
}
mouseMovedIntoDocument(0);
}
DragOperation DragController::dragUpdated(DragData* dragData)
{
......@@ -457,18 +458,18 @@ DragOperation DragController::tryDHTMLDrag(DragData* dragData)
ASSERT(dragData);
ASSERT(m_documentUnderMouse);
DragOperation op = DragOperationNone;
RefPtr<Frame> frame = m_page->mainFrame();
RefPtr<FrameView> viewProtector = frame->view();
RefPtr<Frame> mainFrame = m_page->mainFrame();
RefPtr<FrameView> viewProtector = mainFrame->view();
if (!viewProtector)
return DragOperationNone;
ClipboardAccessPolicy policy = frame->loader()->baseURL().isLocalFile() ? ClipboardReadable : ClipboardTypesReadable;
ClipboardAccessPolicy policy = m_documentUnderMouse->securityOrigin()->isLocal() ? ClipboardReadable : ClipboardTypesReadable;
RefPtr<Clipboard> clipboard = dragData->createClipboard(policy);
DragOperation srcOp = dragData->draggingSourceOperationMask();
clipboard->setSourceOperation(srcOp);
PlatformMouseEvent event = createMouseEvent(dragData);
if (frame->eventHandler()->updateDragAndDrop(event, clipboard.get())) {
if (mainFrame->eventHandler()->updateDragAndDrop(event, clipboard.get())) {
// *op unchanged if no source op was set
if (!clipboard->destinationOperation(op)) {
// The element accepted but they didn't pick an operation, so we pick one for them
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment