mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
LibHTML: Add a way to get a Document's title
You can now query Document::title() to get a String containing whatever is inside the document's <title> tag. In support of this, this patch adds the <html>, <head> and <title> elements.
This commit is contained in:
@@ -46,6 +46,15 @@ public:
|
||||
|
||||
virtual bool is_html_element() const { return false; }
|
||||
|
||||
const Node* first_child_with_tag_name(const StringView& tag_name) const
|
||||
{
|
||||
for (auto* child = first_child(); child; child = child->next_sibling()) {
|
||||
if (child->tag_name() == tag_name)
|
||||
return child;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
protected:
|
||||
Node(Document&, NodeType);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user