Chromium Code Reviews| Index: Source/core/loader/FrameLoader.cpp |
| diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp |
| index 047ab371aa46faef6adf253bf99c57d34fe263e5..46a926c889d5425d9540b42a79fc65cef146130a 100644 |
| --- a/Source/core/loader/FrameLoader.cpp |
| +++ b/Source/core/loader/FrameLoader.cpp |
| @@ -501,9 +501,12 @@ void FrameLoader::didExplicitOpen() |
| m_didCallImplicitClose = false; |
| // Calling document.open counts as committing the first real document load. |
| - if (!m_stateMachine.committedFirstRealDocumentLoad()) |
| + if (!m_stateMachine.committedFirstRealDocumentLoad()) { |
| m_stateMachine.advanceTo(FrameLoaderStateMachine::DisplayingInitialEmptyDocumentPostCommit); |
| - |
| + ASSERT(m_documentLoader); |
| + if (m_frame->ownerElement() && !m_frame->ownerElement()->loadedNonEmptyDocument() && !m_documentLoader->requestURL().isBlankURL() && !m_documentLoader->requestURL().isEmpty()) |
| + m_frame->ownerElement()->didLoadNonEmptyDocument(); |
|
Nate Chapin
2013/04/30 19:55:58
Is there a case where we would load the first non-
Pan
2013/05/07 08:45:52
Yep, for example in iframe, it use "window.locatio
|
| + } |
| // Prevent window.open(url) -- eg window.open("about:blank") -- from blowing away results |
| // from a subsequent window.document.open / window.document.write call. |
| // Canceling redirection here works for all cases because document.open |
| @@ -1048,6 +1051,8 @@ void FrameLoader::prepareForHistoryNavigation() |
| ASSERT(stateMachine()->isDisplayingInitialEmptyDocument()); |
| stateMachine()->advanceTo(FrameLoaderStateMachine::DisplayingInitialEmptyDocumentPostCommit); |
| + if (m_frame->ownerElement() && !m_frame->ownerElement()->loadedNonEmptyDocument() && !currentItem->url().isBlankURL() && !currentItem->url().isEmpty()) |
| + m_frame->ownerElement()->didLoadNonEmptyDocument(); |
| stateMachine()->advanceTo(FrameLoaderStateMachine::CommittedFirstRealLoad); |
| } |
| } |
| @@ -1712,8 +1717,12 @@ void FrameLoader::transitionToCommitted() |
| if (m_stateMachine.creatingInitialEmptyDocument()) |
| return; |
| - if (!m_stateMachine.committedFirstRealDocumentLoad()) |
| + if (!m_stateMachine.committedFirstRealDocumentLoad()) { |
| m_stateMachine.advanceTo(FrameLoaderStateMachine::DisplayingInitialEmptyDocumentPostCommit); |
| + ASSERT(m_documentLoader); |
| + if (m_frame->ownerElement() && !m_frame->ownerElement()->loadedNonEmptyDocument() && !m_documentLoader->requestURL().isBlankURL() && !m_documentLoader->requestURL().isEmpty()) |
| + m_frame->ownerElement()->didLoadNonEmptyDocument(); |
| + } |
| } |
| void FrameLoader::clientRedirectCancelledOrFinished(bool cancelWithLoadInProgress) |