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

Unified Diff: third_party/WebKit/Source/core/html/parser/TextDocumentParser.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/html/parser/TextDocumentParser.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/TextDocumentParser.cpp b/third_party/WebKit/Source/core/html/parser/TextDocumentParser.cpp
index d6b8d15d6675e0872b1f271291ad815c8f75dd62..bc1c0c3e143d2cc21802300edb04317cce9f2532 100644
--- a/third_party/WebKit/Source/core/html/parser/TextDocumentParser.cpp
+++ b/third_party/WebKit/Source/core/html/parser/TextDocumentParser.cpp
@@ -60,6 +60,8 @@ void TextDocumentParser::insertFakePreElement()
attributes.append(Attribute(styleAttr, "word-wrap: break-word; white-space: pre-wrap;"));
AtomicHTMLToken fakePre(HTMLToken::StartTag, preTag.localName(), attributes);
treeBuilder()->constructTree(&fakePre);
+ if (isStopped())
+ return; // The document could have been detached by an extension while the tree was being constructed.
// Normally we would skip the first \n after a <pre> element, but we don't
// want to skip the first \n for text documents!

Powered by Google App Engine
This is Rietveld 408576698