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

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

Issue 2386893002: Reformat comments in core/html/parser (Closed)
Patch Set: self review Created 4 years, 2 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 609f8c6708a93d4c273b2181e70422f816609e53..710add369393c44bab8002a563bea448dd10bb18 100644
--- a/third_party/WebKit/Source/core/html/parser/TextDocumentParser.cpp
+++ b/third_party/WebKit/Source/core/html/parser/TextDocumentParser.cpp
@@ -47,17 +47,20 @@ void TextDocumentParser::appendBytes(const char* data, size_t length) {
void TextDocumentParser::insertFakePreElement() {
// In principle, we should create a specialized tree builder for
- // TextDocuments, but instead we re-use the existing HTMLTreeBuilder.
- // We create a fake token and give it to the tree builder rather than
- // sending fake bytes through the front-end of the parser to avoid
- // distrubing the line/column number calculations.
+ // TextDocuments, but instead we re-use the existing HTMLTreeBuilder. We
+ // create a fake token and give it to the tree builder rather than sending
+ // fake bytes through the front-end of the parser to avoid distrubing the
+ // line/column number calculations.
Vector<Attribute> attributes;
attributes.append(
Attribute(styleAttr, "word-wrap: break-word; white-space: pre-wrap;"));
AtomicHTMLToken fakePre(HTMLToken::StartTag, preTag.localName(), attributes);
treeBuilder()->constructTree(&fakePre);
+
+ // The document could have been detached by an extension while the
+ // tree was being constructed.
if (isStopped())
- return; // The document could have been detached by an extension while the tree was being constructed.
+ return;
// 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