LayoutTests:
authoradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Apr 2006 01:29:30 +0000 (01:29 +0000)
committeradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Apr 2006 01:29:30 +0000 (01:29 +0000)
        Reviewed by Darin.

        Test for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8213
        REGRESSION: Can't tab out of text field if iframe comes after it

        * fast/forms/tabbing-input-iframe-expected.checksum: Added.
        * fast/forms/tabbing-input-iframe-expected.png: Added.
        * fast/forms/tabbing-input-iframe-expected.txt: Added.
        * fast/forms/tabbing-input-iframe.html: Added.

WebCore:

        Reviewed by Darin.

        Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8213
        REGRESSION: Can't tab out of text field if iframe comes after it

        Test: fast/forms/tabbing-input-iframe.html

        * bridge/mac/FrameMac.mm: (WebCore::FrameMac::nextKeyViewInFrame):
          If the next focusable node is a RenderWidget without a view, then continue in the loop.  We used to break out in this case.
          I also made some formatting changes and reorganized the function to make it easier to read.

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

LayoutTests/ChangeLog
LayoutTests/fast/forms/tabbing-input-iframe-expected.checksum [new file with mode: 0644]
LayoutTests/fast/forms/tabbing-input-iframe-expected.png [new file with mode: 0644]
LayoutTests/fast/forms/tabbing-input-iframe-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/tabbing-input-iframe.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/bridge/mac/FrameMac.mm

index cab8a134e322b6845ef5fe29b9207c27ed73fb1d..386f3d4e8663754826ebba27bdfc1eefdd5e0e48 100644 (file)
@@ -1,3 +1,15 @@
+2006-04-21  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Darin.
+
+        Test for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8213
+        REGRESSION: Can't tab out of text field if iframe comes after it
+
+        * fast/forms/tabbing-input-iframe-expected.checksum: Added.
+        * fast/forms/tabbing-input-iframe-expected.png: Added.
+        * fast/forms/tabbing-input-iframe-expected.txt: Added.
+        * fast/forms/tabbing-input-iframe.html: Added.
+
 2006-04-21  Beth Dakin  <bdakin@apple.com>
 
         Adding a few more background-size tests that include background-
