Title: [134799] trunk
Revision
134799
Author
[email protected]
Date
2012-11-15 11:00:12 -0800 (Thu, 15 Nov 2012)

Log Message

Unreviewed, rolling out r134649 and r134665.
http://trac.webkit.org/changeset/134649
http://trac.webkit.org/changeset/134665
https://bugs.webkit.org/show_bug.cgi?id=102413

Broke a ton of downstream chromium tests (Requested by japhet
on #webkit).

Patch by Sheriff Bot <[email protected]> on 2012-11-15

Source/WebCore:

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::DocumentLoader):
(WebCore::DocumentLoader::~DocumentLoader):
(WebCore::DocumentLoader::finishedLoading):
(WebCore::DocumentLoader::clearMainResourceLoader):
(WebCore::DocumentLoader::isLoadingInAPISense):
(WebCore::DocumentLoader::documentURL):
(WebCore::DocumentLoader::isLoadingMainResource):
(WebCore::DocumentLoader::startLoadingMainResource):
* loader/DocumentLoader.h:
(DocumentLoader):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::FrameLoader):
(WebCore::FrameLoader::init):
* loader/FrameLoaderStateMachine.cpp:
(WebCore::FrameLoaderStateMachine::FrameLoaderStateMachine):
* loader/FrameLoaderStateMachine.h:
* loader/MainResourceLoader.cpp:
(WebCore::shouldLoadAsEmptyDocument):
(WebCore):
(WebCore::MainResourceLoader::continueAfterContentPolicy):
(WebCore::MainResourceLoader::didReceiveResponse):
(WebCore::MainResourceLoader::didFinishLoading):
(WebCore::MainResourceLoader::handleEmptyLoad):
(WebCore::MainResourceLoader::loadNow):
(WebCore::MainResourceLoader::load):
* loader/MainResourceLoader.h:
(MainResourceLoader):

Tools:

* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::updateForCommittedLoad):

LayoutTests:

* http/tests/inspector/network/network-iframe-load-and-delete.html:
* http/tests/loading/redirect-methods-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (134798 => 134799)


--- trunk/LayoutTests/ChangeLog	2012-11-15 18:56:17 UTC (rev 134798)
+++ trunk/LayoutTests/ChangeLog	2012-11-15 19:00:12 UTC (rev 134799)
@@ -1,3 +1,19 @@
+2012-11-15  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r134649 and r134665.
+        http://trac.webkit.org/changeset/134649
+        http://trac.webkit.org/changeset/134665
+        https://bugs.webkit.org/show_bug.cgi?id=102413
+
+        Broke a ton of downstream chromium tests (Requested by japhet
+        on #webkit).
+
+        * http/tests/inspector/network/network-iframe-load-and-delete.html:
+        * http/tests/loading/redirect-methods-expected.txt:
+        * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt:
+        * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt:
+        * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt:
+
 2012-11-15  Mike West  <[email protected]>
 
         Unreviewed: Skipping http/tests/security/sandboxed-iframe-form-top.html

Modified: trunk/LayoutTests/http/tests/inspector/network/network-iframe-load-and-delete.html (134798 => 134799)


--- trunk/LayoutTests/http/tests/inspector/network/network-iframe-load-and-delete.html	2012-11-15 18:56:17 UTC (rev 134798)
+++ trunk/LayoutTests/http/tests/inspector/network/network-iframe-load-and-delete.html	2012-11-15 19:00:12 UTC (rev 134799)
@@ -43,7 +43,7 @@
 
     function step2()
     {
-        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 2];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 3];
         InspectorTest.addResult(request1.url);
         InspectorTest.addResult("resource.type: " + request1.type);
         InspectorTest.addResult("resource.content before requesting content: " + request1.content);
@@ -52,7 +52,7 @@
 
     function step3()
     {
-        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 2];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 3];
         InspectorTest.addResult("resource.content after requesting content: " + request1.content);
 
         var request2 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];

Modified: trunk/LayoutTests/http/tests/loading/redirect-methods-expected.txt (134798 => 134799)


