mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 19:45:07 +00:00
LibWeb: Move Attribute into the DOM namespace
This commit is contained in:
parent
2d4650714f
commit
cb895edad4
3 changed files with 9 additions and 9 deletions
|
@ -94,7 +94,7 @@ Optional<String> extract_character_encoding_from_meta_element(String const& stri
|
|||
return TextCodec::get_standardized_encoding(encoding);
|
||||
}
|
||||
|
||||
Optional<Attribute> prescan_get_attribute(const ByteBuffer& input, size_t& position)
|
||||
Optional<DOM::Attribute> prescan_get_attribute(const ByteBuffer& input, size_t& position)
|
||||
{
|
||||
if (!prescan_skip_whitespace_and_slashes(input, position))
|
||||
return {};
|
||||
|
@ -109,7 +109,7 @@ Optional<Attribute> prescan_get_attribute(const ByteBuffer& input, size_t& posit
|
|||
} 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 Attribute(attribute_name.to_string(), "");
|
||||
return DOM::Attribute(attribute_name.to_string(), "");
|
||||
else
|
||||
attribute_name.append_as_lowercase(input[position]);
|
||||
++position;
|
||||
|
@ -121,7 +121,7 @@ spaces:
|
|||
if (!prescan_skip_whitespace_and_slashes(input, position))
|
||||
return {};
|
||||
if (input[position] != '=')
|
||||
return Attribute(attribute_name.to_string(), "");
|
||||
return DOM::Attribute(attribute_name.to_string(), "");
|
||||
++position;
|
||||
|
||||
value:
|
||||
|
@ -134,13 +134,13 @@ value:
|
|||
++position;
|
||||
for (; !prescan_should_abort(input, position); ++position) {
|
||||
if (input[position] == quote_character)
|
||||
return Attribute(attribute_name.to_string(), attribute_value.to_string());
|
||||
return DOM::Attribute(attribute_name.to_string(), attribute_value.to_string());
|
||||
else
|
||||
attribute_value.append_as_lowercase(input[position]);
|
||||
}
|
||||
return {};
|
||||
} else if (input[position] == '>')
|
||||
return Attribute(attribute_name.to_string(), "");
|
||||
return DOM::Attribute(attribute_name.to_string(), "");
|
||||
else
|
||||
attribute_value.append_as_lowercase(input[position]);
|
||||
|
||||
|
@ -150,7 +150,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 Attribute(attribute_name.to_string(), attribute_value.to_string());
|
||||
return DOM::Attribute(attribute_name.to_string(), attribute_value.to_string());
|
||||
else
|
||||
attribute_value.append_as_lowercase(input[position]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue