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

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.h

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/HTMLTreeBuilder.h
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.h b/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.h
index e9096c20542b2627d4ecaa223f025be9dc5847c7..9f6ce59d80c200c315bc5bc2eb0feb7cf8b1fa6f 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.h
+++ b/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.h
@@ -49,7 +49,9 @@ class HTMLDocumentParser;
class HTMLTreeBuilder final : public GarbageCollectedFinalized<HTMLTreeBuilder> {
WTF_MAKE_NONCOPYABLE(HTMLTreeBuilder);
public:
- static HTMLTreeBuilder* create(HTMLDocumentParser* parser, HTMLDocument* document, ParserContentPolicy parserContentPolicy, const HTMLParserOptions& options)
+ // HTMLTreeBuilder can be created for non-HTMLDocument (XHTMLDocument) from editing code.
+ // TODO(kouhei): Fix editing code to always invoke HTML parser on HTMLDocument.
+ static HTMLTreeBuilder* create(HTMLDocumentParser* parser, Document& document, ParserContentPolicy parserContentPolicy, const HTMLParserOptions& options)
{
return new HTMLTreeBuilder(parser, document, parserContentPolicy, options);
}
@@ -113,7 +115,7 @@ private:
AfterAfterFramesetMode,
};
- HTMLTreeBuilder(HTMLDocumentParser*, HTMLDocument*, ParserContentPolicy, const HTMLParserOptions&);
+ HTMLTreeBuilder(HTMLDocumentParser*, Document&, ParserContentPolicy, const HTMLParserOptions&);
HTMLTreeBuilder(HTMLDocumentParser*, DocumentFragment*, Element* contextElement, ParserContentPolicy, const HTMLParserOptions&);
void processToken(AtomicHTMLToken*);
@@ -191,9 +193,8 @@ private:
WTF_MAKE_NONCOPYABLE(FragmentParsingContext);
DISALLOW_NEW();
public:
- FragmentParsingContext();
- FragmentParsingContext(DocumentFragment*, Element* contextElement);
- ~FragmentParsingContext();
+ FragmentParsingContext() = default;
+ void init(DocumentFragment*, Element* contextElement);
DocumentFragment* fragment() const { return m_fragment; }
Element* contextElement() const { ASSERT(m_fragment); return m_contextElementStackItem->element(); }

Powered by Google App Engine
This is Rietveld 408576698