2010-12-17 Eric Seidel <eric@webkit.org>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Dec 2010 08:23:56 +0000 (08:23 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Dec 2010 08:23:56 +0000 (08:23 +0000)
        Unreviewed, rolling out r74229.
        http://trac.webkit.org/changeset/74229
        https://bugs.webkit.org/show_bug.cgi?id=50536

        Broken on Snow Leopard and possibly other platforms

        * platform/gtk/editing/selection/caret-mode-paragraph-keys-navigation-expected.txt: Renamed from LayoutTests/editing/selection/caret-mode-paragraph-keys-navigation-expected.txt.
        * platform/gtk/editing/selection/caret-mode-paragraph-keys-navigation.html: Renamed from LayoutTests/editing/selection/caret-mode-paragraph-keys-navigation.html.
        * platform/mac/Skipped:
        * platform/win/Skipped:
2010-12-17  Eric Seidel  <eric@webkit.org>

        Unreviewed, rolling out r74229.
        http://trac.webkit.org/changeset/74229
        https://bugs.webkit.org/show_bug.cgi?id=50536

        Broken on Snow Leopard and possibly other platforms

        * WebCoreSupport/EditorClientQt.cpp:
        (WebCore::EditorClientQt::handleKeyboardEvent):

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

LayoutTests/ChangeLog
LayoutTests/platform/gtk/editing/selection/caret-mode-paragraph-keys-navigation-expected.txt [moved from LayoutTests/editing/selection/caret-mode-paragraph-keys-navigation-expected.txt with 59% similarity]
LayoutTests/platform/gtk/editing/selection/caret-mode-paragraph-keys-navigation.html [moved from LayoutTests/editing/selection/caret-mode-paragraph-keys-navigation.html with 69% similarity]
LayoutTests/platform/mac/Skipped
LayoutTests/platform/win/Skipped
WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/EditorClientQt.cpp

index 60bc1cf..a50943d 100644 (file)
@@ -1,3 +1,16 @@
+2010-12-17  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, rolling out r74229.
+        http://trac.webkit.org/changeset/74229
+        https://bugs.webkit.org/show_bug.cgi?id=50536
+
+        Broken on Snow Leopard and possibly other platforms
+
+        * platform/gtk/editing/selection/caret-mode-paragraph-keys-navigation-expected.txt: Renamed from LayoutTests/editing/selection/caret-mode-paragraph-keys-navigation-expected.txt.
+        * platform/gtk/editing/selection/caret-mode-paragraph-keys-navigation.html: Renamed from LayoutTests/editing/selection/caret-mode-paragraph-keys-navigation.html.
+        * platform/mac/Skipped:
+        * platform/win/Skipped:
+
 2010-12-15  Andrey Kosyakov  <caseq@chromium.org>
 
         Reviewed by Pavel Feldman.
@@ -1,4 +1,4 @@
-This tests that arrow keys navigate through a paragraph as expected when in caret browsing mode, also with shift and ctrl modifiers.
+This tests that keys navigation through a paragraph work as expected when in caret mode, also with shift and ctrl modifiers.
 
 This tests that keys navigation through a paragraph work as expected when in caret mode, also with shift and ctrl modifiers.
 
@@ -12,11 +12,17 @@ PASS getSelection().baseOffset is 15
 PASS getSelection().extentOffset is 18
 PASS getSelection().baseOffset is 15
 PASS getSelection().extentOffset is 17
-PASS getSelection().baseOffset is 21
+PASS getSelection().baseOffset is 20
 PASS getSelection().baseOffset is 16
 PASS getSelection().baseOffset is 16
-PASS getSelection().extentOffset is 26
-PASS getSelection().baseOffset is 22
+PASS getSelection().extentOffset is 31
+PASS getSelection().baseOffset is 21
+PASS getSelection().baseOffset is 0
+PASS getSelection().extentOffset is 0
+PASS getSelection().baseOffset is 124
+PASS getSelection().extentOffset is 124
+PASS getSelection().baseOffset is 124
+PASS getSelection().extentOffset is 0
 PASS successfullyParsed is true
 
 TEST COMPLETE
@@ -5,10 +5,10 @@
 <script>
 var successfullyParsed = false;
 </script>
-<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../../../fast/js/resources/js-test-pre.js"></script>
 </head>
 <body>
-<p id="target">This tests that arrow keys navigate through a paragraph as expected when in caret browsing mode, also with shift and ctrl modifiers.</p>
+<p id="target">This tests that keys navigation through a paragraph work as expected when in caret mode, also with shift and ctrl modifiers.</p>
 <p id="description"></p>
 <div id="console"></div>
 <script>
@@ -41,7 +41,7 @@ if (window.layoutTestController) {
 
   // check left/right arrows + Ctrl
   eventSender.keyDown("rightArrow", ["ctrlKey"]);
-  shouldBe("getSelection().baseOffset", "21");
+  shouldBe("getSelection().baseOffset", "20");
   eventSender.keyDown("leftArrow", ["ctrlKey"]);
   shouldBe("getSelection().baseOffset", "16");
 
@@ -49,13 +49,24 @@ if (window.layoutTestController) {
   eventSender.keyDown("rightArrow", ["ctrlKey", "shiftKey"]);
   eventSender.keyDown("rightArrow", ["ctrlKey", "shiftKey"]);
   shouldBe("getSelection().baseOffset", "16");
-  shouldBe("getSelection().extentOffset", "26");
+  shouldBe("getSelection().extentOffset", "31");
   eventSender.keyDown("leftArrow", ["ctrlKey"]);
-  shouldBe("getSelection().baseOffset", "22");
+  shouldBe("getSelection().baseOffset", "21");
+
+  // check home/end keys both for caret and range selections
+  eventSender.keyDown("home");
+  shouldBe("getSelection().baseOffset", "0");
+  shouldBe("getSelection().extentOffset", "0");
+  eventSender.keyDown("end");
+  shouldBe("getSelection().baseOffset", "124");
+  shouldBe("getSelection().extentOffset", "124");
+  eventSender.keyDown("home", ["shiftKey"]);
+  shouldBe("getSelection().baseOffset", "124");
+  shouldBe("getSelection().extentOffset", "0");
 }
 
 successfullyParsed = true;
 </script>
-<script src="../../fast/js/resources/js-test-post.js"></script>
+<script src="../../../../fast/js/resources/js-test-post.js"></script>
 </body>
 </html>
index f656d8b..f8c6d37 100644 (file)
@@ -277,6 +277,3 @@ plugins/evaluate-js-after-removing-plugin-element.html
 
 # Very flaky: https://bugs.webkit.org/show_bug.cgi?id=49182
 animations/stop-animation-on-suspend.html
-
-# DRT does not support toggling caret browsing on / off
-LayoutTests/editing/selection/caret-mode-paragraph-keys-navigation.html
index 495d934..876092a 100644 (file)
@@ -1102,5 +1102,3 @@ http/tests/local/link-stylesheet-load-order-preload.html
 # https://bugs.webkit.org/show_bug.cgi?id=50994
 fast/loader/user-stylesheet-fast-path.html
 
-# DRT does not support toggling caret browsing on / off
-LayoutTests/editing/selection/caret-mode-paragraph-keys-navigation.html
index d7bbf6f..879456e 100644 (file)
@@ -1,3 +1,14 @@
+2010-12-17  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, rolling out r74229.
+        http://trac.webkit.org/changeset/74229
+        https://bugs.webkit.org/show_bug.cgi?id=50536
+
+        Broken on Snow Leopard and possibly other platforms
+
+        * WebCoreSupport/EditorClientQt.cpp:
+        (WebCore::EditorClientQt::handleKeyboardEvent):
+
 2010-12-05  Antonio Gomes  <agomes@rim.com>
 
         Reviewed by Ariya Hidayat.
index 3fbc83d..0fb21c3 100644 (file)
@@ -349,7 +349,7 @@ void EditorClientQt::toggleGrammarChecking()
 void EditorClientQt::handleKeyboardEvent(KeyboardEvent* event)
 {
     Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame();
-    if (!frame)
+    if (!frame || !frame->document()->focusedNode())
         return;
 
     const PlatformKeyboardEvent* kevent = event->keyEvent();
@@ -374,7 +374,6 @@ void EditorClientQt::handleKeyboardEvent(KeyboardEvent* event)
                 }
             }
         }
