Source/WebCore: REGRESSION (r115654): Sometimes does not replace content for multipar...
authorjaphet@chromium.org <japhet@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Jul 2012 23:54:03 +0000 (23:54 +0000)
committerjaphet@chromium.org <japhet@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Jul 2012 23:54:03 +0000 (23:54 +0000)
commit024d0ab3d22dd8cf3a399ade269ae1915a0cfa16
treeeb59f6b31ebc2a216f45798f80288eb62567da8f
parent26f9f70ed5a1d085167067751aa6f3a665d64acd
Source/WebCore: REGRESSION (r115654): Sometimes does not replace content for multipart/x-mixed-replace
https://bugs.webkit.org/show_bug.cgi?id=88436

Reviewed by Brady Eidson.

Test: http/tests/multipart/multipart-replace-non-html-content.php

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData): We should only send receivedFirstData() once per main resource load,
    rather than multiple times in a multipart load.
(WebCore::DocumentLoader::setupForReplaceByMIMEType): m_gotFirstByte isn't set to true until data is
    actually committed, and multipart data is often not committed until the part is finished. Check
    whether the SharedBuffer is non-null instead.
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::resetInternalsObject): The JSInternals object my have already been cleared if the window shell
    was cleared as part of creation of a new Document. Check it before using it.

LayoutTests: Test for https://bugs.webkit.org/show_bug.cgi?id=88436.

Reviewed by Brady Eidson.

* http/tests/multipart/multipart-replace-non-html-content-expected.txt: Added.
* http/tests/multipart/multipart-replace-non-html-content.php: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@121813 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/multipart/multipart-replace-non-html-content-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/multipart/multipart-replace-non-html-content.php [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/testing/js/WebCoreTestSupport.cpp