Changeset 19879 in webkit


Ignore:
Timestamp:
Feb 27, 2007 12:44:40 AM (17 years ago)
Author:
adele
Message:

LayoutTests:

Reviewed by Lars.

Updated test for http://bugs.webkit.org/show_bug.cgi?id=12902
<rdar://problem/5012679> REGRESSION: Pressing return key doesn't
move caret to next line after applying a font color in GMail

  • fast/frames/iframe-window-focus-expected.txt:
  • fast/frames/iframe-window-focus.html: Updated test to include insertion of newlines.

WebCore:

Reviewed by Lars.

Fix for http://bugs.webkit.org/show_bug.cgi?id=12902
<rdar://problem/5012679> REGRESSION: Pressing return key doesn't
move caret to next line after applying a font color in GMail

Test: fast/frames/iframe-window-focus-2.html

  • page/EventHandler.h: Make focusDocumentView public.
  • page/Frame.cpp: (WebCore::Frame::focusWindow): Instead of just setting the focused frame, we should set also focus the document view. The bug here was that since the subframe view wasn't the first responder, the key down event was going to the wrong frame.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r19878 r19879  
     12007-02-27  Adele Peterson  <adele@apple.com>
     2
     3        Reviewed by Lars.
     4
     5        Updated test for http://bugs.webkit.org/show_bug.cgi?id=12902
     6        <rdar://problem/5012679> REGRESSION: Pressing return key doesn't
     7        move caret to next line after applying a font color in GMail
     8
     9        * fast/frames/iframe-window-focus-expected.txt:
     10        * fast/frames/iframe-window-focus.html: Updated test to include insertion of newlines.
     11
    1122007-02-26  Maciej Stachowiak  <mjs@apple.com>
    213
  • trunk/LayoutTests/fast/frames/iframe-window-focus-expected.txt

    r19522 r19879  
    1 This tests that focusing an editable iframe's window works correctly.
     1This tests that focusing an editable iframe's window works correctly and allows text and newlines to be entered.
    22
     3TEST
    34PASS
    45
  • trunk/LayoutTests/fast/frames/iframe-window-focus.html

    r19522 r19879  
    1 <html><head>
    2 <script>
    3 if (window.layoutTestController)
    4     layoutTestController.dumpAsText();
     1<html>
     2    <head>
     3        <script>
     4            if (window.layoutTestController)
     5                layoutTestController.dumpAsText();
    56
    6 function init() {
    7     var iframe = document.getElementById("rte");
    8     iframe.contentDocument.designMode = "on";
    9     iframe.contentWindow.focus();
    10    
    11     if (window.layoutTestController) {
    12         eventSender.keyDown("P");
    13         eventSender.keyDown("A");
    14         eventSender.keyDown("S");
    15         eventSender.keyDown("S");
    16     }
    17     document.getElementById('res').innerHTML = iframe.contentDocument.body.innerText;
    18 }
     7            function moveFocus() {
     8                var ifrm = document.getElementById("rte");
     9                ifrm.contentWindow.focus();
     10            }
     11           
     12            function init() {
     13                var ifrm = document.getElementById("rte");
     14                ifrm.contentDocument.designMode = "on";
     15                ifrm.contentWindow.focus();
     16               
     17                if (window.layoutTestController) {
     18                    eventSender.keyDown('T');
     19                    eventSender.keyDown('E');
     20                    eventSender.keyDown('S');
     21                    eventSender.keyDown('T');
     22                   
     23                    // Click elsewhere to move the focus, and then move the focus back
     24                    eventSender.mouseMoveTo(10, 10);
     25                    eventSender.mouseDown();
     26                    eventSender.mouseUp();
     27                   
     28                    // Newline character
     29                    eventSender.keyDown(String.fromCharCode(0x000a));
     30                   
     31                    eventSender.keyDown('P');
     32                    eventSender.keyDown('A');
     33                    eventSender.keyDown('S');
     34                    eventSender.keyDown('S');
     35                }
     36                document.getElementById('res').innerHTML = ifrm.contentDocument.body.innerHTML;
     37            }
     38        </script>
     39    </head>
     40    <body onload="init()">
     41        <div id="dv" onclick="moveFocus()">This tests that focusing an editable iframe's window works correctly and allows text and newlines to be entered.<div>
     42        <iframe id="rte" style="border: 1px solid black"></iframe>
     43        <div id="res"></div>
     44    </body>
     45</html>
    1946
    20 
    21 </script>
    22 </head>
    23 <body onload="init()">
    24 This tests that focusing an editable iframe's window works correctly.<br>
    25 <iframe id="rte" style="border: 1px solid black"></iframe>
    26 <div id="res"></div>
    27 </body>
    28 </html>
  • trunk/WebCore/ChangeLog

    r19878 r19879  
     12007-02-26  Adele Peterson  <adele@apple.com>
     2
     3        Reviewed by Lars.
     4
     5        Fix for http://bugs.webkit.org/show_bug.cgi?id=12902
     6        <rdar://problem/5012679> REGRESSION: Pressing return key doesn't
     7        move caret to next line after applying a font color in GMail
     8
     9        Test: fast/frames/iframe-window-focus-2.html
     10
     11        * page/EventHandler.h: Make focusDocumentView public.
     12        * page/Frame.cpp: (WebCore::Frame::focusWindow): Instead of just setting the focused frame,
     13          we should set also focus the document view.  The bug here was that since the subframe view
     14          wasn't the first responder, the key down event was going to the wrong frame.
     15
    1162007-02-26  Maciej Stachowiak  <mjs@apple.com>
    217
  • trunk/WebCore/page/EventHandler.h

    r19702 r19879  
    142142    void dragSourceEndedAt(const PlatformMouseEvent&, DragOperation);
    143143
     144    void focusDocumentView();
     145
    144146#if PLATFORM(MAC)
    145147    PassRefPtr<KeyboardEvent> currentKeyboardEvent() const;
     
    209211    void freeClipboard();
    210212
    211     void focusDocumentView();
    212 
    213213    bool handleDrag(const MouseEventWithHitTestResults&);
    214214    bool handleMouseUp(const MouseEventWithHitTestResults&);
  • trunk/WebCore/page/Frame.cpp

    r19866 r19879  
    17481748        page()->chrome()->focus();
    17491749
    1750     page()->focusController()->setFocusedFrame(this);
     1750    eventHandler()->focusDocumentView();
    17511751}
    17521752
Note: See TracChangeset for help on using the changeset viewer.