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

Unified Diff: third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.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. 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/xml/parser/XMLDocumentParser.cpp
diff --git a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
index 9f79b05e40110b02fdf360f9829b6a420e7c9d8c..c189c330cb88c94488c21bebf9da97b0465ab9ba 100644
--- a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
+++ b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
@@ -1071,8 +1071,11 @@ void XMLDocumentParser::startElementNs(const AtomicString& localName, const Atom
if (isHTMLHtmlElement(*newElement))
toHTMLHtmlElement(*newElement).insertedByParser();
- if (!m_parsingFragment && isFirstElement && document()->frame())
+ if (!m_parsingFragment && isFirstElement && document()->frame()) {
document()->frame()->loader().dispatchDocumentElementAvailable();
+ document()->frame()->loader().runScriptsAtDocumentElementAvailable();
+ // runScriptsAtDocumentElementAvailable might have invalidated the document.
+ }
}
void XMLDocumentParser::endElementNs()
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoaderClient.h ('k') | third_party/WebKit/Source/web/FrameLoaderClientImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698