Changeset 121912 in webkit


Ignore:
Timestamp:
Jul 5, 2012 10:19:13 AM (12 years ago)
Author:
Nate Chapin
Message:

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.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r121909 r121912  
     12012-07-05  Nate Chapin  <japhet@chromium.org>
     2
     3        Test for https://bugs.webkit.org/show_bug.cgi?id=88436.
     4
     5        Reviewed by Brady Eidson.
     6
     7        * http/tests/multipart/multipart-replace-non-html-content-expected.txt: Added.
     8        * http/tests/multipart/multipart-replace-non-html-content.php: Added.
     9
    1102012-07-05  Vincent Scheib  <scheib@chromium.org>
    211
  • trunk/Source/WebCore/ChangeLog

    r121911 r121912  
     12012-07-05  Nate Chapin  <japhet@chromium.org>
     2
     3        REGRESSION (r115654): Sometimes does not replace content for multipart/x-mixed-replace
     4        https://bugs.webkit.org/show_bug.cgi?id=88436
     5
     6        Reviewed by Brady Eidson.
     7
     8        Test: http/tests/multipart/multipart-replace-non-html-content.php
     9
     10        * loader/DocumentLoader.cpp:
     11        (WebCore::DocumentLoader::commitData): We should only send receivedFirstData() once per main resource load,
     12            rather than multiple times in a multipart load.
     13        (WebCore::DocumentLoader::setupForReplaceByMIMEType): m_gotFirstByte isn't set to true until data is
     14            actually committed, and multipart data is often not committed until the part is finished. Check
     15            whether the SharedBuffer is non-null instead.
     16        * testing/js/WebCoreTestSupport.cpp:
     17        (WebCoreTestSupport::resetInternalsObject): The JSInternals object my have already been cleared if the window shell
     18            was cleared as part of creation of a new Document. Check it before using it.
     19
    1202012-07-05  Pavel Feldman  <pfeldman@chromium.org>
    221
  • trunk/Source/WebCore/loader/DocumentLoader.cpp

    r121836 r121912  
    336336#endif
    337337
    338         frameLoader()->receivedFirstData();
     338        if (!frameLoader()->isReplacing())
     339            frameLoader()->receivedFirstData();
    339340
    340341        bool userChosen = true;
     
    367368void DocumentLoader::setupForReplaceByMIMEType(const String& newMIMEType)
    368369{
    369     if (!m_gotFirstByte)
     370    if (!mainResourceData())
    370371        return;
    371372   
  • trunk/Source/WebCore/testing/js/WebCoreTestSupport.cpp

    r121836 r121912  
    5353    JSLockHolder lock(exec);
    5454    JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject());
    55     Internals * internals = toInternals(globalObject->getDirect(exec->globalData(), Identifier(exec, Internals::internalsId)));
    56     if (internals) {
     55    JSValue internalsJS = globalObject->getDirect(exec->globalData(), Identifier(exec, Internals::internalsId));
     56    if (internalsJS.isNull() || internalsJS.isEmpty())
     57        return;
     58    if (Internals* internals = toInternals(internalsJS)) {
    5759        ScriptExecutionContext* scriptContext = globalObject->scriptExecutionContext();
    5860        if (scriptContext->isDocument())
Note: See TracChangeset for help on using the changeset viewer.