diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h b/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h index c51a43fc8f..a986e1442b 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h @@ -62,20 +62,25 @@ public: static HTMLToken make_character(u32 code_point) { - HTMLToken token; - token.m_type = Type::Character; + HTMLToken token { Type::Character }; token.set_code_point(code_point); return token; } static HTMLToken make_start_tag(FlyString const& tag_name) { - HTMLToken token; - token.m_type = Type::StartTag; + HTMLToken token { Type::StartTag }; token.set_tag_name(tag_name); return token; } + HTMLToken() = default; + + HTMLToken(Type type) + : m_type(type) + { + } + bool is_doctype() const { return m_type == Type::DOCTYPE; } bool is_start_tag() const { return m_type == Type::StartTag; } bool is_end_tag() const { return m_type == Type::EndTag; } |