-EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 3 of BODY > HTML > #document
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > BODY > HTML > #document to 1 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > BODY > HTML > #document to 1 of #text > BODY > HTML > #document toDOMRange:range from 0 of #text > BODY > HTML > #document to 4 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
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 784x584
- RenderPartObject {IFRAME} at (0,0) size 302x152 [border: (1px solid #000000)]
- 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
- RenderText {#text} at (0,0) size 92x18
- text run at (0,0) width 92: "Drag onto me!"
- RenderBR {BR} at (92,14) size 0x0
- RenderText {#text} at (0,18) size 47x18
- text run at (0,18) width 47: "Or Me!"
- RenderText {#text} at (0,0) size 0x0
- RenderText {#text} at (0,0) size 0x0
+ RenderBlock {P} at (0,0) size 784x36
+ RenderText {#text} at (0,0) size 753x36
+ text run at (0,0) width 538: "This is an automatic pixel test. To test interactively, drag selected text onto the iframe "
+ text run at (538,0) width 215: "below and verify that a drag caret "
+ text run at (0,18) width 156: "appears inside the frame."
+ RenderBlock (anonymous) at (0,52) size 784x152
+ RenderPartObject {IFRAME} at (0,0) size 302x152 [border: (1px solid #000000)]
+ 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
+ RenderInline {SPAN} at (0,0) size 37x18
+ RenderText {#text} at (0,0) size 37x18
+ text run at (0,0) width 37: "There"
+ RenderText {#text} at (37,0) size 168x18
+ text run at (37,0) width 168: " should be a caret here --> "
+ RenderBR {BR} at (205,14) size 0x0
+ RenderText {#text} at (0,18) size 42x18
+ text run at (0,18) width 42: "See it?"
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
-<script>
-if (window.layoutTestController)
- layoutTestController.dumpEditingCallbacks();
-</script>
+<html>
<body contenteditable="true">
-<iframe style="border: 1px solid black;" src="../resources/select-and-drag-iframe.html" id="subframe"></iframe>
+ <p>
+ This is an automatic pixel test. To test interactively, drag selected text onto the iframe
+ below and verify that a drag caret appears inside the frame.
+ </p>
+ <iframe onload="test()" id="subframe" style="border: 1px solid black;"
+ src="data:text/html,<body contenteditable><span id='target'>There</span> should be a caret here --> <br>See it?</body>"></iframe>
+ <script>
+ function dragAndDrop()
+ {
+ var iframe = document.getElementById("subframe");
+ var target = iframe.contentDocument.getElementById("target");
+
+ var x1 = iframe.offsetLeft + target.offsetLeft + target.offsetWidth / 2;
+ var x2 = iframe.offsetLeft + iframe.offsetWidth - 20;
+ var y = iframe.offsetTop + target.offsetTop + target.offsetHeight / 2;
+
+ window.getSelection().setBaseAndExtent(target, 0, target, 1);
+
+ eventSender.mouseMoveTo(x1, y);
+ eventSender.dragMode = false;
+ eventSender.mouseDown();
+ eventSender.leapForward(1000);
+ eventSender.mouseMoveTo(x2, y);
+
+ // Dump pixel results before we drop so we can see where the drag caret is painted.
+ layoutTestController.notifyDone();
+
+ eventSender.mouseUp();
+ }
+
+ function test()
+ {
+ if (!window.layoutTestController)
+ return;
-<script>
-
-function step2() {
- // This is a hack because when we try to get the document
- // for the subframe to get elements from it, the frame fails to load.
- eventSender.mouseMoveTo(30, 20);
- eventSender.mouseDown();
- eventSender.mouseUp();
- eventSender.mouseDown();
- eventSender.mouseUp();
-
- eventSender.leapForward(1000);
- eventSender.mouseDown();
- eventSender.leapForward(500);
- eventSender.mouseMoveTo(200, 20);
-
- // Dump pixel results before we drop so we can see where the drag caret is painted.
- window.layoutTestController.notifyDone();
-
- // Drop outside the subframe to avoid strange bugs when dropping content inside an editable frame.
- eventSender.mouseMoveTo(600, 400);
- eventSender.mouseUp();
-
- // Mouse down to avoid assertion about multiple frames selections.
- eventSender.mouseDown();
- eventSender.mouseUp();
-}
-
-function runTest() {
- if (!window.layoutTestController)
- return;
-
- window.layoutTestController.waitUntilDone();
- // Give the iframe a moment to come into being.
- window.setTimeout(step2, 100);
-}
-
-runTest();
-
-</script>
-</body>
\ No newline at end of file
+ layoutTestController.waitUntilDone();
+ setTimeout(dragAndDrop, 0);
+ }
+ </script>
+</body>
+</html>