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

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

<h3>Log Message</h3>
<pre>Fix the handling of the response header for data urls. Make sure we always pass absolute URLs to WebKit from both DRT and QtLauncher.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebKitQtApiqwebnetworkinterfacecpp">trunk/WebKitQt/Api/qwebnetworkinterface.cpp</a></li>
<li><a href="#trunkWebKitQtChangeLog">trunk/WebKitQt/ChangeLog</a></li>
<li><a href="#trunkWebKitQtQtLaunchermaincpp">trunk/WebKitQt/QtLauncher/main.cpp</a></li>
<li><a href="#trunkWebKitToolsChangeLog">trunk/WebKitTools/ChangeLog</a></li>
<li><a href="#trunkWebKitToolsDumpRenderTreeDumpRenderTreeqtprojDumpRenderTreecpp">trunk/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebKitQtApiqwebnetworkinterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKitQt/Api/qwebnetworkinterface.cpp (25917 => 25918)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitQt/Api/qwebnetworkinterface.cpp        2007-10-02 10:39:45 UTC (rev 25917)
+++ trunk/WebKitQt/Api/qwebnetworkinterface.cpp        2007-10-02 11:29:43 UTC (rev 25918)
</span><span class="lines">@@ -2,22 +2,22 @@
</span><span class="cx">   Copyright (C) 2006 Enrico Ros &lt;enrico.ros@m31engineering.it&gt;
</span><span class="cx">   Copyright (C) 2007 Trolltech ASA
</span><span class="cx">   Copyright (C) 2007 Staikos Computing Services Inc.  &lt;info@staikos.net&gt;
</span><del>-  
</del><ins>+
</ins><span class="cx">   This library is free software; you can redistribute it and/or
</span><span class="cx">   modify it under the terms of the GNU Library General Public
</span><span class="cx">   License as published by the Free Software Foundation; either
</span><span class="cx">   version 2 of the License, or (at your option) any later version.
</span><del>-  
</del><ins>+
</ins><span class="cx">   This library is distributed in the hope that it will be useful,
</span><span class="cx">   but WITHOUT ANY WARRANTY; without even the implied warranty of
</span><span class="cx">   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
</span><span class="cx">   Library General Public License for more details.
</span><del>-  
</del><ins>+
</ins><span class="cx">   You should have received a copy of the GNU Library General Public License
</span><span class="cx">   along with this library; see the file COPYING.LIB.  If not, write to
</span><span class="cx">   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
</span><span class="cx">   Boston, MA 02110-1301, USA.
</span><del>-  
</del><ins>+
</ins><span class="cx">   This class provides all functionality needed for loading images, style sheets and html
</span><span class="cx">   pages from the web. It has a memory cache for these objects.
</span><span class="cx"> */
</span><span class="lines">@@ -482,7 +482,7 @@
</span><span class="cx">                 if (client)
</span><span class="cx">                     client-&gt;willSendRequest(job-&gt;d-&gt;resourceHandle, newRequest, response);
</span><span class="cx">             }
</span><del>-            
</del><ins>+
</ins><span class="cx">             job-&gt;d-&gt;request.httpHeader.setRequest(job-&gt;d-&gt;request.httpHeader.method(),
</span><span class="cx">                                                   newUrl.toString(QUrl::RemoveScheme|QUrl::RemoveAuthority));
</span><span class="cx">             job-&gt;d-&gt;request.setURL(newUrl);
</span><span class="lines">@@ -495,7 +495,7 @@
</span><span class="cx">         client-&gt;didReceiveResponse(job-&gt;d-&gt;resourceHandle, response);
</span><span class="cx">     if (job-&gt;d-&gt;connector)
</span><span class="cx">         emit job-&gt;d-&gt;connector-&gt;started(job);
</span><del>-    
</del><ins>+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void QWebNetworkManager::data(QWebNetworkJob *job, const QByteArray &amp;data)
</span><span class="lines">@@ -517,7 +517,7 @@
</span><span class="cx">         client-&gt;didReceiveData(job-&gt;d-&gt;resourceHandle, data.constData(), data.length(), data.length() /*FixMe*/);
</span><span class="cx">     if (job-&gt;d-&gt;connector)
</span><span class="cx">         emit job-&gt;d-&gt;connector-&gt;data(job, data);
</span><del>-    
</del><ins>+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void QWebNetworkManager::finished(QWebNetworkJob *job, int errorCode)
</span><span class="lines">@@ -539,7 +539,7 @@
</span><span class="cx">         job-&gt;d-&gt;interface-&gt;addJob(job);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    
</del><ins>+
</ins><span class="cx">     if (job-&gt;d-&gt;resourceHandle)
</span><span class="cx">         job-&gt;d-&gt;resourceHandle-&gt;getInternal()-&gt;m_job = 0;
</span><span class="cx"> 
</span><span class="lines">@@ -556,7 +556,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (job-&gt;d-&gt;connector)
</span><span class="cx">         emit job-&gt;d-&gt;connector-&gt;finished(job, errorCode);
</span><del>-    
</del><ins>+
</ins><span class="cx">     DEBUG() &lt;&lt; &quot;receivedFinished done&quot; &lt;&lt; job-&gt;d-&gt;request.url;
</span><span class="cx"> 
</span><span class="cx">     job-&gt;deref();
</span><span class="lines">@@ -597,6 +597,7 @@
</span><span class="cx">     if (!job-&gt;cancelled()) {
</span><span class="cx">         QHttpResponseHeader response;
</span><span class="cx">         response.setStatusLine(statusCode);
</span><ins>+        response.setContentLength(data.length());
</ins><span class="cx">         job-&gt;setResponse(response);
</span><span class="cx">         emit q-&gt;started(job);
</span><span class="cx">         if (!data.isEmpty())
</span><span class="lines">@@ -608,7 +609,7 @@
</span><span class="cx"> void QWebNetworkInterfacePrivate::parseDataUrl(QWebNetworkJob* job)
</span><span class="cx"> {
</span><span class="cx">     QByteArray data = job-&gt;url().toString().toLatin1();
</span><del>-    //qDebug() &lt;&lt; &quot;handling data url:&quot; &lt;&lt; data; 
</del><ins>+    //qDebug() &lt;&lt; &quot;handling data url:&quot; &lt;&lt; data;
</ins><span class="cx"> 
</span><span class="cx">     ASSERT(data.startsWith(&quot;data:&quot;));
</span><span class="cx"> 
</span><span class="lines">@@ -641,7 +642,7 @@
</span><span class="cx">         data = QByteArray::fromBase64(data);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (header.isEmpty()) 
</del><ins>+    if (header.isEmpty())
</ins><span class="cx">         header = &quot;text/plain;charset=US-ASCII&quot;;
</span><span class="cx">     int statusCode = data.isEmpty() ? 404 : 200;
</span><span class="cx">     QHttpResponseHeader response;
</span><span class="lines">@@ -649,7 +650,11 @@
</span><span class="cx">     response.setContentLength(data.size());
</span><span class="cx">     job-&gt;setResponse(response);
</span><span class="cx"> 
</span><del>-    sendFileData(job, statusCode, data);
</del><ins>+    int error = statusCode &gt;= 400 ? 1 : 0;
+    emit q-&gt;started(job);
+    if (!data.isEmpty())
+        emit q-&gt;data(job, data);
+    emit q-&gt;finished(job, error);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /*!
</span><span class="lines">@@ -665,7 +670,7 @@
</span><span class="cx"> 
</span><span class="cx">   QWebNetworkInterface can by default handle the http, https, file and
</span><span class="cx">   data URI protocols.
</span><del>-  
</del><ins>+
</ins><span class="cx"> */
</span><span class="cx"> 
</span><span class="cx"> static bool gRoutineAdded = false;
</span><span class="lines">@@ -872,7 +877,7 @@
</span><span class="cx">     }
</span><span class="cx">     if (!job)
</span><span class="cx">         return;
</span><del>-    
</del><ins>+
</ins><span class="cx">     QHttp *http = connection[c].http;
</span><span class="cx"> 
</span><span class="cx">     connection[c].current = job;
</span><span class="lines">@@ -1016,7 +1021,7 @@
</span><span class="cx">         bool continueAnyway = false;
</span><span class="cx">         emit req-&gt;networkInterface()-&gt;sslErrors(req-&gt;frame(), req-&gt;url(), errors, &amp;continueAnyway);
</span><span class="cx"> #ifndef QT_NO_OPENSSL
</span><del>-        if (continueAnyway) 
</del><ins>+        if (continueAnyway)
</ins><span class="cx">             connection[c].http-&gt;ignoreSslErrors();
</span><span class="cx"> #endif
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkWebKitQtChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKitQt/ChangeLog (25917 => 25918)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitQt/ChangeLog        2007-10-02 10:39:45 UTC (rev 25917)
+++ trunk/WebKitQt/ChangeLog        2007-10-02 11:29:43 UTC (rev 25918)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2007-10-02  Lars Knoll  &lt;lars@trolltech.com&gt;
+
+        Reviewed by bdash.
+
+        Fix the handling of the response header for data urls. Make sure we always pass absolute URLs to WebKit from both DRT and QtLauncher.
+
+        * Api/qwebnetworkinterface.cpp:
+        (QWebNetworkManager::started):
+        (QWebNetworkManager::data):
+        (QWebNetworkManager::finished):
+        (QWebNetworkInterfacePrivate::sendFileData):
+        (QWebNetworkInterfacePrivate::parseDataUrl):
+        (WebCoreHttp::scheduleNextRequest):
+        (WebCoreHttp::onSslErrors):
+        * QtLauncher/main.cpp:
+        (main):
+
</ins><span class="cx"> 2007-10-01  Lars Knoll  &lt;lars@trolltech.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Eric.
</span></span></pre></div>
<a id="trunkWebKitQtQtLaunchermaincpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKitQt/QtLauncher/main.cpp (25917 => 25918)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitQt/QtLauncher/main.cpp        2007-10-02 10:39:45 UTC (rev 25917)
+++ trunk/WebKitQt/QtLauncher/main.cpp        2007-10-02 11:29:43 UTC (rev 25918)
</span><span class="lines">@@ -358,7 +358,10 @@
</span><span class="cx">     if (args.count() &gt; 1)
</span><span class="cx">         url = args.at(1);
</span><span class="cx"> 
</span><del>-    MainWindow window(url);
</del><ins>+    QUrl qurl(url);
+    if (qurl.scheme().isEmpty())
+        qurl = QUrl::fromLocalFile(QFileInfo(url).absoluteFilePath());
+    MainWindow window(qurl);
</ins><span class="cx">     window.show();
</span><span class="cx"> 
</span><span class="cx">     return app.exec();
</span></span></pre></div>
<a id="trunkWebKitToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/ChangeLog (25917 => 25918)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/ChangeLog        2007-10-02 10:39:45 UTC (rev 25917)
+++ trunk/WebKitTools/ChangeLog        2007-10-02 11:29:43 UTC (rev 25918)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2007-10-02  Lars Knoll  &lt;lars@trolltech.com&gt;
+
+        Reviewed by bdash.
+
+        Fix the handling of the response header for data urls. Make sure we always pass absolute URLs to WebKit from both DRT and QtLauncher.
+
+        * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp:
+        (WebCore::DumpRenderTree::readStdin):
+
</ins><span class="cx"> 2007-10-02  Mark Rowe  &lt;mrowe@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Oliver.
</span></span></pre></div>
<a id="trunkWebKitToolsDumpRenderTreeDumpRenderTreeqtprojDumpRenderTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp (25917 => 25918)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp        2007-10-02 10:39:45 UTC (rev 25917)
+++ trunk/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp        2007-10-02 11:29:43 UTC (rev 25918)
</span><span class="lines">@@ -159,7 +159,8 @@
</span><span class="cx">     //fprintf(stderr, &quot;\n    opening %s\n&quot;, line.constData());
</span><span class="cx">     if (line.isEmpty())
</span><span class="cx">         quit();
</span><del>-    open(QUrl(QString(line)));
</del><ins>+    QFileInfo fi(line);
+    open(QUrl::fromLocalFile(fi.absoluteFilePath()));
</ins><span class="cx">     fflush(stdout);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>