Changeset 69432 in webkit


Ignore:
Timestamp:
Oct 8, 2010 5:01:57 PM (14 years ago)
Author:
mihaip@chromium.org
Message:

2010-10-08 Mihai Parparita <mihaip@chromium.org>

Reviewed by Adam Barth.

popstate events are lost when network connection is in progress
https://bugs.webkit.org/show_bug.cgi?id=42940

Add test case where we have an image request that never finishes while
using pushState and history.back().

  • http/tests/history/popstate-fires-with-pending-requests-expected.txt: Added.
  • http/tests/history/popstate-fires-with-pending-requests.html: Added.
  • http/tests/history/resources/slow-image.php: Added.

2010-10-08 Mihai Parparita <mihaip@chromium.org>

Reviewed by Adam Barth.

popstate events are lost when network connection is in progress
https://bugs.webkit.org/show_bug.cgi?id=42940

Instead of checking FrameLoader::isComplete() (which isn't true if the
document's resource loader has requests outstanding), check that the
document's readyState is complete, as the spec says.

Test: http/tests/history/popstate-fires-with-pending-requests.html

  • dom/Document.cpp: (WebCore::Document::statePopped):
  • loader/FrameLoader.cpp: (WebCore::FrameLoader::didBeginDocument): Added call to set readyState to Loading earlier. Otherwise, readyState's initial value is Complete, and we only set it to Loading in Document::implicitOpen (which is called after FrameLoader::didBeginDocument by DocumentWriter::begin), so we could end up in Document::statePopped and have the readyState be Complete, even if we hadn't even begin loading the document.
Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r69430 r69432  
     12010-10-08  Mihai Parparita  <mihaip@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        popstate events are lost when network connection is in progress
     6        https://bugs.webkit.org/show_bug.cgi?id=42940
     7       
     8        Add test case where we have an image request that never finishes while
     9        using pushState and history.back().
     10
     11        * http/tests/history/popstate-fires-with-pending-requests-expected.txt: Added.
     12        * http/tests/history/popstate-fires-with-pending-requests.html: Added.
     13        * http/tests/history/resources/slow-image.php: Added.
     14
    1152010-10-08  Abhishek Arya  <inferno@chromium.org>
    216
  • trunk/WebCore/ChangeLog

    r69431 r69432  
     12010-10-08  Mihai Parparita  <mihaip@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        popstate events are lost when network connection is in progress
     6        https://bugs.webkit.org/show_bug.cgi?id=42940
     7       
     8        Instead of checking FrameLoader::isComplete() (which isn't true if the
     9        document's resource loader has requests outstanding), check that the
     10        document's readyState is complete, as the spec says.
     11
     12        Test: http/tests/history/popstate-fires-with-pending-requests.html
     13
     14        * dom/Document.cpp:
     15        (WebCore::Document::statePopped):
     16        * loader/FrameLoader.cpp:
     17        (WebCore::FrameLoader::didBeginDocument): Added call to set readyState
     18        to Loading earlier. Otherwise, readyState's initial value is Complete,
     19        and we only set it to Loading in Document::implicitOpen (which is called
     20        after FrameLoader::didBeginDocument by DocumentWriter::begin), so we
     21        could end up in Document::statePopped and have the readyState be
     22        Complete, even if we hadn't even begin loading the document.
     23
    1242010-10-08  Daniel Cheng  <dcheng@chromium.org>
    225
  • trunk/WebCore/dom/Document.cpp

    r69406 r69432  
    44294429void Document::statePopped(SerializedScriptValue* stateObject)
    44304430{
    4431     Frame* f = frame();
    4432     if (!f)
    4433         return;
    4434    
    4435     if (f->loader()->isComplete())
     4431    if (!frame())
     4432        return;
     4433   
     4434    // Per step 11 of section 6.5.9 (history traversal) of the HTML5 spec, we
     4435    // defer firing of popstate until we're in the complete state.
     4436    if (m_readyState == Complete)
    44364437        enqueuePopstateEvent(stateObject);
    44374438    else
  • trunk/WebCore/loader/FrameLoader.cpp

    r69039 r69432  
    659659    m_didCallImplicitClose = false;
    660660    m_isLoadingMainResource = true;
     661    m_frame->document()->setReadyState(Document::Loading);
    661662
    662663    if (m_pendingStateObject) {
Note: See TracChangeset for help on using the changeset viewer.