<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[26047] trunk</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/26047">26047</a></dd>
<dt>Author</dt> <dd>adele</dd>
<dt>Date</dt> <dd>2007-10-04 15:21:55 -0700 (Thu, 04 Oct 2007)</dd>
</dl>

<h3>Log Message</h3>
<pre>WebCore:

        Reviewed by Darin.

        WebCore part of fix for &lt;rdar://problem/5369017&gt; REGRESSION: Can't tab to webview that doesn't have editable content

        * page/FocusController.h: Added FocusDirection argument.
        * page/FocusController.cpp: (WebCore::FocusController::setInitialFocus):
          Use FocusDirection argument instead of key modifiers to send direction to advanceFocus.
        * WebCore.exp: Updated symbol.

WebKit:

        Reviewed by Darin.

        WebKit part of fix for &lt;rdar://problem/5369017&gt; REGRESSION: Can't tab to webview that doesn't have editable content

        * WebView/WebHTMLView.mm: (-[WebHTMLView becomeFirstResponder]): Pass in the FocusDirection.

win:

        Reviewed by Darin.

        WebKit/win part of fix for &lt;rdar://problem/5369017&gt; REGRESSION: Can't tab to webview that doesn't have editable content

        * WebView.cpp: Added setInitialFocus so the application can specify that its handing off focus to WebKit
          and so that it can specify the focus direction.
        * WebView.h: ditto.
        * Interfaces/IWebViewPrivate.idl: ditto.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCoreWebCoreexp">trunk/WebCore/WebCore.exp</a></li>