--- trunk/LayoutTests/http/tests/loading/redirect-methods-expected.txt	2012-11-15 18:56:17 UTC (rev 134798)
+++ trunk/LayoutTests/http/tests/loading/redirect-methods-expected.txt	2012-11-15 19:00:12 UTC (rev 134799)
@@ -5,10 +5,13 @@
 main frame - didFinishLoadForFrame
 <unknown> - didFinishLoading
 frame "0" - didStartProvisionalLoadForFrame
+about:blank - willSendRequest <NSURLRequest URL about:blank, main document URL http://127.0.0.1:8000/loading/redirect-methods.html, http method GET> redirectResponse (null)
+about:blank - didReceiveResponse <NSURLResponse about:blank, http status code 0>
 frame "0" - didCommitLoadForFrame
 frame "0" - didFinishDocumentLoadForFrame
 frame "0" - didHandleOnloadEventsForFrame
 frame "0" - didFinishLoadForFrame
+about:blank - didFinishLoading
 frame "0" - willPerformClientRedirectToURL: http://127.0.0.1:8000/loading/resources/redirect-methods-form.html 
 frame "0" - didStartProvisionalLoadForFrame
 http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/loading/resources/redirect-methods-form.html, main document URL http://127.0.0.1:8000/loading/redirect-methods.html, http method GET> redirectResponse (null)
@@ -29,10 +32,13 @@
 frame "0" - didCommitLoadForFrame
 frame "0" - didFinishDocumentLoadForFrame
 frame "1" - didStartProvisionalLoadForFrame
+about:blank - willSendRequest <NSURLRequest URL about:blank, main document URL http://127.0.0.1:8000/loading/redirect-methods.html, http method GET> redirectResponse (null)
+about:blank - didReceiveResponse <NSURLResponse about:blank, http status code 0>
 frame "1" - didCommitLoadForFrame
 frame "1" - didFinishDocumentLoadForFrame
 frame "1" - didHandleOnloadEventsForFrame
 frame "1" - didFinishLoadForFrame
+about:blank - didFinishLoading
 frame "1" - willPerformClientRedirectToURL: http://127.0.0.1:8000/loading/resources/redirect-methods-form.html 
 frame "0" - didHandleOnloadEventsForFrame
 frame "0" - didFinishLoadForFrame
@@ -56,10 +62,13 @@
 frame "1" - didCommitLoadForFrame
 frame "1" - didFinishDocumentLoadForFrame
 frame "2" - didStartProvisionalLoadForFrame
+about:blank - willSendRequest <NSURLRequest URL about:blank, main document URL http://127.0.0.1:8000/loading/redirect-methods.html, http method GET> redirectResponse (null)
+about:blank - didReceiveResponse <NSURLResponse about:blank, http status code 0>
 frame "2" - didCommitLoadForFrame
 frame "2" - didFinishDocumentLoadForFrame
 frame "2" - didHandleOnloadEventsForFrame
 frame "2" - didFinishLoadForFrame
+about:blank - didFinishLoading
 frame "2" - willPerformClientRedirectToURL: http://127.0.0.1:8000/loading/resources/redirect-methods-form.html 
 frame "1" - didHandleOnloadEventsForFrame
 frame "1" - didFinishLoadForFrame
@@ -83,10 +92,13 @@
 frame "2" - didCommitLoadForFrame
 frame "2" - didFinishDocumentLoadForFrame
 frame "3" - didStartProvisionalLoadForFrame
+about:blank - willSendRequest <NSURLRequest URL about:blank, main document URL http://127.0.0.1:8000/loading/redirect-methods.html, http method GET> redirectResponse (null)
+about:blank - didReceiveResponse <NSURLResponse about:blank, http status code 0>
 frame "3" - didCommitLoadForFrame
 frame "3" - didFinishDocumentLoadForFrame
 frame "3" - didHandleOnloadEventsForFrame
 frame "3" - didFinishLoadForFrame
+about:blank - didFinishLoading
 frame "3" - willPerformClientRedirectToURL: http://127.0.0.1:8000/loading/resources/redirect-methods-form.html 
 frame "2" - didHandleOnloadEventsForFrame
 frame "2" - didFinishLoadForFrame

