1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 17:07:35 +00:00

LibWeb: Change HTMLToken.h to east const style

This commit is contained in:
Max Wipfli 2021-07-12 12:46:54 +02:00 committed by Andreas Kling
parent 125982943a
commit 35f32ac170

View file

@ -40,7 +40,7 @@ public:
return token; return token;
} }
static HTMLToken make_start_tag(const FlyString& tag_name) static HTMLToken make_start_tag(FlyString const& tag_name)
{ {
HTMLToken token; HTMLToken token;
token.m_type = Type::StartTag; token.m_type = Type::StartTag;
@ -104,7 +104,7 @@ public:
m_tag.self_closing_acknowledged = true; m_tag.self_closing_acknowledged = true;
} }
StringView attribute(const FlyString& attribute_name) StringView attribute(FlyString const& attribute_name)
{ {
VERIFY(is_start_tag() || is_end_tag()); VERIFY(is_start_tag() || is_end_tag());
for (auto& attribute : m_tag.attributes) { for (auto& attribute : m_tag.attributes) {
@ -114,19 +114,19 @@ public:
return {}; return {};
} }
bool has_attribute(const FlyString& attribute_name) bool has_attribute(FlyString const& attribute_name)
{ {
return !attribute(attribute_name).is_null(); return !attribute(attribute_name).is_null();
} }
void adjust_tag_name(const FlyString& old_name, const FlyString& new_name) void adjust_tag_name(FlyString const& old_name, FlyString const& new_name)
{ {
VERIFY(is_start_tag() || is_end_tag()); VERIFY(is_start_tag() || is_end_tag());
if (old_name == m_tag.tag_name) if (old_name == m_tag.tag_name)
m_tag.tag_name = new_name; m_tag.tag_name = new_name;
} }
void adjust_attribute_name(const FlyString& old_name, const FlyString& new_name) void adjust_attribute_name(FlyString const& old_name, FlyString const& new_name)
{ {
VERIFY(is_start_tag() || is_end_tag()); VERIFY(is_start_tag() || is_end_tag());
for (auto& attribute : m_tag.attributes) { for (auto& attribute : m_tag.attributes) {
@ -136,7 +136,7 @@ public:
} }
} }
void adjust_foreign_attribute(const FlyString& old_name, const FlyString& prefix, const FlyString& local_name, const FlyString& namespace_) void adjust_foreign_attribute(FlyString const& old_name, FlyString const& prefix, FlyString const& local_name, FlyString const& namespace_)
{ {
VERIFY(is_start_tag() || is_end_tag()); VERIFY(is_start_tag() || is_end_tag());
for (auto& attribute : m_tag.attributes) { for (auto& attribute : m_tag.attributes) {
@ -158,10 +158,10 @@ public:
String to_string() const; String to_string() const;
const auto& start_position() const { return m_start_position; } auto const& start_position() const { return m_start_position; }
const auto& end_position() const { return m_end_position; } auto const& end_position() const { return m_end_position; }
const auto& attributes() const auto 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;