Title: [90471] trunk
Revision
90471
Author
[email protected]
Date
2011-07-06 10:59:59 -0700 (Wed, 06 Jul 2011)

Log Message

2011-07-06  Nate Chapin  <[email protected]>

        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):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (90470 => 90471)


--- trunk/LayoutTests/ChangeLog	2011-07-06 17:57:07 UTC (rev 90470)
+++ trunk/LayoutTests/ChangeLog	2011-07-06 17:59:59 UTC (rev 90471)
@@ -1,3 +1,13 @@
+2011-07-06  Nate Chapin  <[email protected]>
+
+        Test updates for https://bugs.webkit.org/show_bug.cgi?id=62066.
+
+        Reviewed by Adam Barth.
+
+        * http/tests/loading/cross-origin-XHR-willLoadRequest-expected.txt:
+        * http/tests/misc/favicon-loads-with-icon-loading-override-expected.txt:
+        * http/tests/misc/link-rel-icon-beforeload-expected.txt:
+
 2011-07-06  Mihai Parparita  <[email protected]>
 
         Rebaseline some imagemap focus ring tests for Chromium Mac (mainly for

Modified: trunk/LayoutTests/http/tests/loading/cross-origin-XHR-willLoadRequest-expected.txt (90470 => 90471)


--- trunk/LayoutTests/http/tests/loading/cross-origin-XHR-willLoadRequest-expected.txt	2011-07-06 17:57:07 UTC (rev 90470)
+++ trunk/LayoutTests/http/tests/loading/cross-origin-XHR-willLoadRequest-expected.txt	2011-07-06 17:59:59 UTC (rev 90471)
@@ -2,6 +2,6 @@
 main frame - didCommitLoadForFrame
 main frame - didFinishDocumentLoadForFrame
 main frame - didHandleOnloadEventsForFrame
+main frame - didFinishLoadForFrame
 CONSOLE 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.
-main frame - didFinishLoadForFrame
 The console message above should report failure to load foo.txt due to cross-origin access, not a network error.

Modified: trunk/LayoutTests/http/tests/misc/favicon-loads-with-icon-loading-override-expected.txt (90470 => 90471)


--- trunk/LayoutTests/http/tests/misc/favicon-loads-with-icon-loading-override-expected.txt	2011-07-06 17:57:07 UTC (rev 90470)
+++ trunk/LayoutTests/http/tests/misc/favicon-loads-with-icon-loading-override-expected.txt	2011-07-06 17:59:59 UTC (rev 90471)
@@ -2,8 +2,6 @@
 http://127.0.0.1:8000/misc/favicon-loads-with-icon-loading-override.html - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/misc/favicon-loads-with-icon-loading-override.html, main document URL http://127.0.0.1:8000/misc/favicon-loads-with-icon-loading-override.html, http method GET> redirectResponse (null)
 http://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>
 http://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)
-http://127.0.0.1:8000/misc/favicon-loads-with-icon-loading-override.html - didFinishLoading
-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>
 https://bugs.webkit.org/show_bug.cgi?id=58292 - Provide new setting to allow site icon loading despite disabling automatic image loading in general.
 Resource load callbacks will reveal if the favicon still gets loaded if automatic image loading is disabled, but site icon image loading override is enabled. 
 

Modified: trunk/LayoutTests/http/tests/misc/link-rel-icon-beforeload-expected.txt (90470 => 90471)


--- trunk/LayoutTests/http/tests/misc/link-rel-icon-beforeload-expected.txt	2011-07-06 17:57:07 UTC (rev 90470)
+++ trunk/LayoutTests/http/tests/misc/link-rel-icon-beforeload-expected.txt	2011-07-06 17:59:59 UTC (rev 90471)
@@ -2,6 +2,4 @@
 http://127.0.0.1:8000/misc/link-rel-icon-beforeload.html - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/misc/link-rel-icon-beforeload.html, main document URL http://127.0.0.1:8000/misc/link-rel-icon-beforeload.html, http method GET> redirectResponse (null)
 http://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>
 http://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)
-http://127.0.0.1:8000/misc/link-rel-icon-beforeload.html - didFinishLoading
-http://127.0.0.1:8000/favicon.ico - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/favicon.ico, http status code 200>
 This 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.

Modified: trunk/Source/WebCore/ChangeLog (90470 => 90471)


--- trunk/Source/WebCore/ChangeLog	2011-07-06 17:57:07 UTC (rev 90470)
+++ trunk/Source/WebCore/ChangeLog	2011-07-06 17:59:59 UTC (rev 90471)
@@ -1,3 +1,20 @@
+2011-07-06  Nate Chapin  <[email protected]>
+
+        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):
+
 2011-07-06  Pavel Feldman  <[email protected]>
 
         Web Inspector: implement drag'n'drop in the elements panel for reordering nodes.