<li><a href="#trunkWebCorepageFocusControllercpp">trunk/WebCore/page/FocusController.cpp</a></li>
<li><a href="#trunkWebCorepageFocusControllerh">trunk/WebCore/page/FocusController.h</a></li>
<li><a href="#trunkWebKitChangeLog">trunk/WebKit/ChangeLog</a></li>
<li><a href="#trunkWebKitWebViewWebHTMLViewmm">trunk/WebKit/WebView/WebHTMLView.mm</a></li>
<li><a href="#trunkWebKitwinChangeLog">trunk/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkWebKitwinInterfacesIWebViewPrivateidl">trunk/WebKit/win/Interfaces/IWebViewPrivate.idl</a></li>
<li><a href="#trunkWebKitwinWebViewcpp">trunk/WebKit/win/WebView.cpp</a></li>
<li><a href="#trunkWebKitwinWebViewh">trunk/WebKit/win/WebView.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (26046 => 26047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2007-10-04 20:34:28 UTC (rev 26046)
+++ trunk/WebCore/ChangeLog        2007-10-04 22:21:55 UTC (rev 26047)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2007-10-04  Adele Peterson  &lt;adele@apple.com&gt;
+
+        Reviewed by Darin.
+
+        WebCore part of fix for &lt;rdar://problem/5369017&gt; REGRESSION: Can't tab to webview that doesn't have editable content
+
+        * page/FocusController.h: Added FocusDirection argument.
+        * page/FocusController.cpp: (WebCore::FocusController::setInitialFocus):
+          Use FocusDirection argument instead of key modifiers to send direction to advanceFocus.
+        * WebCore.exp: Updated symbol.
+
</ins><span class="cx"> 2007-10-04  Kevin Decker  &lt;kdecker@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by John.
</span></span></pre></div>
<a id="trunkWebCoreWebCoreexp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.exp (26046 => 26047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.exp        2007-10-04 20:34:28 UTC (rev 26046)
+++ trunk/WebCore/WebCore.exp        2007-10-04 22:21:55 UTC (rev 26047)
</span><span class="lines">@@ -288,7 +288,7 @@
</span><span class="cx"> __ZN7WebCore15BackForwardListD1Ev
</span><span class="cx"> __ZN7WebCore15ContextMenuItem26releasePlatformDescriptionEv
</span><span class="cx"> __ZN7WebCore15FocusController15setFocusedFrameEN3WTF10PassRefPtrINS_5FrameEEE
</span><del>-__ZN7WebCore15FocusController15setInitialFocusEPNS_13KeyboardEventE
</del><ins>+__ZN7WebCore15FocusController15setInitialFocusENS_14FocusDirectionEPNS_13KeyboardEventE
</ins><span class="cx"> __ZN7WebCore15FocusController18focusedOrMainFrameEv
</span><span class="cx"> __ZN7WebCore15StringTruncator13rightTruncateERKNS_6StringEfRKNS_4FontEb
</span><span class="cx"> __ZN7WebCore15StringTruncator14centerTruncateERKNS_6StringEfRKNS_4FontEb
</span></span></pre></div>
<a id="trunkWebCorepageFocusControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/FocusController.cpp (26046 => 26047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/FocusController.cpp        2007-10-04 20:34:28 UTC (rev 26046)
+++ trunk/WebCore/page/FocusController.cpp        2007-10-04 22:21:55 UTC (rev 26047)
</span><span class="lines">@@ -110,9 +110,9 @@
</span><span class="cx">     return node;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool FocusController::setInitialFocus(KeyboardEvent* event)
</del><ins>+bool FocusController::setInitialFocus(FocusDirection direction, KeyboardEvent* event)
</ins><span class="cx"> {
</span><del>-    return advanceFocus((event &amp;&amp; event-&gt;shiftKey()) ? FocusDirectionBackward : FocusDirectionForward, event, true);
</del><ins>+    return advanceFocus(direction, event, true);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool FocusController::advanceFocus(KeyboardEvent* event)
</span></span></pre></div>
<a id="trunkWebCorepageFocusControllerh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/FocusController.h (26046 => 26047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/FocusController.h        2007-10-04 20:34:28 UTC (rev 26046)
+++ trunk/WebCore/page/FocusController.h        2007-10-04 22:21:55 UTC (rev 26047)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx">         Frame* focusedFrame() const { return m_focusedFrame.get(); }
</span><span class="cx">         Frame* focusedOrMainFrame();
</span><span class="cx"> 
</span><del>-        bool setInitialFocus(KeyboardEvent*);
</del><ins>+        bool setInitialFocus(FocusDirection, KeyboardEvent*);
</ins><span class="cx">         bool advanceFocus(KeyboardEvent*);
</span><span class="cx">         bool advanceFocus(FocusDirection, KeyboardEvent*, bool initialFocus = false);
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/ChangeLog (26046 => 26047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/ChangeLog        2007-10-04 20:34:28 UTC (rev 26046)
+++ trunk/WebKit/ChangeLog        2007-10-04 22:21:55 UTC (rev 26047)
</span><span class="lines">@@ -1,3 +1,11 @@
</span><ins>+2007-10-04  Adele Peterson  &lt;adele@apple.com&gt;
+
+        Reviewed by Darin.
+
+        WebKit part of fix for &lt;rdar://problem/5369017&gt; REGRESSION: Can't tab to webview that doesn't have editable content
+
+        * WebView/WebHTMLView.mm: (-[WebHTMLView becomeFirstResponder]): Pass in the FocusDirection.
+
</ins><span class="cx"> 2007-10-04  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         * WebView/WebHTMLView.mm: (-[WebHTMLView _updateActiveState]):
</span></span></pre></div>
<a id="trunkWebKitWebViewWebHTMLViewmm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/WebView/WebHTMLView.mm (26046 => 26047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/WebView/WebHTMLView.mm        2007-10-04 20:34:28 UTC (rev 26046)
+++ trunk/WebKit/WebView/WebHTMLView.mm        2007-10-04 22:21:55 UTC (rev 26047)
</span><span class="lines">@@ -3265,7 +3265,8 @@
</span><span class="cx">     page-&gt;focusController()-&gt;setFocusedFrame(frame);
</span><span class="cx">     if (Document* document = frame-&gt;document())
</span><span class="cx">         document-&gt;setFocusedNode(0);
</span><del>-    page-&gt;focusController()-&gt;setInitialFocus(frame-&gt;eventHandler()-&gt;currentKeyboardEvent().get());
</del><ins>+    page-&gt;focusController()-&gt;setInitialFocus(direction == NSSelectingNext ? FocusDirectionForward : FocusDirectionBackward,
+                                             frame-&gt;eventHandler()-&gt;currentKeyboardEvent().get());
</ins><span class="cx">     return YES;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/win/ChangeLog (26046 => 26047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/win/ChangeLog        2007-10-04 20:34:28 UTC (rev 26046)
+++ trunk/WebKit/win/ChangeLog        2007-10-04 22:21:55 UTC (rev 26047)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2007-10-04  Adele Peterson  &lt;adele@apple.com&gt;
+
+        Reviewed by Darin.
+
+        WebKit/win part of fix for &lt;rdar://problem/5369017&gt; REGRESSION: Can't tab to webview that doesn't have editable content
+
+        * WebView.cpp: Added setInitialFocus so the application can specify that its handing off focus to WebKit
+          and so that it can specify the focus direction.
+        * WebView.h: ditto.
+        * Interfaces/IWebViewPrivate.idl: ditto.
+
</ins><span class="cx"> 2007-10-03  Ada Chan  &lt;adachan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;rdar://problem/5521230&gt; Implement IWebIconDatabase::iconURLForURL in WebKit for windows
</span></span></pre></div>
<a id="trunkWebKitwinInterfacesIWebViewPrivateidl"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/win/Interfaces/IWebViewPrivate.idl (26046 => 26047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/win/Interfaces/IWebViewPrivate.idl        2007-10-04 20:34:28 UTC (rev 26046)
+++ trunk/WebKit/win/Interfaces/IWebViewPrivate.idl        2007-10-04 22:21:55 UTC (rev 26047)
</span><span class="lines">@@ -104,6 +104,7 @@
</span><span class="cx">     HRESULT canHandleRequest([in] IWebURLRequest* request, [out, retval] BOOL* result);
</span><span class="cx"> 
</span><span class="cx">     HRESULT clearFocusNode();
</span><ins>+    HRESULT setInitialFocus([in] BOOL forward);
</ins><span class="cx"> 
</span><span class="cx">     HRESULT setTabKeyCyclesThroughElements([in] BOOL cycles);
</span><span class="cx">     HRESULT tabKeyCyclesThroughElements([out, retval] BOOL* result);
</span></span></pre></div>
<a id="trunkWebKitwinWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/win/WebView.cpp (26046 => 26047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/win/WebView.cpp        2007-10-04 20:34:28 UTC (rev 26046)
+++ trunk/WebKit/win/WebView.cpp        2007-10-04 22:21:55 UTC (rev 26047)
</span><span class="lines">@@ -3674,6 +3674,17 @@
</span><span class="cx">     return S_OK;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+HRESULT STDMETHODCALLTYPE WebView::setInitialFocus(
+    /* [in] */ BOOL forward)
+{
+    if (m_page &amp;&amp; m_page-&gt;focusController()) {
+        Frame* frame = m_page-&gt;focusController()-&gt;focusedOrMainFrame();
+        frame-&gt;document()-&gt;setFocusedNode(0);
+        m_page-&gt;focusController()-&gt;setInitialFocus(forward ? FocusDirectionForward : FocusDirectionBackward, 0);
+    }
+    return S_OK;
+}
+
</ins><span class="cx"> HRESULT STDMETHODCALLTYPE WebView::setTabKeyCyclesThroughElements( 
</span><span class="cx">     /* [in] */ BOOL cycles)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkWebKitwinWebViewh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/win/WebView.h (26046 => 26047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/win/WebView.h        2007-10-04 20:34:28 UTC (rev 26046)
+++ trunk/WebKit/win/WebView.h        2007-10-04 22:21:55 UTC (rev 26047)
</span><span class="lines">@@ -595,6 +595,9 @@
</span><span class="cx"> 
</span><span class="cx">     virtual HRESULT STDMETHODCALLTYPE clearFocusNode();
</span><span class="cx"> 
</span><ins>+    virtual HRESULT STDMETHODCALLTYPE setInitialFocus(
+        /* [in] */ BOOL forward);
+    
</ins><span class="cx">     virtual HRESULT STDMETHODCALLTYPE setTabKeyCyclesThroughElements( 
</span><span class="cx">         /* [in] */ BOOL cycles);
</span><span class="cx">     
</span></span></pre>
</div>
</div>

</body>
</html>