Reviewed by darin
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Apr 2007 22:50:34 +0000 (22:50 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Apr 2007 22:50:34 +0000 (22:50 +0000)
        <http://bugs.webkit.org/show_bug.cgi?id=13268>
        Make editing/selection/drag-in-iframe.html valid and deterministic

        * editing/resources/select-and-drag-iframe.html: Removed.
        * editing/selection/drag-in-iframe-expected.checksum:
        * editing/selection/drag-in-iframe-expected.png:
        * editing/selection/drag-in-iframe-expected.txt:
        * editing/selection/drag-in-iframe.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@20691 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/editing/resources/select-and-drag-iframe.html [deleted file]
LayoutTests/editing/selection/drag-in-iframe-expected.checksum
LayoutTests/editing/selection/drag-in-iframe-expected.png
LayoutTests/editing/selection/drag-in-iframe-expected.txt
LayoutTests/editing/selection/drag-in-iframe.html

index 977cb48..b2d7cf2 100644 (file)
@@ -1,3 +1,16 @@
+2007-04-03  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by darin
+        
+        <http://bugs.webkit.org/show_bug.cgi?id=13268>
+        Make editing/selection/drag-in-iframe.html valid and deterministic
+
+        * editing/resources/select-and-drag-iframe.html: Removed.
+        * editing/selection/drag-in-iframe-expected.checksum:
+        * editing/selection/drag-in-iframe-expected.png:
+        * editing/selection/drag-in-iframe-expected.txt:
+        * editing/selection/drag-in-iframe.html:
+
 2007-04-03  Adele Peterson  <adele@apple.com>
 
         Updated results for recent change to always lighten disabled text color for black text.
diff --git a/LayoutTests/editing/resources/select-and-drag-iframe.html b/LayoutTests/editing/resources/select-and-drag-iframe.html
deleted file mode 100644 (file)
index 4ebaa43..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<body contenteditable="true" id="dragme">Drag onto me!<br>Or Me!
-
-</body>
\ No newline at end of file
index 86a9361..1855b6c 100644 (file)
@@ -1 +1 @@
-11265ae311eab430bbc9bfc493fbc8df
\ No newline at end of file
+e2c5631ad61edafb104b352de006f4a7
\ No newline at end of file
index 22fe654..c5647ed 100644 (file)
Binary files a/LayoutTests/editing/selection/drag-in-iframe-expected.png and b/LayoutTests/editing/selection/drag-in-iframe-expected.png differ
index 05701b3..8e2631b 100644 (file)
@@ -1,23 +1,29 @@
-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
index 2d386c4..05940c0 100644 (file)
@@ -1,48 +1,43 @@
-<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>