diff options
author | Andreas Kling <kling@serenityos.org> | 2020-04-14 20:37:01 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-14 20:37:01 +0200 |
commit | 370befbf52cb7df64c8fc80a8b78901893a40d3b (patch) | |
tree | 89a888397b0c5285f9e2bd24eee505cf2ebc9450 /Libraries/LibWeb/Bindings/NodeWrapper.cpp | |
parent | 22de1e47ec9092da84b9da9ea0372988898a4eb2 (diff) | |
download | serenity-370befbf52cb7df64c8fc80a8b78901893a40d3b.zip |
LibWeb: Add a JavaScript wrapper for HTMLImageElement :^)
Diffstat (limited to 'Libraries/LibWeb/Bindings/NodeWrapper.cpp')
-rw-r--r-- | Libraries/LibWeb/Bindings/NodeWrapper.cpp | 4 |
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)); |