Modified: trunk/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt (134798 => 134799)


--- trunk/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt	2012-11-15 18:56:17 UTC (rev 134798)
+++ trunk/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt	2012-11-15 19:00:12 UTC (rev 134799)
@@ -3,6 +3,8 @@
 http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe.html, http status code 200>
 http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe.html - didFailLoadingWithError: <NSError domain NSURLErrorDomain, code -999, failing URL "http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe.html">
 CONSOLE MESSAGE: Refused to display 'http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe.html' in a frame because it set 'X-Frame-Options' to 'deny'.
+about:blank - willSendRequest <NSURLRequest URL about:blank, main document URL http://127.0.0.1:8000/security/XFrameOptions/x-frame-options-deny-meta-tag.html, http method GET> redirectResponse (null)
+about:blank - didReceiveResponse <NSURLResponse about:blank, http status code 0>
 There should be no content in the iframe below
 
 

Modified: trunk/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt (134798 => 134799)


--- trunk/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt	2012-11-15 18:56:17 UTC (rev 134798)
+++ trunk/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt	2012-11-15 19:00:12 UTC (rev 134799)
@@ -3,6 +3,8 @@
 http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-in-body.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-in-body.html, http status code 200>
 http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-in-body.html - didFailLoadingWithError: <NSError domain NSURLErrorDomain, code -999, failing URL "http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-in-body.html">
 CONSOLE MESSAGE: Refused to display 'http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-in-body.html' in a frame because it set 'X-Frame-Options' to 'deny'.
+about:blank - willSendRequest <NSURLRequest URL about:blank, main document URL http://127.0.0.1:8000/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html, http method GET> redirectResponse (null)
+about:blank - didReceiveResponse <NSURLResponse about:blank, http status code 0>
 There should be no content in the iframe below
 
 

Modified: trunk/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt (134798 => 134799)


--- trunk/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt	2012-11-15 18:56:17 UTC (rev 134798)
+++ trunk/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt	2012-11-15 19:00:12 UTC (rev 134799)
@@ -3,6 +3,8 @@
 http://localhost:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-parent-same-origin-deny.html - didReceiveResponse <NSURLResponse http://localhost:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-parent-same-origin-deny.html, http status code 200>
 http://localhost:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-parent-same-origin-deny.html - didFailLoadingWithError: <NSError domain NSURLErrorDomain, code -999, failing URL "http://localhost:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-parent-same-origin-deny.html">
 CONSOLE MESSAGE: Refused to display 'http://localhost:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-parent-same-origin-deny.html' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
+about:blank - willSendRequest <NSURLRequest URL about:blank, main document URL http://127.0.0.1:8000/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html, http method GET> redirectResponse (null)
+about:blank - didReceiveResponse <NSURLResponse about:blank, http status code 0>
 There should be no content in the iframe below
 
 

Modified: trunk/Source/WebCore/ChangeLog (134798 => 134799)


--- trunk/Source/WebCore/ChangeLog	2012-11-15 18:56:17 UTC (rev 134798)
+++ trunk/Source/WebCore/ChangeLog	2012-11-15 19:00:12 UTC (rev 134799)
@@ -1,3 +1,42 @@
+2012-11-15  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r134649 and r134665.
+        http://trac.webkit.org/changeset/134649
+        http://trac.webkit.org/changeset/134665
+        https://bugs.webkit.org/show_bug.cgi?id=102413
+
+        Broke a ton of downstream chromium tests (Requested by japhet
+        on #webkit).
+
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::DocumentLoader):
+        (WebCore::DocumentLoader::~DocumentLoader):
+        (WebCore::DocumentLoader::finishedLoading):
+        (WebCore::DocumentLoader::clearMainResourceLoader):
+        (WebCore::DocumentLoader::isLoadingInAPISense):
+        (WebCore::DocumentLoader::documentURL):
+        (WebCore::DocumentLoader::isLoadingMainResource):
+        (WebCore::DocumentLoader::startLoadingMainResource):
+        * loader/DocumentLoader.h:
+        (DocumentLoader):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::FrameLoader):
+        (WebCore::FrameLoader::init):
+        * loader/FrameLoaderStateMachine.cpp:
+        (WebCore::FrameLoaderStateMachine::FrameLoaderStateMachine):
+        * loader/FrameLoaderStateMachine.h:
+        * loader/MainResourceLoader.cpp:
+        (WebCore::shouldLoadAsEmptyDocument):
+        (WebCore):
+        (WebCore::MainResourceLoader::continueAfterContentPolicy):
+        (WebCore::MainResourceLoader::didReceiveResponse):
+        (WebCore::MainResourceLoader::didFinishLoading):
+        (WebCore::MainResourceLoader::handleEmptyLoad):
+        (WebCore::MainResourceLoader::loadNow):
+        (WebCore::MainResourceLoader::load):
+        * loader/MainResourceLoader.h:
+        (MainResourceLoader):
+
 2012-11-15  Kentaro Hara  <[email protected]>
 
         Correct syntax of old-style IDL files

Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (134798 => 134799)


