Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(636)

Unified Diff: Source/core/dom/Document.cpp

Issue 460043002: Remove Document::LoadEventTried, it's not necessary (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Document.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index f4b33bdbf979b63655eae795cbfd430c283a84a7..3bcbf135c3f96d261e1a6b533d7023a260a9c7d9 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -2517,15 +2517,9 @@ void Document::explicitClose()
void Document::implicitClose()
{
ASSERT(!inStyleRecalc());
-
- bool wasLocationChangePending = frame() && frame()->navigationScheduler().locationChangePending();
- bool doload = !parsing() && m_parser && !processingLoadEvent() && !wasLocationChangePending;
-
- // If the load was blocked because of a pending location change and the location change triggers a same document
- // navigation, don't fire load events after the same document navigation completes (unless there's an explicit open).
- m_loadEventProgress = LoadEventTried;
-
- if (!doload)
+ if (processingLoadEvent() || !m_parser)
+ return;
+ if (frame() && frame()->navigationScheduler().locationChangePending())
return;
// The call to dispatchWindowLoadEvent can detach the LocalDOMWindow and cause it (and its
@@ -2653,7 +2647,10 @@ void Document::dispatchUnloadEvents()
if (m_parser)
m_parser->stopParsing();
- if (m_loadEventProgress >= LoadEventTried && m_loadEventProgress <= UnloadEventInProgress) {
+ if (m_loadEventProgress == LoadEventNotRun)
+ return;
+
+ if (m_loadEventProgress <= UnloadEventInProgress) {
Element* currentFocusedElement = focusedElement();
if (isHTMLInputElement(currentFocusedElement))
toHTMLInputElement(*currentFocusedElement).endEditing();
« no previous file with comments | « Source/core/dom/Document.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698