2010-12-13 Mario Sanchez Prada <msanchez@igalia.com>
authormario@webkit.org <mario@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Dec 2010 15:53:35 +0000 (15:53 +0000)
committermario@webkit.org <mario@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Dec 2010 15:53:35 +0000 (15:53 +0000)
        Reviewed by Xan Lopez.

        [Gtk] Additional support is needed for caret browsing
        https://bugs.webkit.org/show_bug.cgi?id=25526

        New layout test to check the "MoveTo{Beginninng|End}OfDocument"
        commands when caret browsing is enabled.

        * platform/gtk/editing/selection/caret-mode-document-begin-end-expected.txt: Added.
        * platform/gtk/editing/selection/caret-mode-document-begin-end.html: Added.
2010-12-13  Mario Sanchez Prada  <msanchez@igalia.com>

        Reviewed by Xan Lopez.

        [Gtk] Additional support is needed for caret browsing
        https://bugs.webkit.org/show_bug.cgi?id=25526

        Enable "MoveTo{Beginninng|End}OfDocument" commands when caret
        browsing is enabled.

        This change impacts the GTK-port only as caret browsing is a
        feature only used in that platform so far.

        Test: platform/gtk/editing/selection/caret-mode-document-begin-end.html

        * editing/EditorCommand.cpp:
        (WebCore::createCommandMap): Enable the commads when in caret browsing.

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

LayoutTests/ChangeLog
LayoutTests/platform/gtk/editing/selection/caret-mode-document-begin-end-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/editing/selection/caret-mode-document-begin-end.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/editing/EditorCommand.cpp

index 311472c..e271b59 100644 (file)
@@ -1,3 +1,16 @@
+2010-12-13  Mario Sanchez Prada  <msanchez@igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        [Gtk] Additional support is needed for caret browsing
+        https://bugs.webkit.org/show_bug.cgi?id=25526
+
+        New layout test to check the "MoveTo{Beginninng|End}OfDocument"
+        commands when caret browsing is enabled.
+
+        * platform/gtk/editing/selection/caret-mode-document-begin-end-expected.txt: Added.
+        * platform/gtk/editing/selection/caret-mode-document-begin-end.html: Added.
+
 2010-12-13  Ilya Tikhonovsky  <loislo@chromium.org>
 
         Reviewed by Yury Semikhatsky.
diff --git a/LayoutTests/platform/gtk/editing/selection/caret-mode-document-begin-end-expected.txt b/LayoutTests/platform/gtk/editing/selection/caret-mode-document-begin-end-expected.txt
new file mode 100644 (file)
index 0000000..660f6c0
--- /dev/null
@@ -0,0 +1,24 @@
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > P > SPAN > P > BODY > HTML > #document to 2 of #text > P > SPAN > P > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > P > SPAN > P > BODY > HTML > #document to 2 of #text > P > SPAN > P > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > BODY > HTML > #document to 2 of #text > P > SPAN > P > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 2 of #text > P > SPAN > P > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+First text line.
+Second text line.
+Third text line.
+A paragraph to finish.
+
+This tests direct navigation to the begin and end of the document in caret mode.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/gtk/editing/selection/caret-mode-document-begin-end.html b/LayoutTests/platform/gtk/editing/selection/caret-mode-document-begin-end.html
new file mode 100644 (file)
index 0000000..c59e7cf
--- /dev/null
@@ -0,0 +1,44 @@
+<!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>
+<div id="startHere">
+  First text line.<br />
+  Second text line.<br />
+  Third text line.
+</div>
+<p>A paragraph to finish.</p>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description("This tests direct navigation to the begin and end of the document in caret mode.");
+
+if (window.layoutTestController) {
+  layoutTestController.overridePreference("WebKitEnableCaretBrowsing", true);
+  layoutTestController.dumpAsText();
+  layoutTestController.dumpEditingCallbacks();
+
+  startPoint = document.getElementById("startHere");
+  window.getSelection().setPosition(startPoint.childNodes.item(0), 5);
+
+  // Move to the beginning and the end of the document.
+  layoutTestController.execCommand("MoveToBeginningOfDocument");
+  layoutTestController.execCommand("MoveToEndOfDocument");
+
+  // Try the same commands modifying the selection.
+  layoutTestController.execCommand("MoveToBeginningOfDocumentAndModifySelection");
+  window.getSelection().setPosition(startPoint.childNodes.item(0), 5);
+  layoutTestController.execCommand("MoveToEndOfDocumentAndModifySelection");
+}
+
+successfullyParsed = true;
+</script>
+<script src="../../../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
index 4a2c043..b433d6b 100644 (file)
@@ -1,3 +1,21 @@
+2010-12-13  Mario Sanchez Prada  <msanchez@igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        [Gtk] Additional support is needed for caret browsing
+        https://bugs.webkit.org/show_bug.cgi?id=25526
+
+        Enable "MoveTo{Beginninng|End}OfDocument" commands when caret
+        browsing is enabled.
+
+        This change impacts the GTK-port only as caret browsing is a
+        feature only used in that platform so far.
+
+        Test: platform/gtk/editing/selection/caret-mode-document-begin-end.html
+
+        * editing/EditorCommand.cpp:
+        (WebCore::createCommandMap): Enable the commads when in caret browsing.
+
 2010-12-13  Yury Semikhatsky  <yurys@chromium.org>
 
         Unreviewed. Qt build fix.
index 982fc66..fb5a9d6 100644 (file)
@@ -1457,16 +1457,16 @@ static const CommandMap& createCommandMap()
         { "MoveParagraphForwardAndModifySelection", { executeMoveParagraphForwardAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "MoveRight", { executeMoveRight, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "MoveRightAndModifySelection", { executeMoveRightAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
-        { "MoveToBeginningOfDocument", { executeMoveToBeginningOfDocument, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
-        { "MoveToBeginningOfDocumentAndModifySelection", { executeMoveToBeginningOfDocumentAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+        { "MoveToBeginningOfDocument", { executeMoveToBeginningOfDocument, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+        { "MoveToBeginningOfDocumentAndModifySelection", { executeMoveToBeginningOfDocumentAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "MoveToBeginningOfLine", { executeMoveToBeginningOfLine, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "MoveToBeginningOfLineAndModifySelection", { executeMoveToBeginningOfLineAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "MoveToBeginningOfParagraph", { executeMoveToBeginningOfParagraph, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "MoveToBeginningOfParagraphAndModifySelection", { executeMoveToBeginningOfParagraphAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "MoveToBeginningOfSentence", { executeMoveToBeginningOfSentence, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "MoveToBeginningOfSentenceAndModifySelection", { executeMoveToBeginningOfSentenceAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
-        { "MoveToEndOfDocument", { executeMoveToEndOfDocument, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
-        { "MoveToEndOfDocumentAndModifySelection", { executeMoveToEndOfDocumentAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+        { "MoveToEndOfDocument", { executeMoveToEndOfDocument, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+        { "MoveToEndOfDocumentAndModifySelection", { executeMoveToEndOfDocumentAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "MoveToEndOfLine", { executeMoveToEndOfLine, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "MoveToEndOfLineAndModifySelection", { executeMoveToEndOfLineAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "MoveToEndOfParagraph", { executeMoveToEndOfParagraph, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },