* We need to set a != 0 status code for the fast/loader/xmlhttprequest-missing-file...
authorhausmann <hausmann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Oct 2007 13:41:42 +0000 (13:41 +0000)
committerhausmann <hausmann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Oct 2007 13:41:42 +0000 (13:41 +0000)
* libxml2 has the semantic that when writing an empty string and finishing it will report an error. For QXmlStreamReader this is valid.
* This is causing some regressions...

Signed-off-by: Simon Hausmann <hausmann@kde.org>
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27045 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/qt/Skipped
WebCore/ChangeLog
WebCore/dom/XMLTokenizer.cpp
WebCore/dom/XMLTokenizer.h
WebKit/qt/Api/qwebnetworkinterface.cpp
WebKit/qt/ChangeLog

index 9652be61d1b92971d2797e241ccee0342e5e4e87..4ae81982e4a22b069b9433c84b1a647bb63a99ab 100644 (file)
@@ -1,3 +1,14 @@
+2007-10-25  Holger Freyther  <zecke@selfish.org>
+
+        Reviewed by Simon Hausmann <hausmann@kde.org>.
+
+        * We need to set a != 0 status code for the fast/loader/xmlhttprequest-missing-file-exception.html
+        * libxml2 has the semantic that when writing an empty string and finishing it will report an error. For QXmlStreamReader this is valid.
+        * This is causing some regressions...
+        
+
+        * platform/qt/Skipped:
+
 2007-10-25  Holger Freyther  <zecke@selfish.org>
 
         Reviewed by Simon Hausmann <hausmann@kde.org>.
index 983c0989f4afff138a106ca7e271bf1bed1f9d82..aefaa28e51649043ebc3a1db60bf7e8a7c832c0d 100644 (file)
@@ -92,7 +92,6 @@ fast/forms/select-double-onchange.html
 fast/frames/frame-src-attribute.html
 fast/frames/removal-before-attach-crash.html
 fast/loader/user-style-sheet-resource-load-callbacks.html
-fast/loader/xmlhttprequest-missing-file-exception.html
 fast/overflow/003.xml
 fast/text/zero-width-characters.html
 fast/text/international/bidi-menulist.html
index 87d59ca326eb9ff27491791c9b21cb6a56425545..20bf814419e4917eeb843985951faff4133c1daf 100644 (file)
@@ -1,3 +1,18 @@
+2007-10-25  Holger Freyther  <zecke@selfish.org>
+
+        Reviewed by Simon Hausmann <hausmann@kde.org>.
+
+        * We need to set a != 0 status code for the fast/loader/xmlhttprequest-missing-file-exception.html
+        * libxml2 has the semantic that when writing an empty string and finishing it will report an error. For QXmlStreamReader this is valid.
+        * This is causing some regressions...
+        
+
+        * dom/XMLTokenizer.cpp:
+        (WebCore::XMLTokenizer::XMLTokenizer):
+        (WebCore::XMLTokenizer::write):
+        (WebCore::XMLTokenizer::end):
+        * dom/XMLTokenizer.h:
+
 2007-10-25  Holger Freyther  <zecke@selfish.org>
 
         Reviewed by Simon Hausmann <hausmann@kde.org>.
index 7ac0f8a45279297c6c8ecbcd047f79312054a26c..73f698958d0e8b8659e89c5f4a7f7a6876be2b4c 100644 (file)
@@ -453,7 +453,9 @@ static xmlParserCtxtPtr createStringParser(xmlSAXHandlerPtr handlers, void* user
 XMLTokenizer::XMLTokenizer(Document* _doc, FrameView* _view)
     : m_doc(_doc)
     , m_view(_view)
-#ifndef USE_QXMLSTREAM
+#ifdef USE_QXMLSTREAM
+    , m_wroteText(false)
+#else
     , m_context(0)
 #endif
     , m_currentNode(_doc)
@@ -586,6 +588,7 @@ bool XMLTokenizer::write(const SegmentedString& s, bool /*appendData*/)
         xmlParseChunk(m_context, reinterpret_cast<const char*>(parseString.characters()), sizeof(UChar) * parseString.length(), 0);
     }
 #else
+    m_wroteText = true;
     QString data(parseString);
     if (!data.isEmpty()) {
         if (!m_sawFirstElement) {
@@ -1230,7 +1233,7 @@ void XMLTokenizer::end()
         m_context = 0;
     }
 #else
-    if (m_stream.error() == QXmlStreamReader::PrematureEndOfDocumentError) {
+    if (m_stream.error() == QXmlStreamReader::PrematureEndOfDocumentError || (m_wroteText && !m_sawFirstElement)) {
         handleError(fatal, qPrintable(m_stream.errorString()), lineNumber(),
                     columnNumber());
     }
index e749d96b1539d10d677a67631ce071877645df58..dbf9b027cf1962f8342d52da019b350859c9bd98 100644 (file)
@@ -133,6 +133,7 @@ namespace WebCore {
 
 #ifdef USE_QXMLSTREAM
         QXmlStreamReader m_stream;
+        bool m_wroteText;
 #else
         xmlParserCtxtPtr m_context;
 #endif
index 3c9973714bb03bef600bc37bde04031afbc614c6..9644cb898771b4f696285512834c510f4a5c3e19 100644 (file)
@@ -544,6 +544,8 @@ void QWebNetworkManager::started(QWebNetworkJob *job)
     int statusCode = job->d->response.statusCode();
     if (job->url().scheme() != QLatin1String("file"))
         response.setHTTPStatusCode(statusCode);
+    else if (statusCode == 404)
+        response.setHTTPStatusCode(statusCode);
 
     /* Fill in the other fields */
 
@@ -989,6 +991,13 @@ void QWebNetworkInterface::addJob(QWebNetworkJob *job)
             statusCode = 404;
         }
     }
+
+    if (statusCode == 404) {
+        QHttpResponseHeader response;
+        response.setStatusLine(404);
+        job->setResponse(response);
+    }
+
     d->sendFileData(job, statusCode, data);
 }
 
index d35d8e3fca89d57689b9ae26c4389655f9a202cf..2c4e378e6d09ab982546412c1acb3d93e130457e 100644 (file)
@@ -1,3 +1,16 @@
+2007-10-25  Holger Freyther  <zecke@selfish.org>
+
+        Reviewed by Simon Hausmann <hausmann@kde.org>.
+
+        * We need to set a != 0 status code for the fast/loader/xmlhttprequest-missing-file-exception.html
+        * libxml2 has the semantic that when writing an empty string and finishing it will report an error. For QXmlStreamReader this is valid.
+        * This is causing some regressions...
+        
+
+        * Api/qwebnetworkinterface.cpp:
+        (QWebNetworkManager::started):
+        (QWebNetworkInterface::addJob):
+
 2007-10-25  Holger Freyther  <zecke@selfish.org>
 
         Reviewed by Simon Hausmann <hausmann@kde.org>.