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

LibWeb: Port Element::name to a cached FlyString

Also removing some handling of OOM while we are in the area.
This commit is contained in:
Shannon Booth 2024-01-13 20:12:23 +13:00 committed by Andreas Kling
parent cb9118efe3
commit 41f84deb9f
6 changed files with 22 additions and 24 deletions

View file

@ -459,6 +459,11 @@ void Element::attribute_changed(FlyString const& name, Optional<String> const& v
m_id = {};
else
m_id = value_or_empty;
} else if (name == HTML::AttributeNames::name) {
if (!value.has_value())
m_name = {};
else
m_name = value_or_empty;
} else if (name == HTML::AttributeNames::class_) {
auto new_classes = value_or_empty.bytes_as_string_view().split_view_if(Infra::is_ascii_whitespace);
m_classes.clear();