Modified: trunk/Source/WebCore/dom/Document.cpp (90470 => 90471)


--- trunk/Source/WebCore/dom/Document.cpp	2011-07-06 17:57:07 UTC (rev 90470)
+++ trunk/Source/WebCore/dom/Document.cpp	2011-07-06 17:59:59 UTC (rev 90471)
@@ -387,6 +387,7 @@
     , m_ignoreDestructiveWriteCount(0)
     , m_titleSetExplicitly(false)
     , m_updateFocusAppearanceTimer(this, &Document::updateFocusAppearanceTimerFired)
+    , m_loadEventFinished(false)
     , m_startTime(currentTime())
     , m_overMinimumLayoutThreshold(false)
     , m_extraLayoutDelay(0)
@@ -3400,6 +3401,7 @@
     if (!domWindow)
         return;
     domWindow->dispatchLoadEvent();
+    m_loadEventFinished = true;
 }
 
 void Document::enqueueWindowEvent(PassRefPtr<Event> event)

Modified: trunk/Source/WebCore/dom/Document.h (90470 => 90471)


--- trunk/Source/WebCore/dom/Document.h	2011-07-06 17:57:07 UTC (rev 90470)
+++ trunk/Source/WebCore/dom/Document.h	2011-07-06 17:59:59 UTC (rev 90471)
@@ -999,6 +999,7 @@
     void statePopped(SerializedScriptValue*);
 
     bool processingLoadEvent() const { return m_processingLoadEvent; }
+    bool loadEventFinished() const { return m_loadEventFinished; }
 
 #if ENABLE(DATABASE)
     virtual bool allowDatabaseAccess() const;
@@ -1280,8 +1281,12 @@
     Timer<Document> m_updateFocusAppearanceTimer;
 
     Element* m_cssTarget;
-    
+
+    // FIXME: Merge these 2 variables into an enum. Also, FrameLoader::m_didCallImplicitClose
+    // is almost a duplication of this data, so that should probably get merged in too.
     bool m_processingLoadEvent;
+    bool m_loadEventFinished;
+
     RefPtr<SerializedScriptValue> m_pendingStateObject;
     double m_startTime;
     bool m_overMinimumLayoutThreshold;

Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (90470 => 90471)


--- trunk/Source/WebCore/loader/DocumentLoader.cpp	2011-07-06 17:57:07 UTC (rev 90470)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp	2011-07-06 17:59:59 UTC (rev 90471)
@@ -437,11 +437,9 @@
     // Once a frame has loaded, we no longer need to consider subresources,
     // but we still need to consider subframes.
     if (frameLoader()->state() != FrameStateComplete) {
-        if (!m_primaryLoadComplete && isLoading())
-            return true;
-        if (!m_subresourceLoaders.isEmpty())
-            return true;
         Document* doc = m_frame->document();
+        if ((!m_primaryLoadComplete || !m_frame->document()->loadEventFinished()) && isLoading())
+            return true;
         if (doc->cachedResourceLoader()->requestCount())
             return true;
         if (DocumentParser* parser = doc->parser())
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to