mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-07 19:52:55 +00:00
LibHTML: Detect hovering over links
HtmlView now calls Node::enclosing_link_element() to find the nearest ancestor <a> element. This patch also adds HTMLElement and HTMLAnchorElement.
This commit is contained in:
parent
88de955073
commit
b477aff843
Notes:
sideshowbarker
2024-07-19 11:53:50 +09:00
Author: https://github.com/awesomekling
Commit: b477aff843
9 changed files with 60 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
#include <AK/NonnullRefPtrVector.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <LibHTML/DOM/Element.h>
|
||||
#include <LibHTML/DOM/HTMLAnchorElement.h>
|
||||
#include <LibHTML/DOM/Text.h>
|
||||
#include <LibHTML/Parser/HTMLParser.h>
|
||||
#include <ctype.h>
|
||||
|
@ -8,6 +9,8 @@
|
|||
|
||||
static NonnullRefPtr<Element> create_element(Document& document, const String& tag_name)
|
||||
{
|
||||
if (tag_name.to_lowercase() == "a")
|
||||
return adopt(*new HTMLAnchorElement(document, tag_name));
|
||||
return adopt(*new Element(document, tag_name));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue