Chromium Code Reviews

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp

Issue 1642283002: Deal with frame removal by content scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Last nits Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp b/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp
index cc5344d24e8ff07e7371e4340fbfbfc544fc5005..be72275e02a68dbe8831b25dd1cbe98a5638c44b 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp
@@ -383,8 +383,11 @@ PassRefPtrWillBeRawPtr<HTMLFormElement> HTMLConstructionSite::takeForm()
void HTMLConstructionSite::dispatchDocumentElementAvailableIfNeeded()
{
ASSERT(m_document);
- if (m_document->frame() && !m_isParsingFragment)
+ if (m_document->frame() && !m_isParsingFragment) {
m_document->frame()->loader().dispatchDocumentElementAvailable();
+ m_document->frame()->loader().runScriptsAtDocumentElementAvailable();
+ // runScriptsAtDocumentElementAvailable might have invalidated m_document.
+ }
}
void HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML(AtomicHTMLToken* token)
« no previous file with comments | « third_party/WebKit/Source/core/html/PluginDocument.cpp ('k') | third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine