Title: [96856] trunk
Revision
96856
Author
t...@chromium.org
Date
2011-10-06 14:06:40 -0700 (Thu, 06 Oct 2011)

Log Message

last frame of a multipart response is not displayed
https://bugs.webkit.org/show_bug.cgi?id=69449

Reviewed by Adam Barth.

Source/WebCore:

Test: http/tests/multipart/load-last-non-html-frame.php

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::maybeFinishLoadingMultipartContent): for non-progressive load pages, commit the load so the
    last frame will be displayed.
* loader/DocumentLoader.h:
* loader/MainResourceLoader.cpp:
(WebCore::MainResourceLoader::didFinishLoading):

LayoutTests:

* http/tests/multipart/load-last-non-html-frame-expected.txt: Added.
* http/tests/multipart/load-last-non-html-frame.php: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (96855 => 96856)


--- trunk/LayoutTests/ChangeLog	2011-10-06 20:59:47 UTC (rev 96855)
+++ trunk/LayoutTests/ChangeLog	2011-10-06 21:06:40 UTC (rev 96856)
@@ -1,3 +1,13 @@
+2011-10-06  Tony Chang  <t...@chromium.org>
+
+        last frame of a multipart response is not displayed
+        https://bugs.webkit.org/show_bug.cgi?id=69449
+
+        Reviewed by Adam Barth.
+
+        * http/tests/multipart/load-last-non-html-frame-expected.txt: Added.
+        * http/tests/multipart/load-last-non-html-frame.php: Added.
+
 2011-10-06  James Simonsen  <simon...@chromium.org>
 
         [Chromium] Rebaseline test missed in r96814.

Added: trunk/LayoutTests/http/tests/multipart/load-last-non-html-frame-expected.txt (0 => 96856)


--- trunk/LayoutTests/http/tests/multipart/load-last-non-html-frame-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/multipart/load-last-non-html-frame-expected.txt	2011-10-06 21:06:40 UTC (rev 96856)
@@ -0,0 +1,3 @@
+This test passes if the last multipart frame is displayed.
+PASS
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

Added: trunk/LayoutTests/http/tests/multipart/load-last-non-html-frame.php (0 => 96856)


--- trunk/LayoutTests/http/tests/multipart/load-last-non-html-frame.php	                        (rev 0)
+++ trunk/LayoutTests/http/tests/multipart/load-last-non-html-frame.php	2011-10-06 21:06:40 UTC (rev 96856)
@@ -0,0 +1,23 @@
+<?php
+header('Content-type: multipart/x-mixed-replace;boundary=asdf');
+?>--asdf
+Content-type: text/plain
+
+This test passes if the last multipart frame is displayed.
+FAIL
+
+<?php
+# Add some padding because CFNetwork merges small multipart segments together.
+echo str_pad('', 5000);
+?>
+--asdf
+Content-type: text/plain
+
+This test passes if the last multipart frame is displayed.
+PASS
+<?php
+# Add some padding because CFNetwork merges small multipart segments together.
+echo str_pad('', 5000);
+?>
+
+--asdf--

Modified: trunk/Source/WebCore/ChangeLog (96855 => 96856)


--- trunk/Source/WebCore/ChangeLog	2011-10-06 20:59:47 UTC (rev 96855)
+++ trunk/Source/WebCore/ChangeLog	2011-10-06 21:06:40 UTC (rev 96856)
@@ -1,3 +1,19 @@
+2011-10-06  Tony Chang  <t...@chromium.org>
+
+        last frame of a multipart response is not displayed
+        https://bugs.webkit.org/show_bug.cgi?id=69449
+
+        Reviewed by Adam Barth.
+
+        Test: http/tests/multipart/load-last-non-html-frame.php
+
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::maybeFinishLoadingMultipartContent): for non-progressive load pages, commit the load so the
+            last frame will be displayed.
+        * loader/DocumentLoader.h:
+        * loader/MainResourceLoader.cpp:
+        (WebCore::MainResourceLoader::didFinishLoading):
+
 2011-10-06  Gavin Peters  <gav...@chromium.org>
 
         conditionalize m_cachedScript stacks to just Chromium port

Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (96855 => 96856)


--- trunk/Source/WebCore/loader/DocumentLoader.cpp	2011-10-06 20:59:47 UTC (rev 96855)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp	2011-10-06 21:06:40 UTC (rev 96856)
@@ -847,6 +847,12 @@
     }
 }
 
+void DocumentLoader::maybeFinishLoadingMultipartContent()
+{
+    if (!doesProgressiveLoad(m_response.mimeType()))
+        setupForReplaceByMIMEType(m_response.mimeType());
+}
+
 void DocumentLoader::iconLoadDecisionAvailable()
 {
     if (m_frame)

Modified: trunk/Source/WebCore/loader/DocumentLoader.h (96855 => 96856)


--- trunk/Source/WebCore/loader/DocumentLoader.h	2011-10-06 20:59:47 UTC (rev 96855)
+++ trunk/Source/WebCore/loader/DocumentLoader.h	2011-10-06 21:06:40 UTC (rev 96856)
@@ -223,6 +223,8 @@
 
         void transferLoadingResourcesFromPage(Page*);
 
+        void maybeFinishLoadingMultipartContent();
+
         void setDeferMainResourceDataLoad(bool defer) { m_deferMainResourceDataLoad = defer; }
         bool deferMainResourceDataLoad() const { return m_deferMainResourceDataLoad; }
         

Modified: trunk/Source/WebCore/loader/MainResourceLoader.cpp (96855 => 96856)


--- trunk/Source/WebCore/loader/MainResourceLoader.cpp	2011-10-06 20:59:47 UTC (rev 96855)
+++ trunk/Source/WebCore/loader/MainResourceLoader.cpp	2011-10-06 21:06:40 UTC (rev 96856)
@@ -480,6 +480,9 @@
     RefPtr<MainResourceLoader> protect(this);
     RefPtr<DocumentLoader> dl = documentLoader();
 
+    if (m_loadingMultipartContent)
+        dl->maybeFinishLoadingMultipartContent();
+
     ASSERT(!documentLoader()->timing()->responseEnd);
     documentLoader()->timing()->responseEnd = finishTime ? finishTime : (m_timeOfLastDataReceived ? m_timeOfLastDataReceived : currentTime());
     frameLoader()->finishedLoading();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to