Commit 01dd65f4 authored by oliver's avatar oliver

2007-03-14 Oliver Hunt <oliver@apple.com>

        Reviewed by Adele.

        Fix for rdar://problem/5061737.
        
        This was a regression from the original Objective-C -> C++ conversion
        for the drag logic.  We don't need to call Range::startNode as we just
        need the document that contains the range.   

        * page/DragController.cpp:
        (WebCore::documentFragmentFromDragData):
LayoutTests:
        Layout tests for rdar://problem/5061737

        * editing/pasteboard/drag-image-to-contenteditable-in-iframe-expected.txt: Added.
        * editing/pasteboard/drag-image-to-contenteditable-in-iframe.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20209 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7e2db9e7
2007-03-14 Oliver Hunt <oliver@apple.com>
Reviewed by Adele.
Layout tests for rdar://problem/5061737
* editing/pasteboard/drag-image-to-contenteditable-in-iframe-expected.txt: Added.
* editing/pasteboard/drag-image-to-contenteditable-in-iframe.html: Added.
2007-03-14 Kevin McCullough <kmccullough@apple.com>
Reviewed by Geoff.
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x576
RenderBlock {P} at (0,0) size 784x36
RenderText {#text} at (0,0) size 744x36
text run at (0,0) width 744: "This tests that we can drag an image into the last position of a content editable div in an iframe that already contains an"
text run at (0,18) width 155: "image, without crashing."
RenderBlock (anonymous) at (0,52) size 784x154
RenderImage {IMG} at (0,47) size 76x103
RenderText {#text} at (76,136) size 4x18
text run at (76,136) width 4: " "
RenderPartObject {IFRAME} at (80,0) size 300x150
layer at (0,0) size 300x150
RenderView at (0,0) size 300x150
layer at (0,0) size 300x150
RenderBlock {HTML} at (0,0) size 300x150
RenderBody {BODY} at (8,8) size 284x134
RenderBlock {DIV} at (0,0) size 271x129 [border: (1px solid #000000)]
RenderImage {IMG} at (1,84) size 20x20
RenderImage {IMG} at (21,1) size 76x103
RenderText {#text} at (0,0) size 0x0
RenderBlock {UL} at (0,222) size 784x0
selection start: position 0 of child 3 {IMG} of child 1 {BODY} of child 0 {HTML} of document
selection end: position 1 of child 3 {IMG} of child 1 {BODY} of child 0 {HTML} of document
<html>
<head>
<script>
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() {
if (!window.layoutTestController) {
log("To run this test manually attempt to drag and drop Abe after the broken image in the editable div");
return;
}
layoutTestController.waitUntilDone();
//find abe
var dragme = document.getElementById("dragme");
x1 = dragme.offsetLeft + 20;
y1 = dragme.offsetTop + 20;
// Find the target
var drag_target = document.getElementById("drag_target");
x2 = drag_target.offsetLeft + drag_target.offsetWidth / 2;
y2 = drag_target.offsetTop + drag_target.offsetHeight / 2;
// Drag abe into the editable
eventSender.mouseMoveTo(x1, y1);
eventSender.mouseDown();
eventSender.leapForward(500);
eventSender.mouseMoveTo(x2, y2);
eventSender.mouseUp();
layoutTestController.notifyDone();
}
</script>
<title>Dragging an image to the end of a content editable div in an iframe</title>
</head>
<body>
<p>This tests that we can drag an image into the last position of a content editable div in an iframe that already contains an image, without crashing.</p>
<img id="dragme" src="../resources/abe.jpg"/>
<iframe id="drag_target" onload="runTest();" src='data:text/html,<div contenteditable="true" style="height: 95%; width: 95%; border: solid 1px black;"><img id="dragme" src="broken_image"/></div>'>
</iframe>
<ul id="console"></ul>
</body>
</html>
2007-03-14 Oliver Hunt <oliver@apple.com>
Reviewed by Adele.
Fix for rdar://problem/5061737.
This was a regression from the original Objective-C -> C++ conversion
for the drag logic. We don't need to call Range::startNode as we just
need the document that contains the range.
* page/DragController.cpp:
(WebCore::documentFragmentFromDragData):
2007-03-14 Mitz Pettel <mitz@webkit.org>
Reviewed by Hyatt.
......
......@@ -92,7 +92,7 @@ static PassRefPtr<DocumentFragment> documentFragmentFromDragData(DragData* dragD
ASSERT(dragData);
chosePlainText = false;
Document* document = context->startNode()->document();
Document* document = context->ownerDocument();
ASSERT(document);
if (document && dragData->containsCompatibleContent()) {
if (PassRefPtr<DocumentFragment> fragment = dragData->asFragment(document))
......
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