--- trunk/Source/WebCore/loader/DocumentLoader.cpp	2012-11-15 18:56:17 UTC (rev 134798)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp	2012-11-15 19:00:12 UTC (rev 134799)
@@ -49,7 +49,6 @@
 #include "MainResourceLoader.h"
 #include "Page.h"
 #include "ResourceBuffer.h"
-#include "SchemeRegistry.h"
 #include "Settings.h"
 #include "TextResourceDecoder.h"
 #include "WebCoreMemoryInstrumentation.h"
@@ -98,7 +97,6 @@
     , m_isStopping(false)
     , m_gotFirstByte(false)
     , m_isClientRedirect(false)
-    , m_loadingEmptyDocument(false)
     , m_wasOnloadHandled(false)
     , m_stopRecordingResponses(false)
     , m_substituteResourceDeliveryTimer(this, &DocumentLoader::substituteResourceDeliveryTimerFired)
@@ -116,7 +114,7 @@
 
 DocumentLoader::~DocumentLoader()
 {
-    ASSERT(!m_frame || frameLoader()->activeDocumentLoader() != this || !isLoading());
+    ASSERT(!m_frame || frameLoader()->activeDocumentLoader() != this || !frameLoader()->isLoading());
     if (m_iconLoadDecisionCallback)
         m_iconLoadDecisionCallback->invalidate();
     if (m_iconDataCallback)
@@ -287,7 +285,7 @@
 void DocumentLoader::finishedLoading()
 {
     commitIfReady();
-    if (!frameLoader())
+    if (!frameLoader() || frameLoader()->stateMachine()->creatingInitialEmptyDocument())
         return;
 
     if (!maybeCreateArchive()) {
@@ -302,8 +300,7 @@
     if (!m_mainDocumentError.isNull())
         return;
     clearMainResourceLoader();
-    if (!frameLoader()->stateMachine()->creatingInitialEmptyDocument())
-        frameLoader()->checkLoadComplete();
+    frameLoader()->checkLoadComplete();
 }
 
 void DocumentLoader::commitLoad(const char* data, int length)
@@ -452,7 +449,6 @@
         m_mainResourceData = m_mainResourceLoader->resourceData();
         m_mainResourceLoader = 0;
     }
-    m_loadingEmptyDocument = false;
 
     if (this == frameLoader()->activeDocumentLoader())
         checkLoadComplete();
@@ -467,7 +463,7 @@
             return true;
     
         Document* doc = m_frame->document();
-        if ((isLoadingMainResource() || !m_frame->document()->loadEventFinished()) && isLoading())
+        if ((m_mainResourceLoader || !m_frame->document()->loadEventFinished()) && isLoading())
             return true;
         if (m_cachedResourceLoader->requestCount())
             return true;
@@ -773,7 +769,7 @@
         url = ""
     if (url.isEmpty())
         url = ""
-    if (url.isEmpty() && !frameLoader()->stateMachine()->creatingInitialEmptyDocument())
+    if (url.isEmpty())
         url = ""
     return url;
 }
