Source/WebCore: REGRESSION (r115654): Sometimes does not replace content for multipar...
authorjaphet@chromium.org <japhet@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Jul 2012 17:19:13 +0000 (17:19 +0000)
committerjaphet@chromium.org <japhet@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Jul 2012 17:19:13 +0000 (17:19 +0000)
commitb3a7465a920bbdedc7b9376c4696fbadc978eff5
tree0a0e86e015ad3fd9f753ca3333a820465dd73f41
parent5d9d1238a57450fef3a79b4951ed50a5a2657599
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: http://svn.webkit.org/repository/webkit/trunk@121912 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