mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 19:05:08 +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:
parent
41f84deb9f
commit
0695236408
11 changed files with 30 additions and 36 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue