summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-06-13 00:22:41 +0200
committerAndreas Kling <kling@serenityos.org>2020-06-13 00:23:32 +0200
commit256898431c23129dfa8cc72e65aaacc6a91aa39c (patch)
tree1c4fa232064f86bc0a4b77d09154290c37f00bd9
parent483b371a7b117c83fb544cf5aae1df6b53d44e51 (diff)
downloadserenity-256898431c23129dfa8cc72e65aaacc6a91aa39c.zip
LibWeb: Simplify Node::is_link()
No need to check for presence of the href attribute as that is already checked by enclosing_link_element().
-rw-r--r--Libraries/LibWeb/DOM/Node.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/Libraries/LibWeb/DOM/Node.cpp b/Libraries/LibWeb/DOM/Node.cpp
index 8d8f5bd2d9..055bb353c5 100644
--- a/Libraries/LibWeb/DOM/Node.cpp
+++ b/Libraries/LibWeb/DOM/Node.cpp
@@ -124,10 +124,7 @@ void Node::invalidate_style()
bool Node::is_link() const
{
- auto* enclosing_link = enclosing_link_element();
- if (!enclosing_link)
- return false;
- return enclosing_link->has_attribute(HTML::AttributeNames::href);
+ return enclosing_link_element();
}
void Node::dispatch_event(NonnullRefPtr<Event> event)