LayoutTests:
authorantti <antti@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Mar 2007 21:41:49 +0000 (21:41 +0000)
committerantti <antti@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Mar 2007 21:41:49 +0000 (21:41 +0000)
        Reviewed by Darin.

        http://bugs.webkit.org/show_bug.cgi?id=11083
        REGRESSION: Typing tab key fails to insert a tab character in Google Docs editable area
        <rdar://problem/4757650>

        * editing/inserting/typing-tab-designmode-expected.txt: Added.
        * editing/inserting/typing-tab-designmode-forms-expected.checksum: Added.
        * editing/inserting/typing-tab-designmode-forms-expected.png: Added.
        * editing/inserting/typing-tab-designmode-forms-expected.txt: Added.
        * editing/inserting/typing-tab-designmode-forms.html: Added.
        * editing/inserting/typing-tab-designmode.html: Added.

WebCore:

        Reviewed by Darin.

        Fix http://bugs.webkit.org/show_bug.cgi?id=11083
        REGRESSION: Typing tab key fails to insert a tab character in Google Docs editable area
        <rdar://problem/4757650>

        Allow inserting tabs in designMode. Backtab behaves like before (matches FF).

        * page/EventHandler.cpp:
        (WebCore::EventHandler::defaultTabEventHandler):

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

LayoutTests/ChangeLog
LayoutTests/editing/inserting/typing-tab-designmode-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/typing-tab-designmode-forms-expected.checksum [new file with mode: 0644]
LayoutTests/editing/inserting/typing-tab-designmode-forms-expected.png [new file with mode: 0644]
LayoutTests/editing/inserting/typing-tab-designmode-forms-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/typing-tab-designmode-forms.html [new file with mode: 0644]
LayoutTests/editing/inserting/typing-tab-designmode.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/page/EventHandler.cpp

index ab78a11202ba5893a20193803904a342265ef121..62adecffd9efdbb9d91a871876aa0321443c1016 100644 (file)
@@ -1,3 +1,18 @@
+2007-03-13  Antti Koivisto  <antti@apple.com>
+
+        Reviewed by Darin.
+        
+        http://bugs.webkit.org/show_bug.cgi?id=11083
+        REGRESSION: Typing tab key fails to insert a tab character in Google Docs editable area
+        <rdar://problem/4757650>
+
+        * editing/inserting/typing-tab-designmode-expected.txt: Added.
+        * editing/inserting/typing-tab-designmode-forms-expected.checksum: Added.
+        * editing/inserting/typing-tab-designmode-forms-expected.png: Added.
+        * editing/inserting/typing-tab-designmode-forms-expected.txt: Added.
+        * editing/inserting/typing-tab-designmode-forms.html: Added.
+        * editing/inserting/typing-tab-designmode.html: Added.
+
 2007-03-13  Darin Adler  <darin@apple.com>
 
         * fast/js/kde/RegExp-expected.txt: Fix the one other test affected by