-
 #ifndef QT_NO_SHORTCUT
         QWebPage::WebAction action = QWebPagePrivate::editorActionForKeyEvent(kevent->qtEvent());
         if (action != QWebPage::NoWebAction && !doSpatialNavigation) {
@@ -467,62 +466,6 @@ void EditorClientQt::handleKeyboardEvent(KeyboardEvent* event)
                 return;
         }
     } else {
-        if (m_page->handle()->page->settings()->caretBrowsingEnabled()) {
-            switch (kevent->windowsVirtualKeyCode()) {
-            case VK_LEFT:
-                if (kevent->shiftKey() && kevent->ctrlKey())
-                    frame->editor()->command("MoveWordBackwardAndModifySelection").execute();
-                else if (kevent->shiftKey())
-                    frame->editor()->command("MoveLeftAndModifySelection").execute();
-                else if (kevent->ctrlKey())
-                    frame->editor()->command("MoveWordBackward").execute();
-                else
-                    frame->editor()->command("MoveLeft").execute();
-                break;
-            case VK_RIGHT:
-                if (kevent->shiftKey() && kevent->ctrlKey())
-                    frame->editor()->command("MoveWordForwardAndModifySelection").execute();
-                else if (kevent->shiftKey())
-                    frame->editor()->command("MoveRightAndModifySelection").execute();
-                else if (kevent->ctrlKey())
-                    frame->editor()->command("MoveWordForward").execute();
-                else
-                    frame->editor()->command("MoveRight").execute();
-                break;
-            case VK_UP:
-                if (kevent->shiftKey())
-                    frame->editor()->command("MoveUpAndModifySelection").execute();
-                else
-                    frame->editor()->command("MoveUp").execute();
-                break;
-            case VK_DOWN:
-                if (kevent->shiftKey())
-                    frame->editor()->command("MoveDownAndModifySelection").execute();
-                else
-                    frame->editor()->command("MoveDown").execute();
-                break;
-            case VK_PRIOR: // PageUp
-                frame->editor()->command("MovePageUp").execute();
-                break;
-            case VK_NEXT: // PageDown
-                frame->editor()->command("MovePageDown").execute();
-                break;
-            case VK_HOME:
-                if (kevent->shiftKey())
-                    frame->editor()->command("MoveToBeginningOfLineAndModifySelection").execute();
-                else
-                    frame->editor()->command("MoveToBeginningOfLine").execute();
-                break;
-            case VK_END:
-                if (kevent->shiftKey())
-                    frame->editor()->command("MoveToEndOfLineAndModifySelection").execute();
-                else
-                    frame->editor()->command("MoveToEndOfLine").execute();
-                break;
-            default:
-                break;
-            }
-        }
 #ifndef QT_NO_SHORTCUT
         if (kevent->qtEvent() == QKeySequence::Copy)
             m_page->triggerAction(QWebPage::Copy);