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

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

Issue 2126043003: Refactor HTMLTreeBuilder/HTMLConstructionSite ctor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase / add comment Created 4 years, 5 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/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 9fd1a0b446158b3f8ce29890994172988ff792e1..7acad445700ff649f64672fbf26eef2612806f35 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp
@@ -313,26 +313,25 @@ void HTMLConstructionSite::executeQueuedTasks()
// We might be detached now.
}
-HTMLConstructionSite::HTMLConstructionSite(Document* document, ParserContentPolicy parserContentPolicy)
- : m_document(document)
+HTMLConstructionSite::HTMLConstructionSite(Document& document, ParserContentPolicy parserContentPolicy)
+ : m_document(&document)
, m_attachmentRoot(document)
, m_parserContentPolicy(parserContentPolicy)
, m_isParsingFragment(false)
, m_redirectAttachToFosterParent(false)
- , m_inQuirksMode(document->inQuirksMode())
+ , m_inQuirksMode(document.inQuirksMode())
{
ASSERT(m_document->isHTMLDocument() || m_document->isXHTMLDocument());
}
-HTMLConstructionSite::HTMLConstructionSite(DocumentFragment* fragment, ParserContentPolicy parserContentPolicy)
- : m_document(&fragment->document())
- , m_attachmentRoot(fragment)
- , m_parserContentPolicy(parserContentPolicy)
- , m_isParsingFragment(true)
- , m_redirectAttachToFosterParent(false)
- , m_inQuirksMode(fragment->document().inQuirksMode())
+void HTMLConstructionSite::initFragmentParsing(DocumentFragment* fragment)
{
- ASSERT(m_document->isHTMLDocument() || m_document->isXHTMLDocument());
+ DCHECK_EQ(m_document, &fragment->document());
+ DCHECK_EQ(m_inQuirksMode, fragment->document().inQuirksMode());
+ DCHECK(!m_isParsingFragment);
+
+ m_attachmentRoot = fragment;
+ m_isParsingFragment = true;
}
HTMLConstructionSite::~HTMLConstructionSite()

Powered by Google App Engine
This is Rietveld 408576698