<!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" />
<title>[45802] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { 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 #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#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>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/45802">45802</a></dd>
<dt>Author</dt> <dd>jmalonzo@webkit.org</dd>
<dt>Date</dt> <dd>2009-07-13 03:11:13 -0700 (Mon, 13 Jul 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>2009-07-13  Jan Michael Alonzo  &lt;jmalonzo@webkit.org&gt;

        &lt;https://bugs.webkit.org/show_bug.cgi?id=27171&gt; [Gtk]
        REGRESSION (r45440): fails at fast/events/frame-programmatic-focus.html

        Reviewed by Gustavo Noronha.

        Unskip fast/events/frame-programmatic-focus.html

        * platform/gtk/Skipped:

        focus-in and focus-out events only get triggered when there's user
        interaction, hence setFocused(bool) never gets called when
        focusEvent is triggered when running the layout tests. The
        solution seems to be to implement grab-focus too so we can call
        setFocused(bool) when a widget has focus.

        * webkit/webkitwebview.cpp:
        (webkit_web_view_grab_focus):
        (webkit_web_view_focus_in_event):
        (webkit_web_view_class_init):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformgtkSkipped">trunk/LayoutTests/platform/gtk/Skipped</a></li>
<li><a href="#trunkWebKitgtkChangeLog">trunk/WebKit/gtk/ChangeLog</a></li>
<li><a href="#trunkWebKitgtkwebkitwebkitwebviewcpp">trunk/WebKit/gtk/webkit/webkitwebview.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (45801 => 45802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2009-07-13 09:57:52 UTC (rev 45801)
+++ trunk/LayoutTests/ChangeLog        2009-07-13 10:11:13 UTC (rev 45802)
</span><span class="lines">@@ -1,5 +1,16 @@
</span><span class="cx"> 2009-07-13  Jan Michael Alonzo  &lt;jmalonzo@webkit.org&gt;
</span><span class="cx"> 
</span><ins>+        &lt;https://bugs.webkit.org/show_bug.cgi?id=27171&gt; [Gtk]
+        REGRESSION (r45440): fails at fast/events/frame-programmatic-focus.html
+
+        Reviewed by Gustavo Noronha.
+
+        Unskip fast/events/frame-programmatic-focus.html
+
+        * platform/gtk/Skipped:
+
+2009-07-13  Jan Michael Alonzo  &lt;jmalonzo@webkit.org&gt;
+
</ins><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=26718 [Gtk] Add support for javascript windows for DRT
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Gustavo Noronha and Xan Lopez.
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkSkipped"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/Skipped (45801 => 45802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/Skipped        2009-07-13 09:57:52 UTC (rev 45801)
+++ trunk/LayoutTests/platform/gtk/Skipped        2009-07-13 10:11:13 UTC (rev 45802)
</span><span class="lines">@@ -5943,6 +5943,3 @@
</span><span class="cx"> 
</span><span class="cx"> # See Bug #27145 - https://bugs.webkit.org/show_bug.cgi?id=27145
</span><span class="cx"> fast/loader/subframe-navigate-during-main-frame-load.html
</span><del>-
-# See Bug #27171 - https://bugs.webkit.org/show_bug.cgi?id=27171
-fast/events/frame-programmatic-focus.html
</del></span></pre></div>
<a id="trunkWebKitgtkChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/gtk/ChangeLog (45801 => 45802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/gtk/ChangeLog        2009-07-13 09:57:52 UTC (rev 45801)
+++ trunk/WebKit/gtk/ChangeLog        2009-07-13 10:11:13 UTC (rev 45802)
</span><span class="lines">@@ -1,5 +1,23 @@
</span><span class="cx"> 2009-07-13  Jan Michael Alonzo  &lt;jmalonzo@webkit.org&gt;
</span><span class="cx"> 
</span><ins>+        &lt;https://bugs.webkit.org/show_bug.cgi?id=27171&gt; [Gtk]
+        REGRESSION (r45440): fails at fast/events/frame-programmatic-focus.html
+
+        Reviewed by Gustavo Noronha.
+
+        focus-in and focus-out events only get triggered when there's user
+        interaction, hence setFocused(bool) never gets called when
+        focusEvent is triggered when running the layout tests. The
+        solution seems to be to implement grab-focus too so we can call
+        setFocused(bool) when a widget has focus.
+
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_grab_focus):
+        (webkit_web_view_focus_in_event):
+        (webkit_web_view_class_init):
+
+2009-07-13  Jan Michael Alonzo  &lt;jmalonzo@webkit.org&gt;
+
</ins><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=26718 [Gtk] Add support for javascript windows for DRT
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Gustavo Noronha and Xan Lopez.
</span></span></pre></div>
<a id="trunkWebKitgtkwebkitwebkitwebviewcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/gtk/webkit/webkitwebview.cpp (45801 => 45802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/gtk/webkit/webkitwebview.cpp        2009-07-13 09:57:52 UTC (rev 45801)
+++ trunk/WebKit/gtk/webkit/webkitwebview.cpp        2009-07-13 10:11:13 UTC (rev 45802)
</span><span class="lines">@@ -560,6 +560,17 @@
</span><span class="cx">     frame-&gt;view()-&gt;adjustViewSize();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static void webkit_web_view_grab_focus(GtkWidget* widget)
+{
+    if (GTK_WIDGET_IS_SENSITIVE(widget)) {
+        WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
+        FocusController* focusController = core(webView)-&gt;focusController();
+        core(webView)-&gt;focusController()-&gt;setFocused(true);
+    }
+
+    return GTK_WIDGET_CLASS(webkit_web_view_parent_class)-&gt;grab_focus(widget);
+}
+
</ins><span class="cx"> static gboolean webkit_web_view_focus_in_event(GtkWidget* widget, GdkEventFocus* event)
</span><span class="cx"> {
</span><span class="cx">     // TODO: Improve focus handling as suggested in
</span><span class="lines">@@ -567,10 +578,10 @@
</span><span class="cx">     GtkWidget* toplevel = gtk_widget_get_toplevel(widget);
</span><span class="cx">     if (GTK_WIDGET_TOPLEVEL(toplevel) &amp;&amp; gtk_window_has_toplevel_focus(GTK_WINDOW(toplevel))) {
</span><span class="cx">         WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
</span><ins>+        FocusController* focusController = core(webView)-&gt;focusController();
</ins><span class="cx"> 
</span><del>-        Frame* frame = core(webView)-&gt;mainFrame();
-        core(webView)-&gt;focusController()-&gt;setActive(frame);
-        core(webView)-&gt;focusController()-&gt;setFocused(true);
</del><ins>+        focusController-&gt;setActive(core(webView)-&gt;mainFrame());
+        focusController-&gt;setFocused(true);
</ins><span class="cx">     }
</span><span class="cx">     return GTK_WIDGET_CLASS(webkit_web_view_parent_class)-&gt;focus_in_event(widget, event);
</span><span class="cx"> }
</span><span class="lines">@@ -1776,6 +1787,7 @@
</span><span class="cx">     widgetClass-&gt;scroll_event = webkit_web_view_scroll_event;
</span><span class="cx">     widgetClass-&gt;size_allocate = webkit_web_view_size_allocate;
</span><span class="cx">     widgetClass-&gt;popup_menu = webkit_web_view_popup_menu_handler;
</span><ins>+    widgetClass-&gt;grab_focus = webkit_web_view_grab_focus;
</ins><span class="cx">     widgetClass-&gt;focus_in_event = webkit_web_view_focus_in_event;
</span><span class="cx">     widgetClass-&gt;focus_out_event = webkit_web_view_focus_out_event;
</span><span class="cx">     widgetClass-&gt;get_accessible = webkit_web_view_get_accessible;
</span></span></pre>
</div>
</div>

</body>
</html>