1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:57:45 +00:00

LibWeb: Add HTMLElement wrapper

Expose the "title" attribute just to expose something. :^)
This commit is contained in:
Andreas Kling 2020-06-21 14:35:00 +02:00
parent 244b243d22
commit 1914f52371
10 changed files with 36 additions and 14 deletions

View file

@ -39,7 +39,7 @@ namespace Web {
namespace Bindings {
HTMLCanvasElementWrapper::HTMLCanvasElementWrapper(JS::GlobalObject& global_object, HTMLCanvasElement& element)
: ElementWrapper(global_object, element)
: HTMLElementWrapper(global_object, element)
{
}

View file

@ -26,12 +26,12 @@
#pragma once
#include <LibWeb/Bindings/ElementWrapper.h>
#include <LibWeb/Bindings/HTMLElementWrapper.h>
namespace Web {
namespace Bindings {
class HTMLCanvasElementWrapper : public ElementWrapper {
class HTMLCanvasElementWrapper : public HTMLElementWrapper {
public:
HTMLCanvasElementWrapper(JS::GlobalObject&, HTMLCanvasElement&);
virtual void initialize(JS::Interpreter&, JS::GlobalObject&) override;

View file

@ -36,7 +36,7 @@ namespace Web {
namespace Bindings {
HTMLImageElementWrapper::HTMLImageElementWrapper(JS::GlobalObject& global_object, HTMLImageElement& element)
: ElementWrapper(global_object, element)
: HTMLElementWrapper(global_object, element)
{
}

View file

@ -26,12 +26,12 @@
#pragma once
#include <LibWeb/Bindings/ElementWrapper.h>
#include <LibWeb/Bindings/HTMLElementWrapper.h>
namespace Web {
namespace Bindings {
class HTMLImageElementWrapper : public ElementWrapper {
class HTMLImageElementWrapper : public HTMLElementWrapper {
public:
HTMLImageElementWrapper(JS::GlobalObject&, HTMLImageElement&);
virtual ~HTMLImageElementWrapper() override;

View file

@ -28,6 +28,7 @@
#include <LibWeb/Bindings/DocumentWrapper.h>
#include <LibWeb/Bindings/HTMLCanvasElementWrapper.h>
#include <LibWeb/Bindings/HTMLImageElementWrapper.h>
#include <LibWeb/Bindings/HTMLElementWrapper.h>
#include <LibWeb/Bindings/NodeWrapper.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/HTMLCanvasElement.h>
@ -45,6 +46,8 @@ NodeWrapper* wrap(JS::Heap& heap, Node& node)
return static_cast<NodeWrapper*>(wrap_impl(heap, to<HTMLCanvasElement>(node)));
if (is<HTMLImageElement>(node))
return static_cast<NodeWrapper*>(wrap_impl(heap, to<HTMLImageElement>(node)));
if (is<HTMLElement>(node))
return static_cast<NodeWrapper*>(wrap_impl(heap, to<HTMLElement>(node)));
if (is<Element>(node))
return static_cast<NodeWrapper*>(wrap_impl(heap, to<Element>(node)));
return static_cast<NodeWrapper*>(wrap_impl(heap, node));

View file

@ -42,6 +42,7 @@ public:
virtual bool is_node_wrapper() const { return false; }
virtual bool is_document_wrapper() const { return false; }
virtual bool is_element_wrapper() const { return false; }
virtual bool is_htmlelement_wrapper() const { return false; }
protected:
explicit Wrapper(Object& prototype)