mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibWeb: Add a non-DeprecatedString version of Element::get_attribute
Renaming the DeprecatedString version of this function to Element::get_deprecated_attribute. While performing this rename, port over functions where it is trivial to do so to the Optional<String> version of this function.
This commit is contained in:
committed by
Andreas Kling
parent
ebe01b51c8
commit
50350fb79c
@@ -858,8 +858,8 @@ DeprecatedString 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.is_null())
|
||||
builder.appendff("#{}", id);
|
||||
if (auto id = element.get_attribute(HTML::AttributeNames::id); id.has_value())
|
||||
builder.appendff("#{}", id.value());
|
||||
for (auto const& class_name : element.class_names())
|
||||
builder.appendff(".{}", class_name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user