Changeset 90471 in webkit


Ignore:
Timestamp:
Jul 6, 2011 10:59:59 AM (13 years ago)
Author:
Nate Chapin
Message:

2011-07-06 Nate Chapin <Nate Chapin>

Don't let all subresources keep isLoadingInAPISense() from
returning false, only requests that affect
CachedResourceRequest::requestCount().
https://bugs.webkit.org/show_bug.cgi?id=62066

Reviewed by Adam Barth.

  • dom/Document.cpp: (WebCore::Document::Document): (WebCore::Document::dispatchWindowLoadEvent):
  • dom/Document.h: (WebCore::Document::loadEventFinished):
  • loader/DocumentLoader.cpp: (WebCore::DocumentLoader::isLoadingInAPISense):
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r90470 r90471  
     12011-07-06  Nate Chapin  <japhet@chromium.org>
     2
     3        Test updates for https://bugs.webkit.org/show_bug.cgi?id=62066.
     4
     5        Reviewed by Adam Barth.
     6
     7        * http/tests/loading/cross-origin-XHR-willLoadRequest-expected.txt:
     8        * http/tests/misc/favicon-loads-with-icon-loading-override-expected.txt:
     9        * http/tests/misc/link-rel-icon-beforeload-expected.txt:
     10
    1112011-07-06  Mihai Parparita  <mihaip@chromium.org>
    212
  • trunk/LayoutTests/http/tests/loading/cross-origin-XHR-willLoadRequest-expected.txt

    r89598 r90471  
    33main frame - didFinishDocumentLoadForFrame
    44main frame - didHandleOnloadEventsForFrame
     5main frame - didFinishLoadForFrame
    56CONSOLE MESSAGE: line 1: XMLHttpRequest cannot load http://localhost:8000/loading/resources/foo.txt. Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.
    6 main frame - didFinishLoadForFrame
    77The console message above should report failure to load foo.txt due to cross-origin access, not a network error.
  • trunk/LayoutTests/http/tests/misc/favicon-loads-with-icon-loading-override-expected.txt

    r89598 r90471  
    33http://127.0.0.1:8000/misc/favicon-loads-with-icon-loading-override.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/misc/favicon-loads-with-icon-loading-override.html, http status code 200>
    44http://127.0.0.1:8000/misc/resources/favicon.ico - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/misc/resources/favicon.ico, main document URL http://127.0.0.1:8000/misc/favicon-loads-with-icon-loading-override.html, http method GET> redirectResponse (null)
    5 http://127.0.0.1:8000/misc/favicon-loads-with-icon-loading-override.html - didFinishLoading
    6 http://127.0.0.1:8000/misc/resources/favicon.ico - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/misc/resources/favicon.ico, http status code 200>
    75https://bugs.webkit.org/show_bug.cgi?id=58292 - Provide new setting to allow site icon loading despite disabling automatic image loading in general.
    86Resource load callbacks will reveal if the favicon still gets loaded if automatic image loading is disabled, but site icon image loading override is enabled.
  • trunk/LayoutTests/http/tests/misc/link-rel-icon-beforeload-expected.txt

    r89598 r90471  
    33http://127.0.0.1:8000/misc/link-rel-icon-beforeload.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/misc/link-rel-icon-beforeload.html, http status code 200>
    44http://127.0.0.1:8000/favicon.ico - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/favicon.ico, main document URL http://127.0.0.1:8000/misc/link-rel-icon-beforeload.html, http method GET> redirectResponse (null)
    5 http://127.0.0.1:8000/misc/link-rel-icon-beforeload.html - didFinishLoading
    6 http://127.0.0.1:8000/favicon.ico - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/favicon.ico, http status code 200>
    75This test should not show a request for the favicon dont-load-this.ico, since the beforeload handler on the favicon link returns false. Therefore, if the resource request list below shows a request for dont-load-this.ico, then this test has failed.
  • trunk/Source/WebCore/ChangeLog

    r90460 r90471  
     12011-07-06  Nate Chapin  <japhet@chromium.org>
     2
     3        Don't let all subresources keep isLoadingInAPISense() from
     4        returning false, only requests that affect
     5        CachedResourceRequest::requestCount().
     6        https://bugs.webkit.org/show_bug.cgi?id=62066
     7
     8        Reviewed by Adam Barth.
     9
     10        * dom/Document.cpp:
     11        (WebCore::Document::Document):
     12        (WebCore::Document::dispatchWindowLoadEvent):
     13        * dom/Document.h:
     14        (WebCore::Document::loadEventFinished):
     15        * loader/DocumentLoader.cpp:
     16        (WebCore::DocumentLoader::isLoadingInAPISense):
     17
    1182011-07-06  Pavel Feldman  <pfeldman@google.com>
    219
  • trunk/Source/WebCore/dom/Document.cpp

    r89598 r90471  
    388388    , m_titleSetExplicitly(false)
    389389    , m_updateFocusAppearanceTimer(this, &Document::updateFocusAppearanceTimerFired)
     390    , m_loadEventFinished(false)
    390391    , m_startTime(currentTime())
    391392    , m_overMinimumLayoutThreshold(false)
     
    34013402        return;
    34023403    domWindow->dispatchLoadEvent();
     3404    m_loadEventFinished = true;
    34033405}
    34043406
  • trunk/Source/WebCore/dom/Document.h

    r89780 r90471  
    10001000
    10011001    bool processingLoadEvent() const { return m_processingLoadEvent; }
     1002    bool loadEventFinished() const { return m_loadEventFinished; }
    10021003
    10031004#if ENABLE(DATABASE)
     
    12811282
    12821283    Element* m_cssTarget;
    1283    
     1284
     1285    // FIXME: Merge these 2 variables into an enum. Also, FrameLoader::m_didCallImplicitClose
     1286    // is almost a duplication of this data, so that should probably get merged in too.
    12841287    bool m_processingLoadEvent;
     1288    bool m_loadEventFinished;
     1289
    12851290    RefPtr<SerializedScriptValue> m_pendingStateObject;
    12861291    double m_startTime;
  • trunk/Source/WebCore/loader/DocumentLoader.cpp

    r89715 r90471  
    438438    // but we still need to consider subframes.
    439439    if (frameLoader()->state() != FrameStateComplete) {
    440         if (!m_primaryLoadComplete && isLoading())
     440        Document* doc = m_frame->document();
     441        if ((!m_primaryLoadComplete || !m_frame->document()->loadEventFinished()) && isLoading())
    441442            return true;
    442         if (!m_subresourceLoaders.isEmpty())
    443             return true;
    444         Document* doc = m_frame->document();
    445443        if (doc->cachedResourceLoader()->requestCount())
    446444            return true;
Note: See TracChangeset for help on using the changeset viewer.