diff --git a/LayoutTests/fast/forms/tabbing-input-iframe-expected.checksum b/LayoutTests/fast/forms/tabbing-input-iframe-expected.checksum
new file mode 100644 (file)
index 0000000..94482be
--- /dev/null
@@ -0,0 +1 @@
+a8be587178984f75af4d91c87f4afcc4
\ No newline at end of file
diff --git a/LayoutTests/fast/forms/tabbing-input-iframe-expected.png b/LayoutTests/fast/forms/tabbing-input-iframe-expected.png
new file mode 100644 (file)
index 0000000..33be450
Binary files /dev/null and b/LayoutTests/fast/forms/tabbing-input-iframe-expected.png differ
diff --git a/LayoutTests/fast/forms/tabbing-input-iframe-expected.txt b/LayoutTests/fast/forms/tabbing-input-iframe-expected.txt
new file mode 100644 (file)
index 0000000..6d0f504
--- /dev/null
@@ -0,0 +1,33 @@
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+layer at (0,0) size 800x600
+  RenderCanvas 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
+      RenderText {#text} at (0,0) size 442x18
+        text run at (0,0) width 442: "This tests that you can tab out of a text field if an iframe comes after it."
+      RenderBR {BR} at (442,14) size 0x0
+      RenderTextField {INPUT} at (2,156) size 148x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+      RenderText {#text} at (152,156) size 4x18
+        text run at (152,156) width 4: " "
+      RenderPartObject {IFRAME} at (156,18) size 302x152 [border: (1px solid #000000)]
+        layer at (0,0) size 300x150
+          RenderCanvas at (0,0) size 300x150
+        layer at (0,0) size 300x8
+          RenderBlock {HTML} at (0,0) size 300x8
+            RenderBody {BODY} at (8,8) size 284x0
+      RenderText {#text} at (458,156) size 4x18
+        text run at (458,156) width 4: " "
+      RenderTextField {INPUT} at (464,156) size 148x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
+layer at (13,167) size 142x13
+  RenderBlock {DIV} at (3,3) size 142x13
+layer at (475,167) size 142x13
+  RenderBlock {DIV} at (3,3) size 142x13
+    RenderText {#text} at (1,0) size 123x13
+      text run at (1,0) width 123: "This should have focus"
+selection start: position 0 of child 0 {#text} of child 0 {DIV} of child 7 {INPUT} of child 1 {BODY} of child 0 {HTML} of document
+selection end:   position 22 of child 0 {#text} of child 0 {DIV} of child 7 {INPUT} of child 1 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/fast/forms/tabbing-input-iframe.html b/LayoutTests/fast/forms/tabbing-input-iframe.html
new file mode 100644 (file)
index 0000000..c0bfaf4
--- /dev/null
@@ -0,0 +1,19 @@
+<html>
+<head>
+    <script>
+    function test() {
+        document.getElementById('t1').focus();
+        if (window.eventSender) {
+            eventSender.keyDown("\t");
+        }
+    }
+    </script>
+</head>
+
+<body onload="test()">
+    This tests that you can tab out of a text field if an iframe comes after it.<br>
+    <input id="t1">
+    <iframe style="border: solid thin black"></iframe>
+    <input id="t2" value="This should have focus">
+</body>
+</html>
\ No newline at end of file
index 0cf1d3b9f17f1afa9d811f56a9bb10d96b5887fa..1966fa14685375e6e34b6959571400a5b817726f 100644 (file)
@@ -1,3 +1,16 @@
+2006-04-21  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Darin.
+
+        Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8213
+        REGRESSION: Can't tab out of text field if iframe comes after it
+
+        Test: fast/forms/tabbing-input-iframe.html
+
+        * bridge/mac/FrameMac.mm: (WebCore::FrameMac::nextKeyViewInFrame):
+          If the next focusable node is a RenderWidget without a view, then continue in the loop.  We used to break out in this case. 
+          I also made some formatting changes and reorganized the function to make it easier to read.
+
 2006-04-21  Adele Peterson  <adele@apple.com>
 
         Reviewed by Beth.
index 9f90d708fec3bbf4451b527120345cde3f83a54f..83bb21b97caae92960e1881c0e85cd2b448f4811 100644 (file)
@@ -880,9 +880,9 @@ String FrameMac::mimeTypeForFileName(const String& fileName) const
     return String();
 }
 
-NSView *FrameMac::nextKeyViewInFrame(Node *node, KWQSelectionDirection direction)
+NSView* FrameMac::nextKeyViewInFrame(Node* node, KWQSelectionDirection direction)
 {
-    Document *doc = document();
+    Documentdoc = document();
     if (!doc)
         return nil;
     
@@ -892,26 +892,22 @@ NSView *FrameMac::nextKeyViewInFrame(Node *node, KWQSelectionDirection direction
         if (!node)
             return nil;
         
-        RenderObject *renderer = node->renderer();
-        if (renderer->isWidget()) {
-            RenderWidget *renderWidget = static_cast<RenderWidget *>(renderer);
-            Widget *widget = renderWidget->widget();
-            if (!widget)
-                continue;
-            
-            FrameView *childFrameWidget = widget->isFrameView() ? static_cast<FrameView *>(widget) : 0;
-            NSView *view = nil;
-            if (childFrameWidget)
-                view = Mac(childFrameWidget->frame())->nextKeyViewInFrame(0, direction);
+        RenderObjectrenderer = node->renderer();
+        if (!renderer->isWidget()) {
+            static_cast<Element*>(node)->focus(); 
+            [_bridge willMakeFirstResponderForNodeFocus];
+            return [_bridge documentView];
+        }
+
+        if (Widget* widget = static_cast<RenderWidget*>(renderer)->widget()) {
+            NSView* view;
+            if (widget->isFrameView())
+                view = Mac(static_cast<FrameView*>(widget)->frame())->nextKeyViewInFrame(0, direction);
             else
                 view = widget->getView();
             if (view)
                 return view;
-        } else
-            static_cast<Element *>(node)->focus(); 
-
-        [_bridge willMakeFirstResponderForNodeFocus];
-        return [_bridge documentView];
+        }
     }
 }