summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Bindings/NodeWrapper.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-14 20:37:01 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-14 20:37:01 +0200
commit370befbf52cb7df64c8fc80a8b78901893a40d3b (patch)
tree89a888397b0c5285f9e2bd24eee505cf2ebc9450 /Libraries/LibWeb/Bindings/NodeWrapper.cpp
parent22de1e47ec9092da84b9da9ea0372988898a4eb2 (diff)
downloadserenity-370befbf52cb7df64c8fc80a8b78901893a40d3b.zip
LibWeb: Add a JavaScript wrapper for HTMLImageElement :^)
Diffstat (limited to 'Libraries/LibWeb/Bindings/NodeWrapper.cpp')
-rw-r--r--Libraries/LibWeb/Bindings/NodeWrapper.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Libraries/LibWeb/Bindings/NodeWrapper.cpp b/Libraries/LibWeb/Bindings/NodeWrapper.cpp
index 289a5c69f2..b62d7bceb8 100644
--- a/Libraries/LibWeb/Bindings/NodeWrapper.cpp
+++ b/Libraries/LibWeb/Bindings/NodeWrapper.cpp
@@ -29,9 +29,11 @@
#include <LibJS/Runtime/Value.h>
#include <LibWeb/Bindings/DocumentWrapper.h>
#include <LibWeb/Bindings/HTMLCanvasElementWrapper.h>
+#include <LibWeb/Bindings/HTMLImageElementWrapper.h>
#include <LibWeb/Bindings/NodeWrapper.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/HTMLCanvasElement.h>
+#include <LibWeb/DOM/HTMLImageElement.h>
#include <LibWeb/DOM/Node.h>
namespace Web {
@@ -43,6 +45,8 @@ NodeWrapper* wrap(JS::Heap& heap, Node& node)
return static_cast<NodeWrapper*>(wrap_impl(heap, to<Document>(node)));
if (is<HTMLCanvasElement>(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<Element>(node))
return static_cast<NodeWrapper*>(wrap_impl(heap, to<Element>(node)));
return static_cast<NodeWrapper*>(wrap_impl(heap, node));