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

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

Issue 1659013003: Don't reset LoadEventProgress if frame unload has already started. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test Created 4 years, 11 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
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index a6fe87a40f7c79897252a8137154d9adbfcb923e..638b62719866072ccf8a8f6fd3dbe9c9f473bb82 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -2476,7 +2476,10 @@ void Document::open()
if (m_frame)
m_frame->loader().didExplicitOpen();
- if (m_loadEventProgress != LoadEventInProgress && pageDismissalEventBeingDispatched() == NoDismissal)
+ // TODO(dcheng): According to the spec, document.open() during frame detach
+ // should be completely ignored. Add a UMA to measure how often this
+ // happens, and whether or not we can change this behavior to match spec.
+ if (m_loadEventProgress != LoadEventInProgress && !unloadStarted() && !processingBeforeUnload())
m_loadEventProgress = LoadEventNotRun;
}
@@ -2769,8 +2772,10 @@ void Document::dispatchUnloadEvents()
if (m_parser)
m_parser->stopParsing();
- if (m_loadEventProgress == LoadEventNotRun)
+ if (m_loadEventProgress == LoadEventNotRun) {
+ m_loadEventProgress = UnloadEventHandled;
dcheng 2016/02/03 03:13:29 This was the original fix proposed in the bug. I b
return;
+ }
if (m_loadEventProgress <= UnloadEventInProgress) {
Element* currentFocusedElement = focusedElement();

Powered by Google App Engine
This is Rietveld 408576698