@@ -834,7 +830,7 @@
 
 bool DocumentLoader::isLoadingMainResource() const
 {
-    return !!m_mainResourceLoader || m_loadingEmptyDocument;
+    return !!m_mainResourceLoader;
 }
 
 bool DocumentLoader::isLoadingMultipartContent() const
@@ -847,39 +843,17 @@
     return isLoadingMultipartContent() && frameLoader()->isReplacing();
 }
 
-bool DocumentLoader::maybeLoadEmpty()
-{
-    bool shoudLoadEmpty = !m_substituteData.isValid() && (m_request.url().isEmpty() || SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(m_request.url().protocol()));
-    if (!shoudLoadEmpty && !frameLoader()->client()->representationExistsForURLScheme(m_request.url().protocol()))
-        return false;
-        
-    m_loadingEmptyDocument = true;
-    String mimeType = shoudLoadEmpty ? "text/html" : frameLoader()->client()->generatedMIMETypeForURLScheme(m_request.url().protocol());
-    setResponse(ResourceResponse(m_request.url(), mimeType, 0, String(), String()));
-    finishedLoading();
-    return true;
-}
-
 void DocumentLoader::startLoadingMainResource()
 {
     m_mainDocumentError = ResourceError();
     timing()->markNavigationStart();
     ASSERT(!m_mainResourceLoader);
-
-    if (maybeLoadEmpty())
-        return;
-
     m_mainResourceLoader = MainResourceLoader::create(m_frame);
 
     // FIXME: Is there any way the extra fields could have not been added by now?
     // If not, it would be great to remove this line of code.
     frameLoader()->addExtraFieldsToMainResourceRequest(m_request);
     m_mainResourceLoader->load(m_request, m_substituteData);
-
-    if (m_request.isNull()) {
-        m_mainResourceLoader = 0;
-        maybeLoadEmpty();
-    }
 }
 
 void DocumentLoader::cancelMainResourceLoad(const ResourceError& error)

Modified: trunk/Source/WebCore/loader/DocumentLoader.h (134798 => 134799)


--- trunk/Source/WebCore/loader/DocumentLoader.h	2012-11-15 18:56:17 UTC (rev 134798)
+++ trunk/Source/WebCore/loader/DocumentLoader.h	2012-11-15 19:00:12 UTC (rev 134799)
@@ -265,8 +265,6 @@
         void clearArchiveResources();
 #endif
 
-        bool maybeLoadEmpty();
-
         bool isMultipartReplacingLoad() const;
 
         void deliverSubstituteResourcesAfterDelay();
@@ -309,7 +307,6 @@
         bool m_isStopping;
         bool m_gotFirstByte;
         bool m_isClientRedirect;
-        bool m_loadingEmptyDocument;
 
         // FIXME: Document::m_processingLoadEvent and DocumentLoader::m_wasOnloadHandled are roughly the same
         // and should be merged.

Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (134798 => 134799)


--- trunk/Source/WebCore/loader/FrameLoader.cpp	2012-11-15 18:56:17 UTC (rev 134798)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp	2012-11-15 19:00:12 UTC (rev 134799)
@@ -214,14 +214,14 @@
     , m_subframeLoader(frame)
     , m_icon(frame)
     , m_mixedContentChecker(frame)
-    , m_state(FrameStateProvisional)
+    , m_state(FrameStateCommittedPage)
     , m_loadType(FrameLoadTypeStandard)
     , m_delegateIsHandlingProvisionalLoadError(false)
     , m_quickRedirectComing(false)
     , m_sentRedirectNotification(false)
     , m_inStopAllLoaders(false)
     , m_isExecutingJavaScriptFormAction(false)
-    , m_didCallImplicitClose(true)
+    , m_didCallImplicitClose(false)
     , m_wasUnloadEventEmitted(false)
     , m_pageDismissalEventBeingDispatched(NoDismissal)
     , m_isComplete(false)
