1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09: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
Notes: sideshowbarker 2024-07-17 07:06:47 +09:00
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();