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

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: Add more runScriptsAtDocumentElementAvailable + comments Created 4 years, 10 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 2d87cd5784e4a66a840126a9904ff9764e4b7a47..8f5516643920f3ef0a3898966ac619e353df9891 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()

Powered by Google App Engine
This is Rietveld 408576698