diff options
author | Max Wipfli <mail@maxwipfli.ch> | 2021-07-14 23:15:40 +0200 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-07-17 16:24:57 +0430 |
commit | d82f3eb085fc29474fd7310ccc40540e5c2380c2 (patch) | |
tree | e5e08d6fa6868e634941331e3e1b2427cd377593 /Userland/Libraries/LibWeb | |
parent | eb282ad410b924ab39b8ce91cc5974efdd5b9ff2 (diff) | |
download | serenity-d82f3eb085fc29474fd7310ccc40540e5c2380c2.zip |
LibWeb: Make HTMLToken::{Position,AttributeBuilder} structs public
There was and is no reason for those to be private. Making them public
also allows us to explicitly specify the return type of some getters.
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h b/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h index 232ebae1a8..daf9bfb47f 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2021, Max Wipfli <max.wipfli@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ @@ -29,6 +30,22 @@ public: EndOfFile, }; + struct Position { + size_t line { 0 }; + size_t column { 0 }; + }; + + struct AttributeBuilder { + String prefix; + String local_name; + String namespace_; + String value; + Position name_start_position; + Position value_start_position; + Position name_end_position; + Position value_end_position; + }; + static HTMLToken make_character(u32 code_point) { HTMLToken token; @@ -158,32 +175,16 @@ public: String to_string() const; - auto const& start_position() const { return m_start_position; } - auto const& end_position() const { return m_end_position; } + Position const& start_position() const { return m_start_position; } + Position const& end_position() const { return m_end_position; } - auto const& attributes() const + Vector<Attribute> const& attributes() const { VERIFY(is_start_tag() || is_end_tag()); return m_tag.attributes; } private: - struct Position { - size_t line { 0 }; - size_t column { 0 }; - }; - - struct AttributeBuilder { - String prefix; - String local_name; - String namespace_; - String value; - Position name_start_position; - Position value_start_position; - Position name_end_position; - Position value_end_position; - }; - Type m_type { Type::Invalid }; // Type::DOCTYPE |