@@ -254,11 +254,19 @@
 void FrameLoader::init()
 {
     // This somewhat odd set of steps gives the frame an initial empty document.
+    // It would be better if this could be done with even fewer steps.
+    m_stateMachine.advanceTo(FrameLoaderStateMachine::CreatingInitialEmptyDocument);
     setPolicyDocumentLoader(m_client->createDocumentLoader(ResourceRequest(KURL(ParsedURLString, emptyString())), SubstituteData()).get());
     setProvisionalDocumentLoader(m_policyDocumentLoader.get());
-    m_provisionalDocumentLoader->startLoadingMainResource();
+    setState(FrameStateProvisional);
+    m_provisionalDocumentLoader->setResponse(ResourceResponse(KURL(), "text/html", 0, String(), String()));
+    m_provisionalDocumentLoader->finishedLoading();
+    ASSERT(!m_frame->document());
+    m_documentLoader->writer()->begin(KURL(), false);
+    m_documentLoader->writer()->end();
     m_frame->document()->cancelParsing();
     m_stateMachine.advanceTo(FrameLoaderStateMachine::DisplayingInitialEmptyDocument);
+    m_didCallImplicitClose = true;
 
     m_networkingContext = m_client->createNetworkingContext();
     m_progressTracker = FrameProgressTracker::create(m_frame);

Modified: trunk/Source/WebCore/loader/FrameLoaderStateMachine.cpp (134798 => 134799)


--- trunk/Source/WebCore/loader/FrameLoaderStateMachine.cpp	2012-11-15 18:56:17 UTC (rev 134798)
+++ trunk/Source/WebCore/loader/FrameLoaderStateMachine.cpp	2012-11-15 19:00:12 UTC (rev 134799)
@@ -35,7 +35,7 @@
 
     
 FrameLoaderStateMachine::FrameLoaderStateMachine() 
-    : m_state(CreatingInitialEmptyDocument)
+    : m_state(Uninitialized)
 { 
 }
     

Modified: trunk/Source/WebCore/loader/FrameLoaderStateMachine.h (134798 => 134799)


--- trunk/Source/WebCore/loader/FrameLoaderStateMachine.h	2012-11-15 18:56:17 UTC (rev 134798)
+++ trunk/Source/WebCore/loader/FrameLoaderStateMachine.h	2012-11-15 19:00:12 UTC (rev 134799)
@@ -44,6 +44,7 @@
     // alternate between CommittedFirstRealLoad and FirstLayoutDone.
     // Otherwise, the states only go down the list.
     enum State {
+        Uninitialized,
         CreatingInitialEmptyDocument,
         DisplayingInitialEmptyDocument,
         DisplayingInitialEmptyDocumentPostCommit,

Modified: trunk/Source/WebCore/loader/MainResourceLoader.cpp (134798 => 134799)


--- trunk/Source/WebCore/loader/MainResourceLoader.cpp	2012-11-15 18:56:17 UTC (rev 134798)
+++ trunk/Source/WebCore/loader/MainResourceLoader.cpp	2012-11-15 19:00:12 UTC (rev 134799)
@@ -67,6 +67,11 @@
 
 namespace WebCore {
 
+static bool shouldLoadAsEmptyDocument(const KURL& url)
+{
+    return url.isEmpty() || SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(url.protocol());
+}
+
 MainResourceLoader::MainResourceLoader(Frame* frame)
     : ResourceLoader(frame, ResourceLoaderOptions(SendCallbacks, SniffContent, BufferData, AllowStoredCredentials, AskClientForCrossOriginCredentials, SkipSecurityCheck))
     , m_dataLoadTimer(this, &MainResourceLoader::handleSubstituteDataLoadNow)
@@ -333,10 +338,13 @@
     if (!reachedTerminalState())
         ResourceLoader::didReceiveResponse(r);
 
-    if (frameLoader() && !frameLoader()->activeDocumentLoader()->isStopping() && m_substituteData.isValid()) {
-        if (m_substituteData.content()->size())
-            didReceiveData(m_substituteData.content()->data(), m_substituteData.content()->size(), m_substituteData.content()->size(), true);
-        if (frameLoader() && !frameLoader()->activeDocumentLoader()->isStopping()) 
+    if (frameLoader() && !frameLoader()->activeDocumentLoader()->isStopping()) {
+        if (m_substituteData.isValid()) {
+            if (m_substituteData.content()->size())
+                didReceiveData(m_substituteData.content()->data(), m_substituteData.content()->size(), m_substituteData.content()->size(), true);
+            if (frameLoader() && !frameLoader()->activeDocumentLoader()->isStopping()) 
+                didFinishLoading(0);
+        } else if (shouldLoadAsEmptyDocument(url) || frameLoader()->client()->representationExistsForURLScheme(url.protocol()))
             didFinishLoading(0);
     }
 }
@@ -377,7 +385,7 @@
     // There is a bug in CFNetwork where callbacks can be dispatched even when loads are deferred.
     // See <rdar://problem/6304600> for more details.
 #if !USE(CF)
-    ASSERT(!defersLoading());
+    ASSERT(shouldLoadAsEmptyDocument(r.url()) || !defersLoading());
 #endif
 
     if (m_loadingMultipartContent) {
@@ -492,7 +500,7 @@
     // There is a bug in CFNetwork where callbacks can be dispatched even when loads are deferred.
     // See <rdar://problem/6304600> for more details.
 #if !USE(CF)
-    ASSERT(!defersLoading() || InspectorInstrumentation::isDebuggerPaused(m_frame.get()));
+    ASSERT(shouldLoadAsEmptyDocument(frameLoader()->activeDocumentLoader()->url()) || !defersLoading() || InspectorInstrumentation::isDebuggerPaused(m_frame.get()));
 #endif
 
     // The additional processing can do anything including possibly removing the last
@@ -553,6 +561,18 @@
     info.addMember(m_dataLoadTimer);
 }
 
+void MainResourceLoader::handleEmptyLoad(const KURL& url, bool forURLScheme)
+{
+    String mimeType;
+    if (forURLScheme)
+        mimeType = frameLoader()->client()->generatedMIMETypeForURLScheme(url.protocol());
+    else
+        mimeType = "text/html";
+    
+    ResourceResponse response(url, mimeType, 0, String(), String());
+    didReceiveResponse(response);
+}
+
 void MainResourceLoader::handleSubstituteDataLoadNow(MainResourceLoaderTimer*)
 {
     RefPtr<MainResourceLoader> protect(this);
@@ -589,11 +609,30 @@
         handleSubstituteDataLoadNow(0);
 }
 
-void MainResourceLoader::loadNow(ResourceRequest& r)
+bool MainResourceLoader::loadNow(ResourceRequest& r)
 {
+    bool shouldLoadEmptyBeforeRedirect = shouldLoadAsEmptyDocument(r.url());
+
     ASSERT(!m_handle);
-    ASSERT(!defersLoading());
+    ASSERT(shouldLoadEmptyBeforeRedirect || !defersLoading());
 
+    // Send this synthetic delegate callback since clients expect it, and
+    // we no longer send the callback from within NSURLConnection for
+    // initial requests.
+    willSendRequest(r, ResourceResponse());
+    ASSERT(!deletionHasBegun());
+
+    // <rdar://problem/4801066>
+    // willSendRequest() is liable to make the call to frameLoader() return NULL, so we need to check that here
+    if (!frameLoader())
+        return false;
+    
+    const KURL& url = ""
+    bool shouldLoadEmpty = shouldLoadAsEmptyDocument(url) && !m_substituteData.isValid();
+
+    if (shouldLoadEmptyBeforeRedirect && !shouldLoadEmpty && defersLoading())
+        return true;
+
 #if USE(PLATFORM_STRATEGIES)
     platformStrategies()->loaderStrategy()->resourceLoadScheduler()->addMainResourceLoad(this);
 #else
@@ -602,10 +641,12 @@
 
     if (m_substituteData.isValid())
         handleSubstituteDataLoadSoon(r);
+    else if (shouldLoadEmpty || frameLoader()->client()->representationExistsForURLScheme(url.protocol()))
+        handleEmptyLoad(url, !shouldLoadEmpty);
     else
         m_handle = ResourceHandle::create(m_frame->loader()->networkingContext(), r, this, false, true);
 
-    return;
+    return false;
 }
 
 void MainResourceLoader::load(const ResourceRequest& r, const SubstituteData& substituteData)
@@ -623,26 +664,23 @@
     documentLoader()->timing()->markFetchStart();
     ResourceRequest request(r);
 
-    // Send this synthetic delegate callback since clients expect it, and
-    // we no longer send the callback from within NSURLConnection for
-    // initial requests.
-    willSendRequest(request, ResourceResponse());
-    ASSERT(!deletionHasBegun());
+    documentLoader()->applicationCacheHost()->maybeLoadMainResource(request, m_substituteData);
 
-    // <rdar://problem/4801066>
-    // willSendRequest() is liable to make the call to frameLoader() return null, so we need to check that here
-    if (!frameLoader() || request.isNull()) {
-        if (!reachedTerminalState())
-            releaseResources();
-        return;
+    bool defer = defersLoading();
+    if (defer) {
+        bool shouldLoadEmpty = shouldLoadAsEmptyDocument(request.url());
+        if (shouldLoadEmpty)
+            defer = false;
     }
-
-    documentLoader()->applicationCacheHost()->maybeLoadMainResource(request, m_substituteData);
-
-    if (defersLoading())
+    if (!defer) {
+        if (loadNow(request)) {
+            // Started as an empty document, but was redirected to something non-empty.
+            ASSERT(defersLoading());
+            defer = true;
+        }
+    }
+    if (defer)
         m_initialRequest = request;
-    else
-        loadNow(request);
 }
 
 void MainResourceLoader::setDefersLoading(bool defers)

Modified: trunk/Source/WebCore/loader/MainResourceLoader.h (134798 => 134799)


--- trunk/Source/WebCore/loader/MainResourceLoader.h	2012-11-15 18:56:17 UTC (rev 134798)
+++ trunk/Source/WebCore/loader/MainResourceLoader.h	2012-11-15 19:00:12 UTC (rev 134799)
@@ -81,8 +81,9 @@
     virtual void willCancel(const ResourceError&) OVERRIDE;
     virtual void didCancel(const ResourceError&) OVERRIDE;
 
-    void loadNow(ResourceRequest&);
+    bool loadNow(ResourceRequest&);
 
+    void handleEmptyLoad(const KURL&, bool forURLScheme);
     void handleSubstituteDataLoadSoon(const ResourceRequest&);
     void handleSubstituteDataLoadNow(MainResourceLoaderTimer*);
 

Modified: trunk/Tools/ChangeLog (134798 => 134799)


--- trunk/Tools/ChangeLog	2012-11-15 18:56:17 UTC (rev 134798)
+++ trunk/Tools/ChangeLog	2012-11-15 19:00:12 UTC (rev 134799)
@@ -1,3 +1,16 @@
+2012-11-15  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r134649 and r134665.
+        http://trac.webkit.org/changeset/134649
+        http://trac.webkit.org/changeset/134665
+        https://bugs.webkit.org/show_bug.cgi?id=102413
+
+        Broke a ton of downstream chromium tests (Requested by japhet
+        on #webkit).
+
+        * DumpRenderTree/chromium/WebViewHost.cpp:
+        (WebViewHost::updateForCommittedLoad):
+
 2012-11-15  Andreas Kling  <[email protected]>
 
         Update my e-mail address.

Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp (134798 => 134799)


--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp	2012-11-15 18:56:17 UTC (rev 134798)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp	2012-11-15 19:00:12 UTC (rev 134799)
@@ -1628,8 +1628,7 @@
 {
     // Code duplicated from RenderView::DidCommitLoadForFrame.
     TestShellExtraData* extraData = static_cast<TestShellExtraData*>(frame->dataSource()->extraData());
-    const WebURL& url = ""
-    bool nonBlankPageAfterReset = m_pageId == -1 && !url.isEmpty() && strcmp(url.spec().data(), "about:blank");
+    bool nonBlankPageAfterReset = m_pageId == -1 && strcmp(frame->dataSource()->request().url().spec().data(), "about:blank");
 
     if (isNewNavigation || nonBlankPageAfterReset) {
         // New navigation.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to