[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

tonikitoo at webkit.org tonikitoo at webkit.org
Wed Dec 22 18:44:46 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit fd0bd4e76539007966552c515f176fd5088ac17a
Author: tonikitoo at webkit.org <tonikitoo at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 17 03:36:48 2010 +0000

    2010-12-05 Antonio Gomes <agomes at rim.com>
    
            Reviewed by Ariya Hidayat.
    
            [Qt] Fix caret browsing navigation mode
            https://bugs.webkit.org/show_bug.cgi?id=50536
    
            WebKit/qt:
    
            Caret browsing can consume editing commands even when the start
            of current selection is not a editable content. r69582 missed this
            case because caret browsing feature testing is very poor today.
    
            This commit reintroduces part of the removed code in r69582 but
            guarded by a isCaretBrowsingEnabled() check. No regression found.
    
            * WebCoreSupport/EditorClientQt.cpp:
            (WebCore::EditorClientQt::handleKeyboardEvent):
    
            LayoutTests:
    
            /platform/gtk/editing/selection/caret-mode-paragraph-keys-navigation.html
            is one of the few tests actually tests the caret browsing feature.
            Patch makes the test not Gtk+ specific, and Qt now passes on it.
    
            * editing/selection/caret-mode-paragraph-keys-navigation-expected.txt: Renamed from LayoutTests/platform/gtk/editing/selection/caret-mode-paragraph-keys-navigation-expected.tx       t.
            * editing/selection/caret-mode-paragraph-keys-navigation.html: Renamed from LayoutTests/platform/gtk/editing/selection/caret-mode-paragraph-keys-navigation.html.
            * fast/events/multiline-link-arrow-navigation.html:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74229 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 94950c5..b6785b3 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-12-05  Antonio Gomes  <agomes at rim.com>
+
+        Reviewed by Ariya Hidayat.
+
+        [Qt] Fix caret browsing navigation mode
+        https://bugs.webkit.org/show_bug.cgi?id=50536
+
+        /platform/gtk/editing/selection/caret-mode-paragraph-keys-navigation.html
+        is one of the few tests actually tests the caret browsing feature.
+        Patch makes the test not Gtk+ specific, and Qt now passes on it.
+
+        * editing/selection/caret-mode-paragraph-keys-navigation-expected.txt: Renamed from LayoutTests/platform/gtk/editing/selection/caret-mode-paragraph-keys-navigation-expected.txt.
+        * editing/selection/caret-mode-paragraph-keys-navigation.html: Renamed from LayoutTests/platform/gtk/editing/selection/caret-mode-paragraph-keys-navigation.html.
+        * fast/events/multiline-link-arrow-navigation.html:
+
 2010-12-16  Yong Li  <yoli at rim.com>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/LayoutTests/editing/selection/caret-mode-paragraph-keys-navigation-expected.txt b/LayoutTests/editing/selection/caret-mode-paragraph-keys-navigation-expected.txt
new file mode 100644
index 0000000..ab37403
--- /dev/null
+++ b/LayoutTests/editing/selection/caret-mode-paragraph-keys-navigation-expected.txt
@@ -0,0 +1,23 @@
+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.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS getSelection().baseOffset is 15
+PASS getSelection().baseOffset is 16
+PASS getSelection().baseOffset is 15
+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 16
+PASS getSelection().baseOffset is 16
+PASS getSelection().extentOffset is 26
+PASS getSelection().baseOffset is 22
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/editing/selection/caret-mode-paragraph-keys-navigation.html b/LayoutTests/editing/selection/caret-mode-paragraph-keys-navigation.html
new file mode 100644
index 0000000..9b5986b
--- /dev/null
+++ b/LayoutTests/editing/selection/caret-mode-paragraph-keys-navigation.html
@@ -0,0 +1,61 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
+<script>
+var successfullyParsed = false;
+</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="description"></p>
+<div id="console"></div>
+<script>
+description("This tests that keys navigation through a paragraph work as expected when in caret mode, also with shift and ctrl modifiers.");
+
+if (window.layoutTestController) {
+  layoutTestController.overridePreference("WebKitEnableCaretBrowsing", true);
+  layoutTestController.dumpAsText();
+
+  var target = document.getElementById("target");
+  target.focus();
+  window.getSelection().setPosition(target.childNodes.item(0), 15);
+
+  // check left/right arrows
+  shouldBe("getSelection().baseOffset", "15");
+  eventSender.keyDown("rightArrow");
+  shouldBe("getSelection().baseOffset", "16");
+  eventSender.keyDown("leftArrow");
+  shouldBe("getSelection().baseOffset", "15");
+
+  // check left/right arrows + Shift
+  eventSender.keyDown("rightArrow", ["shiftKey"]);
+  eventSender.keyDown("rightArrow", ["shiftKey"]);
+  eventSender.keyDown("rightArrow", ["shiftKey"]);
+  shouldBe("getSelection().baseOffset", "15");
+  shouldBe("getSelection().extentOffset", "18");
+  eventSender.keyDown("leftArrow", ["shiftKey"]);
+  shouldBe("getSelection().baseOffset", "15");
+  shouldBe("getSelection().extentOffset", "17");
+
+  // check left/right arrows + Ctrl
+  eventSender.keyDown("rightArrow", ["ctrlKey"]);
+  shouldBe("getSelection().baseOffset", "21");
+  eventSender.keyDown("leftArrow", ["ctrlKey"]);
+  shouldBe("getSelection().baseOffset", "16");
+
+  // check left/right arrows + Ctrl + Shift
+  eventSender.keyDown("rightArrow", ["ctrlKey", "shiftKey"]);
+  eventSender.keyDown("rightArrow", ["ctrlKey", "shiftKey"]);
+  shouldBe("getSelection().baseOffset", "16");
+  shouldBe("getSelection().extentOffset", "26");
+  eventSender.keyDown("leftArrow", ["ctrlKey"]);
+  shouldBe("getSelection().baseOffset", "22");
+}
+
+successfullyParsed = true;
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/platform/gtk/editing/selection/caret-mode-paragraph-keys-navigation-expected.txt b/LayoutTests/platform/gtk/editing/selection/caret-mode-paragraph-keys-navigation-expected.txt
deleted file mode 100644
index 0f75162..0000000
--- a/LayoutTests/platform/gtk/editing/selection/caret-mode-paragraph-keys-navigation-expected.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-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.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS getSelection().baseOffset is 15
-PASS getSelection().baseOffset is 16
-PASS getSelection().baseOffset is 15
-PASS getSelection().baseOffset is 15
-PASS getSelection().extentOffset is 18
-PASS getSelection().baseOffset is 15
-PASS getSelection().extentOffset is 17
-PASS getSelection().baseOffset is 20
-PASS getSelection().baseOffset is 16
-PASS getSelection().baseOffset is 16
-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
-
diff --git a/LayoutTests/platform/gtk/editing/selection/caret-mode-paragraph-keys-navigation.html b/LayoutTests/platform/gtk/editing/selection/caret-mode-paragraph-keys-navigation.html
deleted file mode 100644
index 9f584c1..0000000
--- a/LayoutTests/platform/gtk/editing/selection/caret-mode-paragraph-keys-navigation.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
-<script>
-var successfullyParsed = false;
-</script>
-<script src="../../../../fast/js/resources/js-test-pre.js"></script>
-</head>
-<body>
-<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>
-description("This tests that keys navigation through a paragraph work as expected when in caret mode, also with shift and ctrl modifiers.");
-
-if (window.layoutTestController) {
-  layoutTestController.overridePreference("WebKitEnableCaretBrowsing", true);
-  layoutTestController.dumpAsText();
-
-  var target = document.getElementById("target");
-  target.focus();
-  window.getSelection().setPosition(target.childNodes.item(0), 15);
-
-  // check left/right arrows
-  shouldBe("getSelection().baseOffset", "15");
-  eventSender.keyDown("rightArrow");
-  shouldBe("getSelection().baseOffset", "16");
-  eventSender.keyDown("leftArrow");
-  shouldBe("getSelection().baseOffset", "15");
-
-  // check left/right arrows + Shift
-  eventSender.keyDown("rightArrow", ["shiftKey"]);
-  eventSender.keyDown("rightArrow", ["shiftKey"]);
-  eventSender.keyDown("rightArrow", ["shiftKey"]);
-  shouldBe("getSelection().baseOffset", "15");
-  shouldBe("getSelection().extentOffset", "18");
-  eventSender.keyDown("leftArrow", ["shiftKey"]);
-  shouldBe("getSelection().baseOffset", "15");
-  shouldBe("getSelection().extentOffset", "17");
-
-  // check left/right arrows + Ctrl
-  eventSender.keyDown("rightArrow", ["ctrlKey"]);
-  shouldBe("getSelection().baseOffset", "20");
-  eventSender.keyDown("leftArrow", ["ctrlKey"]);
-  shouldBe("getSelection().baseOffset", "16");
-
-  // check left/right arrows + Ctrl + Shift
-  eventSender.keyDown("rightArrow", ["ctrlKey", "shiftKey"]);
-  eventSender.keyDown("rightArrow", ["ctrlKey", "shiftKey"]);
-  shouldBe("getSelection().baseOffset", "16");
-  shouldBe("getSelection().extentOffset", "31");
-  eventSender.keyDown("leftArrow", ["ctrlKey"]);
-  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>
-</body>
-</html>
diff --git a/LayoutTests/platform/mac/Skipped b/LayoutTests/platform/mac/Skipped
index f8c6d37..f656d8b 100644
--- a/LayoutTests/platform/mac/Skipped
+++ b/LayoutTests/platform/mac/Skipped
@@ -277,3 +277,6 @@ 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
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index 876092a..495d934 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -1102,3 +1102,5 @@ 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
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index eaa40e8..d7bbf6f 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,20 @@
+2010-12-05  Antonio Gomes  <agomes at rim.com>
+
+        Reviewed by Ariya Hidayat.
+
+        [Qt] Fix caret browsing navigation mode
+        https://bugs.webkit.org/show_bug.cgi?id=50536
+
+        Caret browsing can consume editing commands even when the start
+        of current selection is not a editable content. r69582 missed this
+        case because caret browsing feature testing is very poor today.
+
+        This commit reintroduces part of the removed code in r69582 but
+        guarded by a isCaretBrowsingEnabled() check. No regression found.
+
+        * WebCoreSupport/EditorClientQt.cpp:
+        (WebCore::EditorClientQt::handleKeyboardEvent):
+
 2010-12-16  Ariya Hidayat  <ariya at sencha.com>
 
         Reviewed by Andreas Kling.
diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
index 0fb21c3..3fbc83d 100644
--- a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
@@ -349,7 +349,7 @@ void EditorClientQt::toggleGrammarChecking()
 void EditorClientQt::handleKeyboardEvent(KeyboardEvent* event)
 {
     Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame();
-    if (!frame || !frame->document()->focusedNode())
+    if (!frame)
         return;
 
     const PlatformKeyboardEvent* kevent = event->keyEvent();
@@ -374,6 +374,7 @@ void EditorClientQt::handleKeyboardEvent(KeyboardEvent* event)
                 }
             }
         }
+
 #ifndef QT_NO_SHORTCUT
         QWebPage::WebAction action = QWebPagePrivate::editorActionForKeyEvent(kevent->qtEvent());
         if (action != QWebPage::NoWebAction && !doSpatialNavigation) {
@@ -466,6 +467,62 @@ 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);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list