WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-79172-20120222162707.patch (text/plain), 4.80 KB, created by
Daniel Cheng
on 2012-02-22 16:27:08 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Daniel Cheng
Created:
2012-02-22 16:27:08 PST
Size:
4.80 KB
patch
obsolete
>Subversion Revision: 108357 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 30d777a25e1a59e5bc574fac89b9739a82dc2d57..df89a0b7202d2f474b4309bf6cced60581de49c1 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,17 @@ >+2012-02-22 Daniel Cheng <dcheng@chromium.org> >+ >+ Having a drop handler prevents navigation on drop even if event is not cancelled >+ https://bugs.webkit.org/show_bug.cgi?id=79172 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Only early return if the drop handler prevents the default action. >+ >+ Test: fast/events/drop-handler-should-not-stop-navigate.html >+ >+ * page/DragController.cpp: >+ (WebCore::DragController::performDrag): >+ > 2012-02-21 Alexander Pavlov <apavlov@chromium.org> > > Web Inspector: [SuggestBox] textPrompt.css disablement displays garbled suggest box >diff --git a/Source/WebCore/page/DragController.cpp b/Source/WebCore/page/DragController.cpp >index 7919d761e519b8506f7568bfa6d3bd68d31cd47b..e5a8c8b7d272c2feeee03beff17fabe325c9ef92 100644 >--- a/Source/WebCore/page/DragController.cpp >+++ b/Source/WebCore/page/DragController.cpp >@@ -212,7 +212,7 @@ bool DragController::performDrag(DragData* dragData) > preventedDefault = mainFrame->eventHandler()->performDragAndDrop(createMouseEvent(dragData), clipboard.get()); > clipboard->setAccessPolicy(ClipboardNumb); // Invalidate clipboard here for security > } >- if (m_isHandlingDrag || preventedDefault) { >+ if (preventedDefault) { > m_documentUnderMouse = 0; > return true; > } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 6c1484497c4c923b06e6b9b59730c7812613bf06..6dfbae4143a0d12bb238d7b81e8d397c581bbfaa 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2012-02-22 Daniel Cheng <dcheng@chromium.org> >+ >+ Having a drop handler prevents navigation on drop even if event is not cancelled >+ https://bugs.webkit.org/show_bug.cgi?id=79172 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/events/drop-handler-should-not-stop-navigate-expected.txt: Added. >+ * fast/events/drop-handler-should-not-stop-navigate.html: Added. >+ > 2012-02-21 Csaba Osztrogonác <ossy@webkit.org> > > [Qt]REGRESSION(r92254): It made 2 tests timeout >diff --git a/LayoutTests/fast/events/drop-handler-should-not-stop-navigate-expected.txt b/LayoutTests/fast/events/drop-handler-should-not-stop-navigate-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..048f5adcf3d9e514eb7f4e07544b844c3f665561 >--- /dev/null >+++ b/LayoutTests/fast/events/drop-handler-should-not-stop-navigate-expected.txt >@@ -0,0 +1,7 @@ >+This tests that a drop handler's default action must be prevented in order to stop navigation. Otherwise, if event.preventDefault() is not called, navigation should occur. To test manually, simply drag and drop another link or HTML file on this page. If navigation occurs, then the test passed. >+ >+Starting test >+Cancelling dragenter >+Cancelling dragover >+Not preventing default event on drop. >+SUCCESS >diff --git a/LayoutTests/fast/events/drop-handler-should-not-stop-navigate.html b/LayoutTests/fast/events/drop-handler-should-not-stop-navigate.html >new file mode 100644 >index 0000000000000000000000000000000000000000..a8e2cd65e77cc4f205a97770e6eb44ea44b820d3 >--- /dev/null >+++ b/LayoutTests/fast/events/drop-handler-should-not-stop-navigate.html >@@ -0,0 +1,43 @@ >+<!DOCTYPE html> >+<html> >+<body> >+<div>This tests that a drop handler's default action must be prevented in order to stop navigation. >+Otherwise, if event.preventDefault() is not called, navigation should occur. To test manually, >+simply drag and drop another link or HTML file on this page. If navigation occurs, then the test >+passed.</div> >+<script> >+function log(text) >+{ >+ document.body.appendChild(document.createElement('br')); >+ document.body.appendChild(document.createElement('div').appendChild(document.createTextNode(text))); >+} >+if (!window.layoutTestController) >+ return; >+window.addEventListener('beforeunload', function () >+{ >+ log('SUCCESS'); >+ layoutTestController.notifyDone(); >+}); >+document.body.addEventListener('dragenter', function (event) >+{ >+ log('Cancelling dragenter'); >+ event.preventDefault(); >+}); >+document.body.addEventListener('dragover', function (event) >+{ >+ log('Cancelling dragover'); >+ event.preventDefault(); >+}); >+document.body.addEventListener('drop', function (event) >+{ >+ log('Not preventing default event on drop.'); >+}); >+layoutTestController.dumpAsText(); >+layoutTestController.waitUntilDone(); >+log('Starting test\n'); >+eventSender.beginDragWithFiles(['DRTFakeFile']); >+eventSender.mouseMoveTo(document.body.offsetLeft + 10, document.body.offsetTop + 10); >+eventSender.mouseUp(); >+</script> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 79172
:
128321
|
128327
|
135379