mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 17:40:27 +00:00
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.
This commit is contained in:
parent
eb282ad410
commit
d82f3eb085
Notes:
sideshowbarker
2024-07-18 08:53:13 +09:00
Author: https://github.com/MaxWipfli Commit: https://github.com/SerenityOS/serenity/commit/d82f3eb085f Pull-request: https://github.com/SerenityOS/serenity/pull/8784 Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/alimpfard
1 changed files with 20 additions and 19 deletions
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
||||||
|
* Copyright (c) 2021, Max Wipfli <max.wipfli@serenityos.org>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -29,6 +30,22 @@ public:
|
||||||
EndOfFile,
|
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)
|
static HTMLToken make_character(u32 code_point)
|
||||||
{
|
{
|
||||||
HTMLToken token;
|
HTMLToken token;
|
||||||
|
@ -158,32 +175,16 @@ public:
|
||||||
|
|
||||||
String to_string() const;
|
String to_string() const;
|
||||||
|
|
||||||
auto const& start_position() const { return m_start_position; }
|
Position const& start_position() const { return m_start_position; }
|
||||||
auto const& end_position() const { return m_end_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());
|
VERIFY(is_start_tag() || is_end_tag());
|
||||||
return m_tag.attributes;
|
return m_tag.attributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
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 m_type { Type::Invalid };
|
||||||
|
|
||||||
// Type::DOCTYPE
|
// Type::DOCTYPE
|
||||||
|
|
Loading…
Reference in a new issue