2010-11-30 Avi Drissman <avi@google.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Dec 2010 05:37:32 +0000 (05:37 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Dec 2010 05:37:32 +0000 (05:37 +0000)
        Reviewed by Darin Adler.

        Add preference to not select when right-clicked
        https://bugs.webkit.org/show_bug.cgi?id=23351

        Removed 5109817 because it is entirely superseded by
        context-menu-text-selection; updated 5354455-1 to explicitly set the
        editing behavior and test all three platforms.

        * editing/selection/5109817.html: Removed.
        * editing/selection/5354455-1-expected.txt: Added.
        * editing/selection/5354455-1.html:
        * platform/chromium-win/editing/selection/5109817-expected.txt: Removed.
        * platform/chromium-win/editing/selection/5354455-1-expected.txt: Removed.
        * platform/gtk/editing/selection/5109817-expected.txt: Removed.
        * platform/gtk/editing/selection/5354455-1-expected.txt: Removed.
        * platform/mac-leopard/editing/selection/5109817-expected.checksum: Removed.
        * platform/mac-leopard/editing/selection/5109817-expected.png: Removed.
        * platform/mac/editing/selection/5109817-expected.checksum: Removed.
        * platform/mac/editing/selection/5109817-expected.png: Removed.
        * platform/mac/editing/selection/5109817-expected.txt: Removed.
        * platform/mac/editing/selection/5354455-1-expected.txt: Removed.
        * platform/win/editing/selection/5109817-expected.checksum: Removed.
        * platform/win/editing/selection/5109817-expected.png: Removed.
        * platform/win/editing/selection/5109817-expected.txt: Removed.
        * platform/win/editing/selection/5354455-1-expected.txt: Removed.

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

18 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/selection/5109817.html [deleted file]
LayoutTests/editing/selection/5354455-1-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/5354455-1.html
LayoutTests/platform/chromium-win/editing/selection/5109817-expected.txt [deleted file]
LayoutTests/platform/chromium-win/editing/selection/5354455-1-expected.txt [deleted file]
LayoutTests/platform/gtk/editing/selection/5109817-expected.txt [deleted file]
LayoutTests/platform/gtk/editing/selection/5354455-1-expected.txt [deleted file]
LayoutTests/platform/mac-leopard/editing/selection/5109817-expected.checksum [deleted file]
LayoutTests/platform/mac-leopard/editing/selection/5109817-expected.png [deleted file]
LayoutTests/platform/mac/editing/selection/5109817-expected.checksum [deleted file]
LayoutTests/platform/mac/editing/selection/5109817-expected.png [deleted file]
LayoutTests/platform/mac/editing/selection/5109817-expected.txt [deleted file]
LayoutTests/platform/mac/editing/selection/5354455-1-expected.txt [deleted file]
LayoutTests/platform/win/editing/selection/5109817-expected.checksum [deleted file]
LayoutTests/platform/win/editing/selection/5109817-expected.png [deleted file]
LayoutTests/platform/win/editing/selection/5109817-expected.txt [deleted file]
LayoutTests/platform/win/editing/selection/5354455-1-expected.txt [deleted file]

index 15155e6..aea737e 100644 (file)
@@ -1,3 +1,32 @@
+2010-11-30  Avi Drissman  <avi@google.com>
+
+        Reviewed by Darin Adler.
+
+        Add preference to not select when right-clicked
+        https://bugs.webkit.org/show_bug.cgi?id=23351
+
+        Removed 5109817 because it is entirely superseded by
+        context-menu-text-selection; updated 5354455-1 to explicitly set the
+        editing behavior and test all three platforms.
+        
+        * editing/selection/5109817.html: Removed.
+        * editing/selection/5354455-1-expected.txt: Added.
+        * editing/selection/5354455-1.html:
+        * platform/chromium-win/editing/selection/5109817-expected.txt: Removed.
+        * platform/chromium-win/editing/selection/5354455-1-expected.txt: Removed.
+        * platform/gtk/editing/selection/5109817-expected.txt: Removed.
+        * platform/gtk/editing/selection/5354455-1-expected.txt: Removed.
+        * platform/mac-leopard/editing/selection/5109817-expected.checksum: Removed.
+        * platform/mac-leopard/editing/selection/5109817-expected.png: Removed.
+        * platform/mac/editing/selection/5109817-expected.checksum: Removed.
+        * platform/mac/editing/selection/5109817-expected.png: Removed.
+        * platform/mac/editing/selection/5109817-expected.txt: Removed.
+        * platform/mac/editing/selection/5354455-1-expected.txt: Removed.
+        * platform/win/editing/selection/5109817-expected.checksum: Removed.
+        * platform/win/editing/selection/5109817-expected.png: Removed.
+        * platform/win/editing/selection/5109817-expected.txt: Removed.
+        * platform/win/editing/selection/5354455-1-expected.txt: Removed.
+
 2010-11-30  Rob Buis  <rwlbuis@gmail.com>
 
         Reviewed by Xan Lopez.
diff --git a/LayoutTests/editing/selection/5109817.html b/LayoutTests/editing/selection/5109817.html
deleted file mode 100644 (file)
index aaa3602..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<p>This tests to make sure that right clicking selects the word under the mouse.</p>
-<div>The <span id="word">second</span> word in this sentence should be selected.</div>
-
-<script>
-if (window.layoutTestController) {
-    var word, x, y;
-    word = document.getElementById("word");
-    x = word.offsetParent.offsetLeft + word.offsetLeft + word.offsetWidth / 2;
-    y = word.offsetParent.offsetTop + word.offsetTop + word.offsetHeight / 2;
-    eventSender.mouseMoveTo(x, y);
-    eventSender.contextClick();   
-}
-</script>
diff --git a/LayoutTests/editing/selection/5354455-1-expected.txt b/LayoutTests/editing/selection/5354455-1-expected.txt
new file mode 100644 (file)
index 0000000..aeca6ab
--- /dev/null
@@ -0,0 +1,9 @@
+This tests whether right clicking on a paragraph break in editable content selects it. The break should be selected on OS X, but not on Windows or Unix. To run it manually, right click on the paragraph break after the first paragraph below.
+
+The following paragraph break should be selected on OS X.
+
+Mac: Range
+
+Win: Caret
+
+Unix: Caret
index f58b536..24390da 100644 (file)
@@ -1,15 +1,17 @@
-<script src="../../resources/dump-as-markup.js"></script>
-
-<p>This tests whether right clicking on a paragraph break in editable content selects it.  The break should be selected on OS X, but not on Windows or Linux.  To run it manually, right click on the paragraph break after the first paragraph below.</p>
-<div id="dump">
+<p>This tests whether right clicking on a paragraph break in editable content selects it.  The break should be selected on OS X, but not on Windows or Unix.  To run it manually, right click on the paragraph break after the first paragraph below.</p>
 <div id="div" contenteditable="true">
 <div><span id="text">The following paragraph break should be selected on OS X.</span></div>
 <br>
 </div>
-</div>
+<p>Mac: <span id="resultmac">RUNNING</span></p>
+<p>Win: <span id="resultwin">RUNNING</span></p>
+<p>Unix: <span id="resultunix">RUNNING</span></p>
 
 <script>
-if (window.layoutTestController) {
+function test(platform, result) {
+    window.getSelection().removeAllRanges();
+    layoutTestController.setEditingBehavior(platform);
+    
     paragraph = document.getElementById("text");
     x = paragraph.offsetParent.offsetLeft + paragraph.offsetLeft + paragraph.offsetWidth + 10;
     y = paragraph.offsetParent.offsetTop + paragraph.offsetTop + paragraph.offsetHeight / 2;
@@ -19,7 +21,18 @@ if (window.layoutTestController) {
     eventSender.mouseUp();
     // Right click on the paragraph break to select it.
     eventSender.contextClick();
+    // esc key to kill the context menu.
+    eventSender.keyDown(String.fromCharCode(0x001B), null);
+    
+    document.getElementById(result).innerHTML = window.getSelection().type;
+}
+
+if (window.eventSender && window.layoutTestController) {
+    layoutTestController.dumpAsText();
+
+    test('mac', 'resultmac');
+    test('win', 'resultwin');
+    test('unix', 'resultunix');
 }
-Markup.dump(document.getElementById("dump"));
 </script>
 
diff --git a/LayoutTests/platform/chromium-win/editing/selection/5109817-expected.txt b/LayoutTests/platform/chromium-win/editing/selection/5109817-expected.txt
deleted file mode 100644 (file)
index 0d23c5b..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-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
-      RenderBlock {P} at (0,0) size 784x20
-        RenderText {#text} at (0,0) size 452x19
-          text run at (0,0) width 452: "This tests to make sure that right clicking selects the word under the mouse."
-      RenderBlock {DIV} at (0,36) size 784x20
-        RenderText {#text} at (0,0) size 27x19
-          text run at (0,0) width 27: "The "
-        RenderInline {SPAN} at (0,0) size 43x19
-          RenderText {#text} at (27,0) size 43x19
-            text run at (27,0) width 43: "second"
-        RenderText {#text} at (70,0) size 249x19
-          text run at (70,0) width 249: " word in this sentence should be selected."
-caret: position 3 of child 0 {#text} of child 1 {SPAN} of child 2 {DIV} of body
diff --git a/LayoutTests/platform/chromium-win/editing/selection/5354455-1-expected.txt b/LayoutTests/platform/chromium-win/editing/selection/5354455-1-expected.txt
deleted file mode 100644 (file)
index d810816..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-| "
-"
-| <div>
-|   contenteditable="true"
-|   id="div"
-|   "
-"
-|   <div>
-|     <span>
-|       id="text"
-|       "The following paragraph break should be selected on OS X.<#selection-caret>"
-|   "
-"
-|   <br>
-|   "
-"
-| "
-"
diff --git a/LayoutTests/platform/gtk/editing/selection/5109817-expected.txt b/LayoutTests/platform/gtk/editing/selection/5109817-expected.txt
deleted file mode 100644 (file)
index d5d58eb..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-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
-      RenderBlock {P} at (0,0) size 784x19
-        RenderText {#text} at (0,0) size 474x19
-          text run at (0,0) width 474: "This tests to make sure that right clicking selects the word under the mouse."
-      RenderBlock {DIV} at (0,35) size 784x19
-        RenderText {#text} at (0,0) size 29x19
-          text run at (0,0) width 29: "The "
-        RenderInline {SPAN} at (0,0) size 44x19
-          RenderText {#text} at (29,0) size 44x19
-            text run at (29,0) width 44: "second"
-        RenderText {#text} at (73,0) size 260x19
-          text run at (73,0) width 260: " word in this sentence should be selected."
-selection start: position 0 of child 0 {#text} of child 1 {SPAN} of child 2 {DIV} of body
-selection end:   position 6 of child 0 {#text} of child 1 {SPAN} of child 2 {DIV} of body
diff --git a/LayoutTests/platform/gtk/editing/selection/5354455-1-expected.txt b/LayoutTests/platform/gtk/editing/selection/5354455-1-expected.txt
deleted file mode 100644 (file)
index d810816..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-| "
-"
-| <div>
-|   contenteditable="true"
-|   id="div"
-|   "
-"
-|   <div>
-|     <span>
-|       id="text"
-|       "The following paragraph break should be selected on OS X.<#selection-caret>"
-|   "
-"
-|   <br>
-|   "
-"
-| "
-"
diff --git a/LayoutTests/platform/mac-leopard/editing/selection/5109817-expected.checksum b/LayoutTests/platform/mac-leopard/editing/selection/5109817-expected.checksum
deleted file mode 100644 (file)
index 6b30f45..0000000
+++ /dev/null
@@ -1 +0,0 @@
-7c4756fa84c4e9ccc25b40785885993d
\ No newline at end of file
diff --git a/LayoutTests/platform/mac-leopard/editing/selection/5109817-expected.png b/LayoutTests/platform/mac-leopard/editing/selection/5109817-expected.png
deleted file mode 100644 (file)
index 1818efe..0000000
Binary files a/LayoutTests/platform/mac-leopard/editing/selection/5109817-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/mac/editing/selection/5109817-expected.checksum b/LayoutTests/platform/mac/editing/selection/5109817-expected.checksum
deleted file mode 100644 (file)
index a0a9d0b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-d8ce7d0117764fc32571df7ca2b27a1e
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/editing/selection/5109817-expected.png b/LayoutTests/platform/mac/editing/selection/5109817-expected.png
deleted file mode 100644 (file)
index a7b18e5..0000000
Binary files a/LayoutTests/platform/mac/editing/selection/5109817-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/mac/editing/selection/5109817-expected.txt b/LayoutTests/platform/mac/editing/selection/5109817-expected.txt
deleted file mode 100644 (file)
index 888bf20..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-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
-      RenderBlock {P} at (0,0) size 784x18
-        RenderText {#text} at (0,0) size 474x18
-          text run at (0,0) width 474: "This tests to make sure that right clicking selects the word under the mouse."
-      RenderBlock {DIV} at (0,34) size 784x18
-        RenderText {#text} at (0,0) size 29x18
-          text run at (0,0) width 29: "The "
-        RenderInline {SPAN} at (0,0) size 44x18
-          RenderText {#text} at (29,0) size 44x18
-            text run at (29,0) width 44: "second"
-        RenderText {#text} at (73,0) size 260x18
-          text run at (73,0) width 260: " word in this sentence should be selected."
-selection start: position 0 of child 0 {#text} of child 1 {SPAN} of child 2 {DIV} of body
-selection end:   position 6 of child 0 {#text} of child 1 {SPAN} of child 2 {DIV} of body
diff --git a/LayoutTests/platform/mac/editing/selection/5354455-1-expected.txt b/LayoutTests/platform/mac/editing/selection/5354455-1-expected.txt
deleted file mode 100644 (file)
index 8062910..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-| "
-"
-| <div>
-|   contenteditable="true"
-|   id="div"
-|   "
-"
-|   <div>
-|     <span>
-|       id="text"
-|       "The following paragraph break should be selected on OS X.<#selection-anchor>"
-|   "
-"
-|   <#selection-focus>
-|   <br>
-|   "
-"
-| "
-"
diff --git a/LayoutTests/platform/win/editing/selection/5109817-expected.checksum b/LayoutTests/platform/win/editing/selection/5109817-expected.checksum
deleted file mode 100644 (file)
index 95763cc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-acfb1beb31fda315da5b4126c5fad02a
\ No newline at end of file
diff --git a/LayoutTests/platform/win/editing/selection/5109817-expected.png b/LayoutTests/platform/win/editing/selection/5109817-expected.png
deleted file mode 100644 (file)
index 13bd315..0000000
Binary files a/LayoutTests/platform/win/editing/selection/5109817-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/win/editing/selection/5109817-expected.txt b/LayoutTests/platform/win/editing/selection/5109817-expected.txt
deleted file mode 100644 (file)
index f0536b0..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-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
-      RenderBlock {P} at (0,0) size 784x18
-        RenderText {#text} at (0,0) size 474x18
-          text run at (0,0) width 474: "This tests to make sure that right clicking selects the word under the mouse."
-      RenderBlock {DIV} at (0,34) size 784x18
-        RenderText {#text} at (0,0) size 29x18
-          text run at (0,0) width 29: "The "
-        RenderInline {SPAN} at (0,0) size 44x18
-          RenderText {#text} at (29,0) size 44x18
-            text run at (29,0) width 44: "second"
-        RenderText {#text} at (73,0) size 260x18
-          text run at (73,0) width 260: " word in this sentence should be selected."
-caret: position 3 of child 0 {#text} of child 1 {SPAN} of child 2 {DIV} of body
diff --git a/LayoutTests/platform/win/editing/selection/5354455-1-expected.txt b/LayoutTests/platform/win/editing/selection/5354455-1-expected.txt
deleted file mode 100644 (file)
index d810816..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-| "
-"
-| <div>
-|   contenteditable="true"
-|   id="div"
-|   "
-"
-|   <div>
-|     <span>
-|       id="text"
-|       "The following paragraph break should be selected on OS X.<#selection-caret>"
-|   "
-"
-|   <br>
-|   "
-"
-| "
-"