mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
LibWeb: Simplify Node::is_link()
No need to check for presence of the href attribute as that is already checked by enclosing_link_element().
This commit is contained in:
parent
483b371a7b
commit
256898431c
Notes:
sideshowbarker
2024-07-19 05:41:17 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/256898431c2
1 changed files with 1 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue