LibHTML: Implement basic HTMLElement.title support

We now show a tooltip for the hovered node's enclosing HTML element's
title attribute, if one is present.

This patch also adds HTMLHeadingElement. The tags h1-h6 will now create
the right kind of objects.
This commit is contained in:
Andreas Kling 2019-09-29 12:24:36 +02:00
commit f38b0f667e
Notes: sideshowbarker 2024-07-19 11:53:45 +09:00
4 changed files with 28 additions and 3 deletions

View file

@ -81,3 +81,10 @@ const HTMLAnchorElement* Node::enclosing_link_element() const
return static_cast<const HTMLAnchorElement*>(this);
return parent() ? parent()->enclosing_link_element() : nullptr;
}
const HTMLElement* Node::enclosing_html_element() const
{
if (is_html_element())
return static_cast<const HTMLElement*>(this);
return parent() ? parent()->enclosing_html_element() : nullptr;
}