mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +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
@@ -899,8 +899,8 @@ ByteString Node::debug_description() const
|
||||
builder.appendff("<{}>", dom_node()->node_name());
|
||||
if (dom_node()->is_element()) {
|
||||
auto& element = static_cast<DOM::Element const&>(*dom_node());
|
||||
if (auto id = element.get_attribute(HTML::AttributeNames::id); id.has_value())
|
||||
builder.appendff("#{}", id.value());
|
||||
if (element.id().has_value())
|
||||
builder.appendff("#{}", element.id().value());
|
||||
for (auto const& class_name : element.class_names())
|
||||
builder.appendff(".{}", class_name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user