1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:17:35 +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:
Andreas Kling 2019-09-29 16:24:57 +02:00
parent 0c6af2d5b4
commit b94c7665a9
12 changed files with 116 additions and 1 deletions

View file

@ -1,12 +1,14 @@
#pragma once
#include <AK/String.h>
#include <AK/NonnullRefPtrVector.h>
#include <AK/OwnPtr.h>
#include <AK/String.h>
#include <LibHTML/CSS/StyleResolver.h>
#include <LibHTML/CSS/StyleSheet.h>
#include <LibHTML/DOM/ParentNode.h>
class HTMLHtmlElement;
class HTMLHeadElement;
class LayoutNode;
class StyleResolver;
class StyleSheet;
@ -29,6 +31,11 @@ public:
Node* hovered_node() { return m_hovered_node; }
const Node* hovered_node() const { return m_hovered_node; }
const HTMLHtmlElement* document_element() const;
const HTMLHeadElement* head() const;
String title() const;
private:
OwnPtr<StyleResolver> m_style_resolver;
NonnullRefPtrVector<StyleSheet> m_sheets;