LibWeb: Rename Attribute to Attr

This name is not very good, but it's what the specification calls it.
This commit is contained in:
Andreas Kling 2022-09-18 01:03:58 +02:00
parent 3c3ae3a768
commit 530675993b
Notes: sideshowbarker 2024-07-17 20:58:35 +09:00
18 changed files with 85 additions and 85 deletions

View file

@ -9,7 +9,7 @@
#include <AK/StringView.h>
#include <AK/Utf8View.h>
#include <LibTextCodec/Decoder.h>
#include <LibWeb/DOM/Attribute.h>
#include <LibWeb/DOM/Attr.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/Parser/HTMLEncodingDetection.h>
#include <ctype.h>
@ -96,7 +96,7 @@ Optional<StringView> extract_character_encoding_from_meta_element(String const&
return TextCodec::get_standardized_encoding(encoding);
}
JS::GCPtr<DOM::Attribute> prescan_get_attribute(DOM::Document& document, ByteBuffer const& input, size_t& position)
JS::GCPtr<DOM::Attr> prescan_get_attribute(DOM::Document& document, ByteBuffer const& input, size_t& position)
{
if (!prescan_skip_whitespace_and_slashes(input, position))
return {};
@ -111,7 +111,7 @@ JS::GCPtr<DOM::Attribute> prescan_get_attribute(DOM::Document& document, ByteBuf
} else if (input[position] == '\t' || input[position] == '\n' || input[position] == '\f' || input[position] == '\r' || input[position] == ' ')
goto spaces;
else if (input[position] == '/' || input[position] == '>')
return *DOM::Attribute::create(document, attribute_name.to_string(), "");
return *DOM::Attr::create(document, attribute_name.to_string(), "");
else
attribute_name.append_as_lowercase(input[position]);
++position;
@ -123,7 +123,7 @@ spaces:
if (!prescan_skip_whitespace_and_slashes(input, position))
return {};
if (input[position] != '=')
return DOM::Attribute::create(document, attribute_name.to_string(), "");
return DOM::Attr::create(document, attribute_name.to_string(), "");
++position;
value:
@ -136,13 +136,13 @@ value:
++position;
for (; !prescan_should_abort(input, position); ++position) {
if (input[position] == quote_character)
return DOM::Attribute::create(document, attribute_name.to_string(), attribute_value.to_string());
return DOM::Attr::create(document, attribute_name.to_string(), attribute_value.to_string());
else
attribute_value.append_as_lowercase(input[position]);
}
return {};
} else if (input[position] == '>')
return DOM::Attribute::create(document, attribute_name.to_string(), "");
return DOM::Attr::create(document, attribute_name.to_string(), "");
else
attribute_value.append_as_lowercase(input[position]);
@ -152,7 +152,7 @@ value:
for (; !prescan_should_abort(input, position); ++position) {
if (input[position] == '\t' || input[position] == '\n' || input[position] == '\f' || input[position] == '\r' || input[position] == ' ' || input[position] == '>')
return DOM::Attribute::create(document, attribute_name.to_string(), attribute_value.to_string());
return DOM::Attr::create(document, attribute_name.to_string(), attribute_value.to_string());
else
attribute_value.append_as_lowercase(input[position]);
}