-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2010-04-28 Abhishek Arya <inferno@chromium.org>
Reviewed by Eric Seidel. Tests for a crash when an image drag-drop operation happens inside a continuously refreshing iframe. https://bugs.webkit.org/show_bug.cgi?id=37618 * editing/pasteboard/drag-drop-iframe-refresh-crash-expected.txt: Added. * editing/pasteboard/drag-drop-iframe-refresh-crash.html: Added. * editing/resources/drag-drop.html: Added. 2010-04-28 Abhishek Arya <inferno@chromium.org> Reviewed by Eric Seidel. Convert m_documentUnderMouse, m_dragInitiator to RefPtr. Eliminated unused m_dragInitiator accessor to prevent dereferencing. https://bugs.webkit.org/show_bug.cgi?id=37618 Test: editing/pasteboard/drag-drop-iframe-refresh-crash.html * page/DragController.cpp: (WebCore::DragController::tryDocumentDrag): (WebCore::DragController::concludeEditDrag): * page/DragController.h: (WebCore::DragController::draggingImageURL): (WebCore::DragController::documentUnderMouse): Canonical link: https://commits.webkit.org/49710@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@58441 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
7 changed files
with
100 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
LayoutTests/editing/pasteboard/drag-drop-iframe-refresh-crash-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Bug 37618: Crash when an image drag-drop operation happens inside a continuously refreshing iframe. | ||
|
||
SUCCESS |
58 changes: 58 additions & 0 deletions
58
LayoutTests/editing/pasteboard/drag-drop-iframe-refresh-crash.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<html> | ||
<head> | ||
<script> | ||
if (window.layoutTestController) { | ||
layoutTestController.waitUntilDone(); | ||
layoutTestController.dumpAsText(); | ||
} | ||
|
||
function log(message) { | ||
var console = document.getElementById("console"); | ||
var li = document.createElement("li"); | ||
var text = document.createTextNode(message); | ||
|
||
console.appendChild(li); | ||
li.appendChild(text); | ||
} | ||
|
||
function runTest() { | ||
|
||
var doc = window.frames[0].document; | ||
e = doc.getElementById("dragme"); | ||
xdrag = e.offsetLeft + e.offsetWidth / 2; | ||
ydrag = e.offsetTop + e.offsetHeight / 2; | ||
e = doc.getElementById("target"); | ||
xdrop = e.offsetLeft + e.offsetWidth / 2; | ||
ydrop = e.offsetTop + e.offsetHeight / 2; | ||
|
||
var timer = setInterval(function() { | ||
window.frames[0].location = "../resources/drag-drop.html"; | ||
}, 100); | ||
|
||
if (!window.layoutTestController) { | ||
log("This test uses eventSender. To run it manually, drag the selected image to another position in the editable div and drop it. Renderer should not crash."); | ||
return; | ||
} | ||
|
||
var max_tries = 50; | ||
for (i = 0; i < max_tries; i++) { | ||
eventSender.mouseMoveTo(xdrag, ydrag); | ||
eventSender.mouseDown(); | ||
eventSender.mouseMoveTo(xdrop, ydrop); | ||
eventSender.mouseUp(); | ||
} | ||
|
||
clearInterval(timer); | ||
|
||
document.write("<p>Bug 37618: Crash when an image drag-drop operation happens inside a continuously refreshing iframe.</p>"); | ||
document.write("<p>SUCCESS</p>"); | ||
|
||
layoutTestController.notifyDone(); | ||
} | ||
</script> | ||
</head> | ||
<body onload="runTest()"> | ||
<iframe src="../resources/drag-drop.html"></iframe> | ||
<ul id="console"></ul> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<div contenteditable> | ||
drag<img src='../resources/abe.png' id=dragme>me | ||
<span id=target> </span> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters