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

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/25921">25921</a></dd>
<dt>Author</dt> <dd>lars</dd>
<dt>Date</dt> <dd>2007-10-02 06:02:43 -0700 (Tue, 02 Oct 2007)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add API to retrieve the frame name from QWebFrame.
Implement support for DRT::dumpChildrenAsText.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebKitQtApiqwebframecpp">trunk/WebKitQt/Api/qwebframe.cpp</a></li>
<li><a href="#trunkWebKitQtApiqwebframeh">trunk/WebKitQt/Api/qwebframe.h</a></li>
<li><a href="#trunkWebKitQtChangeLog">trunk/WebKitQt/ChangeLog</a></li>
<li><a href="#trunkWebKitToolsChangeLog">trunk/WebKitTools/ChangeLog</a></li>
<li><a href="#trunkWebKitToolsDumpRenderTreeDumpRenderTreeqtprojDumpRenderTreecpp">trunk/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp</a></li>
<li><a href="#trunkWebKitToolsDumpRenderTreeDumpRenderTreeqtprojDumpRenderTreeh">trunk/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.h</a></li>
<li><a href="#trunkWebKitToolsDumpRenderTreeDumpRenderTreeqtprojjsobjectscpp">trunk/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/jsobjects.cpp</a></li>
<li><a href="#trunkWebKitToolsDumpRenderTreeDumpRenderTreeqtprojjsobjectsh">trunk/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/jsobjects.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebKitQtApiqwebframecpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKitQt/Api/qwebframe.cpp (25920 => 25921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitQt/Api/qwebframe.cpp        2007-10-02 12:56:11 UTC (rev 25920)
+++ trunk/WebKitQt/Api/qwebframe.cpp        2007-10-02 13:02:43 UTC (rev 25921)
</span><span class="lines">@@ -181,6 +181,11 @@
</span><span class="cx">     else return QString();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+QString QWebFrame::name() const
+{
+    return d-&gt;frame-&gt;tree()-&gt;name();
+}
+
</ins><span class="cx"> QWebPage * QWebFrame::page() const
</span><span class="cx"> {
</span><span class="cx">     return d-&gt;page;
</span></span></pre></div>
<a id="trunkWebKitQtApiqwebframeh"></a>
<div class="modfile"><h4>Modified: trunk/WebKitQt/Api/qwebframe.h (25920 => 25921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitQt/Api/qwebframe.h        2007-10-02 12:56:11 UTC (rev 25920)
+++ trunk/WebKitQt/Api/qwebframe.h        2007-10-02 13:02:43 UTC (rev 25921)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx">     QString renderTreeDump() const;
</span><span class="cx">     QString selectedText() const;
</span><span class="cx">     QString title() const;
</span><ins>+    QString name() const;
</ins><span class="cx"> 
</span><span class="cx">     QList&lt;QWebFrame*&gt; childFrames() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebKitQtChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKitQt/ChangeLog (25920 => 25921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitQt/ChangeLog        2007-10-02 12:56:11 UTC (rev 25920)
+++ trunk/WebKitQt/ChangeLog        2007-10-02 13:02:43 UTC (rev 25921)
</span><span class="lines">@@ -2,6 +2,17 @@
</span><span class="cx"> 
</span><span class="cx">         Reviewed by bdash.
</span><span class="cx"> 
</span><ins>+        Add API to retrieve the frame name from QWebFrame.
+        Implement support for DRT::dumpChildrenAsText.
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::name):
+        * Api/qwebframe.h:
+
+2007-10-02  Lars Knoll  &lt;lars@trolltech.com&gt;
+
+        Reviewed by bdash.
+
</ins><span class="cx">         Fix the handling of the response header for data urls. Make sure we always pass absolute URLs to WebKit from both DRT and QtLauncher.
</span><span class="cx"> 
</span><span class="cx">         * Api/qwebnetworkinterface.cpp:
</span></span></pre></div>
<a id="trunkWebKitToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/ChangeLog (25920 => 25921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/ChangeLog        2007-10-02 12:56:11 UTC (rev 25920)
+++ trunk/WebKitTools/ChangeLog        2007-10-02 13:02:43 UTC (rev 25921)
</span><span class="lines">@@ -2,6 +2,22 @@
</span><span class="cx"> 
</span><span class="cx">         Reviewed by bdash.
</span><span class="cx"> 
</span><ins>+        Add API to retrieve the frame name from QWebFrame.
+        Implement support for DRT::dumpChildrenAsText.
+
+        * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp:
+        (WebCore::DumpRenderTree::dumpFramesAsText):
+        (WebCore::DumpRenderTree::dump):
+        * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.h:
+        * DumpRenderTree/DumpRenderTree.qtproj/jsobjects.cpp:
+        (LayoutTestController::LayoutTestController):
+        (LayoutTestController::reset):
+        * DumpRenderTree/DumpRenderTree.qtproj/jsobjects.h:
+
+2007-10-02  Lars Knoll  &lt;lars@trolltech.com&gt;
+
+        Reviewed by bdash.
+
</ins><span class="cx">         Fix the handling of the response header for data urls. Make sure we always pass absolute URLs to WebKit from both DRT and QtLauncher.
</span><span class="cx"> 
</span><span class="cx">         * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp:
</span></span></pre></div>
<a id="trunkWebKitToolsDumpRenderTreeDumpRenderTreeqtprojDumpRenderTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp (25920 => 25921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp        2007-10-02 12:56:11 UTC (rev 25920)
+++ trunk/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp        2007-10-02 13:02:43 UTC (rev 25921)
</span><span class="lines">@@ -177,6 +177,32 @@
</span><span class="cx">     frame-&gt;addToJSWindowObject(&quot;eventSender&quot;, m_eventSender);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+
+QString DumpRenderTree::dumpFramesAsText(QWebFrame* frame)
+{
+    if (!frame)
+        return QString();
+
+    QString result;
+    QWebFrame *parent = qobject_cast&lt;QWebFrame *&gt;(frame-&gt;parent());
+    if (parent) {
+        result.append(QLatin1String(&quot;\n--------\nFrame: '&quot;));
+        result.append(frame-&gt;name());
+        result.append(QLatin1String(&quot;'\n--------\n&quot;));
+    }
+
+    result.append(frame-&gt;innerText());
+    result.append(QLatin1String(&quot;\n&quot;));
+
+    if (m_controller-&gt;shouldDumpChildrenAsText()) {
+        QList&lt;QWebFrame *&gt; children = frame-&gt;childFrames();
+        for (int i = 0; i &lt; children.size(); ++i)
+            result += dumpFramesAsText(children.at(i));
+    }
+
+    return result;
+}
+
</ins><span class="cx"> void DumpRenderTree::dump()
</span><span class="cx"> {
</span><span class="cx">     QWebFrame *frame = m_page-&gt;mainFrame();
</span><span class="lines">@@ -191,8 +217,7 @@
</span><span class="cx">     // Dump render text...
</span><span class="cx">     QString renderDump;
</span><span class="cx">     if (m_controller-&gt;shouldDumpAsText()) {
</span><del>-        renderDump = frame-&gt;innerText();
-        renderDump.append(&quot;\n&quot;);
</del><ins>+        renderDump = dumpFramesAsText(frame);
</ins><span class="cx">     } else {
</span><span class="cx">         renderDump = frame-&gt;renderTreeDump();
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkWebKitToolsDumpRenderTreeDumpRenderTreeqtprojDumpRenderTreeh"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.h (25920 => 25921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.h        2007-10-02 12:56:11 UTC (rev 25920)
+++ trunk/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.h        2007-10-02 13:02:43 UTC (rev 25921)
</span><span class="lines">@@ -6,13 +6,13 @@
</span><span class="cx">  * are met:
</span><span class="cx">  *
</span><span class="cx">  * 1.  Redistributions of source code must retain the above copyright
</span><del>- *     notice, this list of conditions and the following disclaimer. 
</del><ins>+ *     notice, this list of conditions and the following disclaimer.
</ins><span class="cx">  * 2.  Redistributions in binary form must reproduce the above copyright
</span><span class="cx">  *     notice, this list of conditions and the following disclaimer in the
</span><del>- *     documentation and/or other materials provided with the distribution. 
</del><ins>+ *     documentation and/or other materials provided with the distribution.
</ins><span class="cx">  * 3.  Neither the name of Apple Computer, Inc. (&quot;Apple&quot;) nor the names of
</span><span class="cx">  *     its contributors may be used to endorse or promote products derived
</span><del>- *     from this software without specific prior written permission. 
</del><ins>+ *     from this software without specific prior written permission.
</ins><span class="cx">  *
</span><span class="cx">  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
</span><span class="cx">  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
</span><span class="lines">@@ -71,6 +71,7 @@
</span><span class="cx">     void quit();
</span><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    QString dumpFramesAsText(QWebFrame* frame);
</ins><span class="cx">     LayoutTestController *m_controller;
</span><span class="cx"> 
</span><span class="cx">     QWebPage *m_page;
</span></span></pre></div>
<a id="trunkWebKitToolsDumpRenderTreeDumpRenderTreeqtprojjsobjectscpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/jsobjects.cpp (25920 => 25921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/jsobjects.cpp        2007-10-02 12:56:11 UTC (rev 25920)
+++ trunk/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/jsobjects.cpp        2007-10-02 13:02:43 UTC (rev 25921)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx"> {
</span><span class="cx">     m_isLoading = true;
</span><span class="cx">     m_textDump = false;
</span><ins>+    m_dumpChildrenAsText = false;
</ins><span class="cx">     m_waitForDone = false;
</span><span class="cx">     m_timeoutTimer = 0;
</span><span class="cx">     m_topLoadingFrame = 0;
</span><span class="lines">@@ -63,6 +64,7 @@
</span><span class="cx"> {
</span><span class="cx">     m_isLoading = true;
</span><span class="cx">     m_textDump = false;
</span><ins>+    m_dumpChildrenAsText = false;
</ins><span class="cx">     m_waitForDone = false;
</span><span class="cx">     if (m_timeoutTimer) {
</span><span class="cx">         killTimer(m_timeoutTimer);
</span></span></pre></div>
<a id="trunkWebKitToolsDumpRenderTreeDumpRenderTreeqtprojjsobjectsh"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/jsobjects.h (25920 => 25921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/jsobjects.h        2007-10-02 12:56:11 UTC (rev 25920)
+++ trunk/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/jsobjects.h        2007-10-02 13:02:43 UTC (rev 25921)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx">     void setLoading(bool loading) { m_isLoading = loading; }
</span><span class="cx"> 
</span><span class="cx">     bool shouldDumpAsText() const { return m_textDump; }
</span><ins>+    bool shouldDumpChildrenAsText() const { return m_dumpChildrenAsText; }
</ins><span class="cx">     bool shouldWaitUntilDone() const { return m_waitForDone; }
</span><span class="cx"> 
</span><span class="cx">     void reset();
</span><span class="lines">@@ -57,6 +58,7 @@
</span><span class="cx"> public slots:
</span><span class="cx">     void maybeDump(bool ok);
</span><span class="cx">     void dumpAsText() { m_textDump = true; }
</span><ins>+    void dumpChildFramesAsText() { m_dumpChildrenAsText = true; }
</ins><span class="cx">     void waitUntilDone();
</span><span class="cx">     void notifyDone();
</span><span class="cx">     void dumpEditingCallbacks();
</span><span class="lines">@@ -66,6 +68,7 @@
</span><span class="cx"> private:
</span><span class="cx">     bool m_isLoading;
</span><span class="cx">     bool m_textDump;
</span><ins>+    bool m_dumpChildrenAsText;
</ins><span class="cx">     bool m_waitForDone;
</span><span class="cx">     int m_timeoutTimer;
</span><span class="cx">     QWebFrame *m_topLoadingFrame;
</span></span></pre>
</div>
</div>

</body>
</html>