Fix <rdar://4968855> Shift-PageUp/Shift-PageDown only select one line of text
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jan 2008 19:31:37 +0000 (19:31 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jan 2008 19:31:37 +0000 (19:31 +0000)
WebKit/win:

        Fix <rdar://4968855> Shift-PageUp/Shift-PageDown only select one line of text

        Test: platform/win/editing/selection/shift-page-down-up.html

        Reviewed by Oliver.

        * WebView.cpp: Correct the commands associated with
        Shift-PageUp/Shift-PageDown.

LayoutTests:

        Added a test for <rdar://4968855> Shift-PageUp/Shift-PageDown only select one line of text

        Reviewed by Oliver.

        * platform/win/editing/selection/shift-page-up-down-expected.txt: Added.
        * platform/win/editing/selection/shift-page-up-down.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/platform/win/editing/selection/shift-page-up-down-expected.txt [new file with mode: 0644]
LayoutTests/platform/win/editing/selection/shift-page-up-down.html [new file with mode: 0644]
WebKit/win/ChangeLog
WebKit/win/WebView.cpp

index f2d14be..0f4bc1c 100644 (file)
@@ -1,3 +1,12 @@
+2008-01-04  Adam Roben  <aroben@apple.com>
+
+        Added a test for <rdar://4968855> Shift-PageUp/Shift-PageDown only select one line of text
+
+        Reviewed by Oliver.
+
+        * platform/win/editing/selection/shift-page-up-down-expected.txt: Added.
+        * platform/win/editing/selection/shift-page-up-down.html: Added.
+
 2008-01-04  Oliver Hunt  <oliver@apple.com>
 
         Reviewed by Darin.
diff --git a/LayoutTests/platform/win/editing/selection/shift-page-up-down-expected.txt b/LayoutTests/platform/win/editing/selection/shift-page-up-down-expected.txt
new file mode 100644 (file)
index 0000000..4bc4194
--- /dev/null
@@ -0,0 +1,38 @@
+Test for <rdar://4968855> Shift-PageUp/Shift-PageDown only select one line of text. To test, press Shift-PageDown and Shift-PageUp to see if more than one line of text is selected.
+
+
+Pressing Shift-PageDown with the caret at the top of the textarea
+Selected text:
+this is some text
+that spans multiple lines
+
+
+
+
+
+
+
+
+
+
+
+and goes on for quite a while
+
+Pressing Shift-PageUp with the caret at the bottom of the textarea
+Selected text:
+this is some text
+that spans multiple lines
+
+
+
+
+
+
+
+
+
+
+
+and goes on for quite a while
+
+
diff --git a/LayoutTests/platform/win/editing/selection/shift-page-up-down.html b/LayoutTests/platform/win/editing/selection/shift-page-up-down.html
new file mode 100644 (file)
index 0000000..a9642ec
--- /dev/null
@@ -0,0 +1,56 @@
+<p>Test for <a href="rdar://4968855">&lt;rdar://4968855>
+Shift-PageUp/Shift-PageDown only select one line of text</a>. To test, press
+Shift-PageDown and Shift-PageUp to see if more than one line of text is
+selected.</p>
+
+<textarea id="a" rows=30>this is some text
+that spans multiple lines
+
+
+
+
+
+
+
+
+
+
+
+and goes on for quite a while
+</textarea>
+<pre id="log"></pre>
+<script>
+function log(msg) {
+    document.getElementById('log').appendChild(document.createTextNode(msg + "\n"));
+}
+
+function logSelection() {
+    log('Selected text:\n' + window.getSelection());
+}
+
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+if (window.eventSender) {
+    var area = document.getElementById('a');
+
+    eventSender.mouseMoveTo(area.offsetLeft + 3, area.offsetTop + 3);
+    eventSender.mouseDown();
+    eventSender.mouseUp();
+
+    log("Pressing Shift-PageDown with the caret at the top of the textarea");
+    eventSender.keyDown("pageDown", ["shiftKey"]);
+
+    logSelection();
+
+    eventSender.leapForward(3000);
+    eventSender.mouseMoveTo(area.offsetLeft + 3, area.offsetTop + area.offsetHeight - 3);
+    eventSender.mouseDown();
+    eventSender.mouseUp();
+
+    log("Pressing Shift-PageUp with the caret at the bottom of the textarea");
+    eventSender.keyDown("pageUp", ["shiftKey"]);
+
+    logSelection();
+}
+</script>
index 36ba021..cb02654 100644 (file)
@@ -1,3 +1,14 @@
+2008-01-04  Adam Roben  <aroben@apple.com>
+
+        Fix <rdar://4968855> Shift-PageUp/Shift-PageDown only select one line of text
+
+        Test: platform/win/editing/selection/shift-page-down-up.html
+
+        Reviewed by Oliver.
+
+        * WebView.cpp: Correct the commands associated with
+        Shift-PageUp/Shift-PageDown.
+
 2008-01-03  Alexey Proskuryakov  <ap@webkit.org>
 
         Reviewed by Darin.
index 2b522e5..650795d 100644 (file)
@@ -1294,10 +1294,10 @@ static const KeyDownEntry keyDownEntries[] = {
     { VK_RIGHT,  CtrlKey | ShiftKey, "MoveWordRightAndModifySelection"             },
     { VK_UP,     0,                  "MoveUp"                                      },
     { VK_UP,     ShiftKey,           "MoveUpAndModifySelection"                    },
-    { VK_PRIOR,  ShiftKey,           "MoveUpAndModifySelection"                    },
+    { VK_PRIOR,  ShiftKey,           "MovePageUpAndModifySelection"                },
     { VK_DOWN,   0,                  "MoveDown"                                    },
     { VK_DOWN,   ShiftKey,           "MoveDownAndModifySelection"                  },
-    { VK_NEXT,   ShiftKey,           "MoveDownAndModifySelection"                  },
+    { VK_NEXT,   ShiftKey,           "MovePageDownAndModifySelection"              },
     { VK_PRIOR,  0,                  "MovePageUp"                                  },
     { VK_NEXT,   0,                  "MovePageDown"                                },
     { VK_HOME,   0,                  "MoveToBeginningOfLine"                       },