mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Add HTMLToken(Type) constructor and use it
This commit is contained in:
parent
f2e3c770f9
commit
25cba4387b
Notes:
sideshowbarker
2024-07-18 08:52:43 +09:00
Author: https://github.com/MaxWipfli
Commit: 25cba4387b
Pull-request: https://github.com/SerenityOS/serenity/pull/8784
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/alimpfard
2 changed files with 10 additions and 6 deletions
|
@ -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; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue