WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Fix layout test and remove old assert
bug-79172-20120403114919.patch (text/plain), 6.88 KB, created by
Daniel Cheng
on 2012-04-03 11:49:20 PDT
(
hide
)
Description:
Fix layout test and remove old assert
Filename:
MIME Type:
Creator:
Daniel Cheng
Created:
2012-04-03 11:49:20 PDT
Size:
6.88 KB
patch
obsolete
>Subversion Revision: 113054 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index db1ee625d981f9e7d4469c93c241bab608a1b973..0bca39a3f1a37cddcc9315fa86215d0c93eb8d04 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2012-04-03 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 Ryosuke Niwa. >+ >+ 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): >+ (WebCore::DragController::concludeEditDrag): >+ > 2012-04-03 Ryosuke Niwa <rniwa@webkit.org> > > REGRESSION(r80439): Crash in StylePropertySet::borderSpacingValue >diff --git a/Source/WebCore/page/DragController.cpp b/Source/WebCore/page/DragController.cpp >index dfeb5298907e7512d8aef9f270be0ee4b5c705c6..cfdc9c5d6f13d6abc39da2d6f4c7c8f35e2b251e 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; > } >@@ -422,7 +422,6 @@ bool DragController::dispatchTextInputEventFor(Frame* innerFrame, DragData* drag > bool DragController::concludeEditDrag(DragData* dragData) > { > ASSERT(dragData); >- ASSERT(!m_isHandlingDrag); > > RefPtr<HTMLInputElement> fileInput = m_fileInputElementUnderMouse; > if (m_fileInputElementUnderMouse) { >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 457ac7be95821fccfe0a482070a586843ff039e0..22db564f43ebb25233e8b44248a07cf238cce6d4 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2012-04-03 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 Ryosuke Niwa. >+ >+ * fast/events/drag-dataTransferItemList.html: Fix drop handler to prevent default. >+ * fast/events/drop-handler-should-not-stop-navigate-expected.txt: Added. >+ * fast/events/drop-handler-should-not-stop-navigate.html: Added. >+ * http/tests/security/clipboard/clipboard-file-access.html: Change dragover to drop handler >+ to prevent bubbled events from causing navigation. >+ > 2012-04-03 Tom Zakrajsek <tomz@codeaurora.org> > > Expectations update after 82734 >diff --git a/LayoutTests/fast/events/drag-dataTransferItemList.html b/LayoutTests/fast/events/drag-dataTransferItemList.html >index bc332e9556ed8d7e9c9c1d52027b262a19dbbcdb..17f0855ec46495cc5f4d361e894ab488fbfafdc4 100644 >--- a/LayoutTests/fast/events/drag-dataTransferItemList.html >+++ b/LayoutTests/fast/events/drag-dataTransferItemList.html >@@ -131,6 +131,7 @@ function drop(event) > legacyDrop(event.dataTransfer); > else if (dropMethod.selectedIndex == 1) > itemListDrop(event.dataTransfer); >+ event.preventDefault(); > } > > function runTest(dragMethodIndex, dropMethodIndex) >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..e8a5ebc784cd0624b015ce6127d56b3fade60e71 >--- /dev/null >+++ b/LayoutTests/fast/events/drop-handler-should-not-stop-navigate-expected.txt >@@ -0,0 +1,5 @@ >+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 >+Not preventing default event on drop. >+PASS >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..97d5acef628d1d846a03123396806e3b20e9cd04 >--- /dev/null >+++ b/LayoutTests/fast/events/drop-handler-should-not-stop-navigate.html >@@ -0,0 +1,50 @@ >+<!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))); >+} >+window.addEventListener('beforeunload', function () >+{ >+ log('PASS'); >+ layoutTestController.notifyDone(); >+}); >+document.body.addEventListener('dragenter', function (event) >+{ >+ event.preventDefault(); >+}); >+document.body.addEventListener('dragover', function (event) >+{ >+ event.preventDefault(); >+}); >+document.body.addEventListener('drop', function (event) >+{ >+ log('Not preventing default event on drop.'); >+}); >+(function () >+{ >+ if (!window.layoutTestController) >+ return; >+ layoutTestController.dumpAsText(); >+ layoutTestController.waitUntilDone(); >+ log('Starting test'); >+ eventSender.beginDragWithFiles(['DRTFakeFile']); >+ eventSender.mouseMoveTo(document.body.offsetLeft + 10, document.body.offsetTop + 10); >+ eventSender.mouseUp(); >+ window.setTimeout(function () >+ { >+ // Deadman's switch so we don't need to wait for the test to timeout to fail. >+ log('FAIL'); >+ layoutTestController.notifyDone(); >+ }, 0); >+})(); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/http/tests/security/clipboard/clipboard-file-access.html b/LayoutTests/http/tests/security/clipboard/clipboard-file-access.html >index 9801223d937a54f6dee31518f2f621108677a932..1d23d5976ccbf78afeb78de07d8dbff61e967b43 100644 >--- a/LayoutTests/http/tests/security/clipboard/clipboard-file-access.html >+++ b/LayoutTests/http/tests/security/clipboard/clipboard-file-access.html >@@ -55,7 +55,7 @@ dragTarget.addEventListener("drop", function() { > // Some tests don't end up dropping the draggee over the drag target. Catch any > // leftover drop events bubbling up through the tree so they don't cause page > // navigation. >-document.body.addEventListener("dragover", function() { >+document.body.addEventListener("drop", function() { > event.preventDefault(); > }); >
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
Flags:
tony
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 79172
:
128321
|
128327
| 135379