diff --git a/LayoutTests/editing/inserting/typing-tab-designmode-expected.txt b/LayoutTests/editing/inserting/typing-tab-designmode-expected.txt
new file mode 100644 (file)
index 0000000..96bfb5e
--- /dev/null
@@ -0,0 +1,2 @@
+        try if tabs work in designMode
+
diff --git a/LayoutTests/editing/inserting/typing-tab-designmode-forms-expected.checksum b/LayoutTests/editing/inserting/typing-tab-designmode-forms-expected.checksum
new file mode 100644 (file)
index 0000000..951fcb5
--- /dev/null
@@ -0,0 +1 @@
+92c5d1f61b60dc40b4f43204e242b3c1
\ No newline at end of file
diff --git a/LayoutTests/editing/inserting/typing-tab-designmode-forms-expected.png b/LayoutTests/editing/inserting/typing-tab-designmode-forms-expected.png
new file mode 100644 (file)
index 0000000..12381ae
Binary files /dev/null and b/LayoutTests/editing/inserting/typing-tab-designmode-forms-expected.png differ
diff --git a/LayoutTests/editing/inserting/typing-tab-designmode-forms-expected.txt b/LayoutTests/editing/inserting/typing-tab-designmode-forms-expected.txt
new file mode 100644 (file)
index 0000000..9dc3bc7
--- /dev/null
@@ -0,0 +1,18 @@
+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
+      RenderTextControl {INPUT} at (2,2) size 148x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+      RenderBR {BR} at (152,16) size 0x0
+      RenderTextControl {INPUT} at (2,25) size 148x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+      RenderText {#text} at (152,25) size 4x18
+        text run at (152,25) width 4: " "
+      RenderText {#text} at (156,25) size 455x18
+        text run at (156,25) width 455: "tabbing between forms in design mode (nothing happens at the moment)"
+      RenderBR {BR} at (611,39) size 0x0
+layer at (13,13) size 142x13
+  RenderBlock {DIV} at (3,3) size 142x13
+layer at (13,36) size 142x13
+  RenderBlock {DIV} at (3,3) size 142x13
+caret: position 0 of child 0 {DIV} of child 1 {INPUT} of child 0 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/inserting/typing-tab-designmode-forms.html b/LayoutTests/editing/inserting/typing-tab-designmode-forms.html
new file mode 100644 (file)
index 0000000..8a36dff
--- /dev/null
@@ -0,0 +1,18 @@
+<body>
+<input id=i><br>
+<input>
+<script>
+        
+document.designMode="on";
+
+var e = document.getElementById('i');
+e.focus();
+
+if (window.eventSender) {
+    var mod = [];
+    eventSender.keyDown('\t', mod);
+}
+</script>
+tabbing between forms in design mode (nothing happens at the moment)<br>
+
+</script>
diff --git a/LayoutTests/editing/inserting/typing-tab-designmode.html b/LayoutTests/editing/inserting/typing-tab-designmode.html
new file mode 100644 (file)
index 0000000..7721045
--- /dev/null
@@ -0,0 +1,19 @@
+<body>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+        
+document.designMode="on";
+
+var e = document.body;
+var s = window.getSelection();
+s.setPosition(e, 0);
+
+if (window.eventSender) {
+    var mod = [];
+    eventSender.keyDown('\t', mod);
+}
+</script>
+try if tabs work in designMode<br>
+
+</script>
index 6bd09821b4f3b8d92c65d61ab73c97e78c04f3fa..70671aff95c609e660171e3bfc5f579a83419da1 100644 (file)
@@ -1,3 +1,16 @@
+2007-03-13  Antti Koivisto  <antti@apple.com>
+
+        Reviewed by Darin.
+        
+        Fix http://bugs.webkit.org/show_bug.cgi?id=11083
+        REGRESSION: Typing tab key fails to insert a tab character in Google Docs editable area
+        <rdar://problem/4757650>
+        
+        Allow inserting tabs in designMode. Backtab behaves like before (matches FF).
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::defaultTabEventHandler):
+
 2007-03-13  David Hyatt  <hyatt@apple.com>
 
         Fix two counting errors in the decoded size of objects in the WebCore cache.  We need to explicitly
index 9abd85a7239d4eedcb5422e67a27a300becb1ec6..ace8a63494dae3fe745613efc7a48e05ee3353a0 100644 (file)
@@ -1561,7 +1561,8 @@ void EventHandler::defaultTextInputEventHandler(TextEvent* event)
 void EventHandler::defaultTabEventHandler(Event* event, bool isBackTab)
 {
     Page* page = m_frame->page();
-    if (!page ||! page->tabKeyCyclesThroughElements())
+    // Tabs can be used in design mode editing. You can still move out with back tab.
+    if (!page || !page->tabKeyCyclesThroughElements() || (m_frame->document()->inDesignMode() && !isBackTab))
         return;
     FocusController* focus = page->focusController();
     KeyboardEvent* keyboardEvent = findKeyboardEvent(event);