mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibWeb: Use cached element name and id where possible
Instead of looking up in the named node map, we can simply use the cached name and ID on the element.
This commit is contained in:
committed by
Andreas Kling
parent
41f84deb9f
commit
0695236408
@@ -76,8 +76,8 @@ WebIDL::ExceptionOr<void> NavigableContainer::create_new_child_navigable()
|
||||
Optional<String> target_name;
|
||||
|
||||
// 5. If element has a name content attribute, then set targetName to the value of that attribute.
|
||||
if (auto value = attribute(HTML::AttributeNames::name); value.has_value())
|
||||
target_name = move(value);
|
||||
if (name().has_value())
|
||||
target_name = name().value().to_string();
|
||||
|
||||
// 6. Let documentState be a new document state, with
|
||||
// - document: document
|
||||
|
||||
Reference in New Issue
Block a user