mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
LibWeb: Move DOM classes into the Web::DOM namespace
LibWeb keeps growing and the Web namespace is filling up fast. Let's put DOM stuff into Web::DOM, just like we already started doing with SVG stuff in Web::SVG.
This commit is contained in:
parent
96d13f75cf
commit
11ff9d0f17
178 changed files with 516 additions and 523 deletions
|
@ -28,7 +28,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLAnchorElement::HTMLAnchorElement(Document& document, const FlyString& tag_name)
|
||||
HTMLAnchorElement::HTMLAnchorElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Web {
|
|||
|
||||
class HTMLAnchorElement : public HTMLElement {
|
||||
public:
|
||||
HTMLAnchorElement(Document&, const FlyString& local_name);
|
||||
HTMLAnchorElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLAnchorElement() override;
|
||||
|
||||
String href() const { return attribute(HTML::AttributeNames::href); }
|
||||
|
@ -42,5 +42,5 @@ public:
|
|||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLAnchorElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_element() && downcast<Web::Element>(node).local_name() == Web::HTML::TagNames::a; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_element() && downcast<Web::DOM::Element>(node).local_name() == Web::HTML::TagNames::a; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLBRElement::HTMLBRElement(Document& document, const FlyString& tag_name)
|
||||
HTMLBRElement::HTMLBRElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Web {
|
|||
|
||||
class HTMLBRElement final : public HTMLElement {
|
||||
public:
|
||||
HTMLBRElement(Document&, const FlyString& local_name);
|
||||
HTMLBRElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLBRElement() override;
|
||||
|
||||
virtual RefPtr<LayoutNode> create_layout_node(const StyleProperties* parent_style) override;
|
||||
|
@ -41,5 +41,5 @@ public:
|
|||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLBRElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_element() && downcast<Web::Element>(node).local_name() == Web::HTML::TagNames::br; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_element() && downcast<Web::DOM::Element>(node).local_name() == Web::HTML::TagNames::br; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLBlinkElement::HTMLBlinkElement(Document& document, const FlyString& tag_name)
|
||||
HTMLBlinkElement::HTMLBlinkElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
, m_timer(Core::Timer::construct())
|
||||
{
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace Web {
|
|||
|
||||
class HTMLBlinkElement : public HTMLElement {
|
||||
public:
|
||||
HTMLBlinkElement(Document&, const FlyString& local_name);
|
||||
HTMLBlinkElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLBlinkElement() override;
|
||||
|
||||
private:
|
||||
|
@ -45,5 +45,5 @@ private:
|
|||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLBlinkElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_element() && downcast<Web::Element>(node).local_name() == Web::HTML::TagNames::blink; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_element() && downcast<Web::DOM::Element>(node).local_name() == Web::HTML::TagNames::blink; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLBodyElement::HTMLBodyElement(Document& document, const FlyString& tag_name)
|
||||
HTMLBodyElement::HTMLBodyElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ void HTMLBodyElement::parse_attribute(const FlyString& name, const String& value
|
|||
if (color.has_value())
|
||||
document().set_visited_link_color(color.value());
|
||||
} else if (name.equals_ignoring_case("background")) {
|
||||
m_background_style_value = ImageStyleValue::create(document().complete_url(value), const_cast<Document&>(document()));
|
||||
m_background_style_value = ImageStyleValue::create(document().complete_url(value), const_cast<DOM::Document&>(document()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Web {
|
|||
|
||||
class HTMLBodyElement : public HTMLElement {
|
||||
public:
|
||||
HTMLBodyElement(Document&, const FlyString& local_name);
|
||||
HTMLBodyElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLBodyElement() override;
|
||||
|
||||
virtual void parse_attribute(const FlyString&, const String&) override;
|
||||
|
@ -45,5 +45,5 @@ private:
|
|||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLBodyElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_element() && downcast<Web::Element>(node).local_name() == Web::HTML::TagNames::body; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_element() && downcast<Web::DOM::Element>(node).local_name() == Web::HTML::TagNames::body; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace Web {
|
|||
|
||||
static constexpr auto max_canvas_area = 16384 * 16384;
|
||||
|
||||
HTMLCanvasElement::HTMLCanvasElement(Document& document, const FlyString& tag_name)
|
||||
HTMLCanvasElement::HTMLCanvasElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ class HTMLCanvasElement : public HTMLElement {
|
|||
public:
|
||||
using WrapperType = Bindings::HTMLCanvasElementWrapper;
|
||||
|
||||
HTMLCanvasElement(Document&, const FlyString& local_name);
|
||||
HTMLCanvasElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLCanvasElement() override;
|
||||
|
||||
const Gfx::Bitmap* bitmap() const { return m_bitmap; }
|
||||
|
@ -60,5 +60,5 @@ private:
|
|||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLCanvasElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_element() && downcast<Web::Element>(node).local_name() == Web::HTML::TagNames::canvas; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_element() && downcast<Web::DOM::Element>(node).local_name() == Web::HTML::TagNames::canvas; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLElement::HTMLElement(Document& document, const FlyString& tag_name)
|
||||
HTMLElement::HTMLElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: Element(document, tag_name)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -30,11 +30,11 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
class HTMLElement : public Element {
|
||||
class HTMLElement : public DOM::Element {
|
||||
public:
|
||||
using WrapperType = Bindings::HTMLElementWrapper;
|
||||
|
||||
HTMLElement(Document&, const FlyString& local_name);
|
||||
HTMLElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLElement() override;
|
||||
|
||||
String title() const { return attribute(HTML::AttributeNames::title); }
|
||||
|
@ -46,5 +46,5 @@ private:
|
|||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_html_element(); }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_html_element(); }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLFontElement::HTMLFontElement(Document& document, const FlyString& tag_name)
|
||||
HTMLFontElement::HTMLFontElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Web {
|
|||
|
||||
class HTMLFontElement : public HTMLElement {
|
||||
public:
|
||||
HTMLFontElement(Document&, const FlyString& local_name);
|
||||
HTMLFontElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLFontElement() override;
|
||||
|
||||
virtual void apply_presentational_hints(StyleProperties&) const override;
|
||||
|
@ -41,5 +41,5 @@ public:
|
|||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLFontElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_element() && downcast<Web::Element>(node).local_name() == Web::HTML::TagNames::font; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_element() && downcast<Web::DOM::Element>(node).local_name() == Web::HTML::TagNames::font; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLFormElement::HTMLFormElement(Document& document, const FlyString& tag_name)
|
||||
HTMLFormElement::HTMLFormElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace Web {
|
|||
|
||||
class HTMLFormElement : public HTMLElement {
|
||||
public:
|
||||
HTMLFormElement(Document&, const FlyString& local_name);
|
||||
HTMLFormElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLFormElement() override;
|
||||
|
||||
String action() const { return attribute(HTML::AttributeNames::action); }
|
||||
|
@ -45,5 +45,5 @@ public:
|
|||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLFormElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::form; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::form; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLHRElement::HTMLHRElement(Document& document, const FlyString& tag_name)
|
||||
HTMLHRElement::HTMLHRElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -32,12 +32,12 @@ namespace Web {
|
|||
|
||||
class HTMLHRElement : public HTMLElement {
|
||||
public:
|
||||
HTMLHRElement(Document&, const FlyString& local_name);
|
||||
HTMLHRElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLHRElement() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLHRElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::hr; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::hr; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLHeadElement::HTMLHeadElement(Document& document, const FlyString& tag_name)
|
||||
HTMLHeadElement::HTMLHeadElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -32,12 +32,12 @@ namespace Web {
|
|||
|
||||
class HTMLHeadElement : public HTMLElement {
|
||||
public:
|
||||
HTMLHeadElement(Document&, const FlyString& local_name);
|
||||
HTMLHeadElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLHeadElement() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLHeadElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_element() && downcast<Web::Element>(node).local_name() == Web::HTML::TagNames::head; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_element() && downcast<Web::DOM::Element>(node).local_name() == Web::HTML::TagNames::head; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLHeadingElement::HTMLHeadingElement(Document& document, const FlyString& tag_name)
|
||||
HTMLHeadingElement::HTMLHeadingElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Web {
|
|||
|
||||
class HTMLHeadingElement : public HTMLElement {
|
||||
public:
|
||||
HTMLHeadingElement(Document&, const FlyString& local_name);
|
||||
HTMLHeadingElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLHeadingElement() override;
|
||||
};
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLHtmlElement::HTMLHtmlElement(Document& document, const FlyString& tag_name)
|
||||
HTMLHtmlElement::HTMLHtmlElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -32,12 +32,12 @@ namespace Web {
|
|||
|
||||
class HTMLHtmlElement : public HTMLElement {
|
||||
public:
|
||||
HTMLHtmlElement(Document&, const FlyString& local_name);
|
||||
HTMLHtmlElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLHtmlElement() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLHtmlElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::html; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::html; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLIFrameElement::HTMLIFrameElement(Document& document, const FlyString& tag_name)
|
||||
HTMLIFrameElement::HTMLIFrameElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ void HTMLIFrameElement::load_src(const String& value)
|
|||
m_hosted_frame->loader().load(url, FrameLoader::Type::IFrame);
|
||||
}
|
||||
|
||||
const Document* HTMLIFrameElement::hosted_document() const
|
||||
const DOM::Document* HTMLIFrameElement::hosted_document() const
|
||||
{
|
||||
return m_hosted_frame ? m_hosted_frame->document() : nullptr;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Web {
|
|||
|
||||
class HTMLIFrameElement final : public HTMLElement {
|
||||
public:
|
||||
HTMLIFrameElement(Document&, const FlyString& local_name);
|
||||
HTMLIFrameElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLIFrameElement() override;
|
||||
|
||||
virtual RefPtr<LayoutNode> create_layout_node(const StyleProperties* parent_style) override;
|
||||
|
@ -40,7 +40,7 @@ public:
|
|||
Frame* hosted_frame() { return m_hosted_frame; }
|
||||
const Frame* hosted_frame() const { return m_hosted_frame; }
|
||||
|
||||
const Document* hosted_document() const;
|
||||
const DOM::Document* hosted_document() const;
|
||||
|
||||
private:
|
||||
virtual void document_did_attach_to_frame(Frame&) override;
|
||||
|
@ -54,5 +54,5 @@ private:
|
|||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLIFrameElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::iframe; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::iframe; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -37,18 +37,18 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLImageElement::HTMLImageElement(Document& document, const FlyString& tag_name)
|
||||
HTMLImageElement::HTMLImageElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
m_image_loader.on_load = [this] {
|
||||
this->document().update_layout();
|
||||
dispatch_event(Event::create("load"));
|
||||
dispatch_event(DOM::Event::create("load"));
|
||||
};
|
||||
|
||||
m_image_loader.on_fail = [this] {
|
||||
dbg() << "HTMLImageElement: Resource did fail: " << this->src();
|
||||
this->document().update_layout();
|
||||
dispatch_event(Event::create("error"));
|
||||
dispatch_event(DOM::Event::create("error"));
|
||||
};
|
||||
|
||||
m_image_loader.on_animate = [this] {
|
||||
|
|
|
@ -40,7 +40,7 @@ class HTMLImageElement final : public HTMLElement {
|
|||
public:
|
||||
using WrapperType = Bindings::HTMLImageElementWrapper;
|
||||
|
||||
HTMLImageElement(Document&, const FlyString& local_name);
|
||||
HTMLImageElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLImageElement() override;
|
||||
|
||||
virtual void parse_attribute(const FlyString& name, const String& value) override;
|
||||
|
@ -63,5 +63,5 @@ private:
|
|||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLImageElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_element() && downcast<Web::Element>(node).local_name() == Web::HTML::TagNames::img; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_element() && downcast<Web::DOM::Element>(node).local_name() == Web::HTML::TagNames::img; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLInputElement::HTMLInputElement(Document& document, const FlyString& tag_name)
|
||||
HTMLInputElement::HTMLInputElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ RefPtr<LayoutNode> HTMLInputElement::create_layout_node(const StyleProperties* p
|
|||
int text_width = Gfx::Font::default_font().width(value());
|
||||
button.set_relative_rect(0, 0, text_width + 20, 20);
|
||||
button.on_click = [this](auto) {
|
||||
const_cast<HTMLInputElement*>(this)->dispatch_event(Event::create("click"));
|
||||
const_cast<HTMLInputElement*>(this)->dispatch_event(DOM::Event::create("click"));
|
||||
};
|
||||
widget = button;
|
||||
} else {
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Web {
|
|||
|
||||
class HTMLInputElement : public HTMLElement {
|
||||
public:
|
||||
HTMLInputElement(Document&, const FlyString& local_name);
|
||||
HTMLInputElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLInputElement() override;
|
||||
|
||||
virtual RefPtr<LayoutNode> create_layout_node(const StyleProperties* parent_style) override;
|
||||
|
@ -45,5 +45,5 @@ public:
|
|||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLInputElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::input; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::input; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLLinkElement::HTMLLinkElement(Document& document, const FlyString& tag_name)
|
||||
HTMLLinkElement::HTMLLinkElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ class HTMLLinkElement final
|
|||
: public HTMLElement
|
||||
, public ResourceClient {
|
||||
public:
|
||||
HTMLLinkElement(Document&, const FlyString& local_name);
|
||||
HTMLLinkElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLLinkElement() override;
|
||||
|
||||
virtual void inserted_into(Node&) override;
|
||||
|
@ -67,5 +67,5 @@ private:
|
|||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLLinkElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::link; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::link; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLObjectElement::HTMLObjectElement(Document& document, const FlyString& tag_name)
|
||||
HTMLObjectElement::HTMLObjectElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
m_image_loader.on_load = [this] {
|
||||
|
|
|
@ -37,7 +37,7 @@ class LayoutDocument;
|
|||
|
||||
class HTMLObjectElement final : public HTMLElement {
|
||||
public:
|
||||
HTMLObjectElement(Document&, const FlyString& local_name);
|
||||
HTMLObjectElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLObjectElement() override;
|
||||
|
||||
virtual void parse_attribute(const FlyString& name, const String& value) override;
|
||||
|
@ -55,5 +55,5 @@ private:
|
|||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLObjectElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_element() && downcast<Web::Element>(node).local_name() == Web::HTML::TagNames::object; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_element() && downcast<Web::DOM::Element>(node).local_name() == Web::HTML::TagNames::object; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLScriptElement::HTMLScriptElement(Document& document, const FlyString& tag_name)
|
||||
HTMLScriptElement::HTMLScriptElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ HTMLScriptElement::~HTMLScriptElement()
|
|||
{
|
||||
}
|
||||
|
||||
void HTMLScriptElement::set_parser_document(Badge<HTMLDocumentParser>, Document& document)
|
||||
void HTMLScriptElement::set_parser_document(Badge<HTMLDocumentParser>, DOM::Document& document)
|
||||
{
|
||||
m_parser_document = document.make_weak_ptr();
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ void HTMLScriptElement::prepare_script(Badge<HTMLDocumentParser>)
|
|||
{
|
||||
if (m_already_started)
|
||||
return;
|
||||
RefPtr<Document> parser_document = m_parser_document.ptr();
|
||||
RefPtr<DOM::Document> parser_document = m_parser_document.ptr();
|
||||
m_parser_document = nullptr;
|
||||
|
||||
if (parser_document && !has_attribute(HTML::AttributeNames::async)) {
|
||||
|
|
|
@ -33,14 +33,14 @@ namespace Web {
|
|||
|
||||
class HTMLScriptElement : public HTMLElement {
|
||||
public:
|
||||
HTMLScriptElement(Document&, const FlyString& local_name);
|
||||
HTMLScriptElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLScriptElement() override;
|
||||
|
||||
bool is_non_blocking() const { return m_non_blocking; }
|
||||
bool is_ready_to_be_parser_executed() const { return m_ready_to_be_parser_executed; }
|
||||
bool failed_to_load() const { return m_failed_to_load; }
|
||||
|
||||
void set_parser_document(Badge<HTMLDocumentParser>, Document&);
|
||||
void set_parser_document(Badge<HTMLDocumentParser>, DOM::Document&);
|
||||
void set_non_blocking(Badge<HTMLDocumentParser>, bool);
|
||||
void set_already_started(Badge<HTMLDocumentParser>, bool b) { m_already_started = b; }
|
||||
void prepare_script(Badge<HTMLDocumentParser>);
|
||||
|
@ -50,8 +50,8 @@ private:
|
|||
void script_became_ready();
|
||||
void when_the_script_is_ready(Function<void()>);
|
||||
|
||||
WeakPtr<Document> m_parser_document;
|
||||
WeakPtr<Document> m_preparation_time_document;
|
||||
WeakPtr<DOM::Document> m_parser_document;
|
||||
WeakPtr<DOM::Document> m_preparation_time_document;
|
||||
bool m_non_blocking { false };
|
||||
bool m_already_started { false };
|
||||
bool m_parser_inserted { false };
|
||||
|
@ -68,5 +68,5 @@ private:
|
|||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLScriptElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::script; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::script; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLStyleElement::HTMLStyleElement(Document& document, const FlyString& tag_name)
|
||||
HTMLStyleElement::HTMLStyleElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
}
|
||||
|
@ -45,8 +45,8 @@ void HTMLStyleElement::children_changed()
|
|||
{
|
||||
StringBuilder builder;
|
||||
for_each_child([&](auto& child) {
|
||||
if (is<Text>(child))
|
||||
builder.append(downcast<Text>(child).text_content());
|
||||
if (is<DOM::Text>(child))
|
||||
builder.append(downcast<DOM::Text>(child).text_content());
|
||||
});
|
||||
m_stylesheet = parse_css(CSS::ParsingContext(document()), builder.to_string());
|
||||
if (m_stylesheet)
|
||||
|
|
|
@ -34,7 +34,7 @@ class StyleSheet;
|
|||
|
||||
class HTMLStyleElement : public HTMLElement {
|
||||
public:
|
||||
HTMLStyleElement(Document&, const FlyString& local_name);
|
||||
HTMLStyleElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLStyleElement() override;
|
||||
|
||||
virtual void children_changed() override;
|
||||
|
@ -47,5 +47,5 @@ private:
|
|||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLStyleElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::style; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::style; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLTableCellElement::HTMLTableCellElement(Document& document, const FlyString& tag_name)
|
||||
HTMLTableCellElement::HTMLTableCellElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Web {
|
|||
|
||||
class HTMLTableCellElement final : public HTMLElement {
|
||||
public:
|
||||
HTMLTableCellElement(Document&, const FlyString& local_name);
|
||||
HTMLTableCellElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLTableCellElement() override;
|
||||
|
||||
private:
|
||||
|
@ -42,5 +42,5 @@ private:
|
|||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLTableCellElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::td; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::td; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLTableElement::HTMLTableElement(Document& document, const FlyString& tag_name)
|
||||
HTMLTableElement::HTMLTableElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Web {
|
|||
|
||||
class HTMLTableElement final : public HTMLElement {
|
||||
public:
|
||||
HTMLTableElement(Document&, const FlyString& local_name);
|
||||
HTMLTableElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLTableElement() override;
|
||||
|
||||
private:
|
||||
|
@ -42,5 +42,5 @@ private:
|
|||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLTableElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::table; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::table; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLTableRowElement::HTMLTableRowElement(Document& document, const FlyString& tag_name)
|
||||
HTMLTableRowElement::HTMLTableRowElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -32,12 +32,12 @@ namespace Web {
|
|||
|
||||
class HTMLTableRowElement : public HTMLElement {
|
||||
public:
|
||||
HTMLTableRowElement(Document&, const FlyString& local_name);
|
||||
HTMLTableRowElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLTableRowElement() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLTableRowElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::tr; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::tr; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
HTMLTitleElement::HTMLTitleElement(Document& document, const FlyString& tag_name)
|
||||
HTMLTitleElement::HTMLTitleElement(DOM::Document& document, const FlyString& tag_name)
|
||||
: HTMLElement(document, tag_name)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -32,12 +32,12 @@ namespace Web {
|
|||
|
||||
class HTMLTitleElement : public HTMLElement {
|
||||
public:
|
||||
HTMLTitleElement(Document&, const FlyString& local_name);
|
||||
HTMLTitleElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLTitleElement() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTMLTitleElement)
|
||||
static bool is_type(const Web::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::title; }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_html_element() && downcast<Web::HTMLElement>(node).local_name() == Web::HTML::TagNames::title; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue