mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 19:17:41 +00:00
LibWeb: Add empty IDL bindings for current SVG elements
Nothing in them right now as the classes don't contain the IDL methods.
This commit is contained in:
parent
6351a56d27
commit
9dee140a9f
14 changed files with 62 additions and 1 deletions
|
@ -100,6 +100,8 @@
|
||||||
#include <LibWeb/Bindings/HTMLVideoElementWrapper.h>
|
#include <LibWeb/Bindings/HTMLVideoElementWrapper.h>
|
||||||
#include <LibWeb/Bindings/NodeWrapper.h>
|
#include <LibWeb/Bindings/NodeWrapper.h>
|
||||||
#include <LibWeb/Bindings/NodeWrapperFactory.h>
|
#include <LibWeb/Bindings/NodeWrapperFactory.h>
|
||||||
|
#include <LibWeb/Bindings/SVGPathElementWrapper.h>
|
||||||
|
#include <LibWeb/Bindings/SVGSVGElementWrapper.h>
|
||||||
#include <LibWeb/Bindings/TextWrapper.h>
|
#include <LibWeb/Bindings/TextWrapper.h>
|
||||||
#include <LibWeb/DOM/Document.h>
|
#include <LibWeb/DOM/Document.h>
|
||||||
#include <LibWeb/DOM/Node.h>
|
#include <LibWeb/DOM/Node.h>
|
||||||
|
@ -170,6 +172,8 @@
|
||||||
#include <LibWeb/HTML/HTMLUListElement.h>
|
#include <LibWeb/HTML/HTMLUListElement.h>
|
||||||
#include <LibWeb/HTML/HTMLUnknownElement.h>
|
#include <LibWeb/HTML/HTMLUnknownElement.h>
|
||||||
#include <LibWeb/HTML/HTMLVideoElement.h>
|
#include <LibWeb/HTML/HTMLVideoElement.h>
|
||||||
|
#include <LibWeb/SVG/SVGPathElement.h>
|
||||||
|
#include <LibWeb/SVG/SVGSVGElement.h>
|
||||||
|
|
||||||
namespace Web::Bindings {
|
namespace Web::Bindings {
|
||||||
|
|
||||||
|
@ -315,6 +319,10 @@ NodeWrapper* wrap(JS::GlobalObject& global_object, DOM::Node& node)
|
||||||
return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLVideoElement>(node)));
|
return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLVideoElement>(node)));
|
||||||
if (is<HTML::HTMLElement>(node))
|
if (is<HTML::HTMLElement>(node))
|
||||||
return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLElement>(node)));
|
return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLElement>(node)));
|
||||||
|
if (is<SVG::SVGSVGElement>(node))
|
||||||
|
return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<SVG::SVGSVGElement>(node)));
|
||||||
|
if (is<SVG::SVGPathElement>(node))
|
||||||
|
return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<SVG::SVGPathElement>(node)));
|
||||||
if (is<DOM::Element>(node))
|
if (is<DOM::Element>(node))
|
||||||
return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<DOM::Element>(node)));
|
return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<DOM::Element>(node)));
|
||||||
if (is<DOM::DocumentFragment>(node))
|
if (is<DOM::DocumentFragment>(node))
|
||||||
|
|
|
@ -300,6 +300,11 @@ libweb_js_wrapper(HTML/HTMLUnknownElement)
|
||||||
libweb_js_wrapper(HTML/HTMLVideoElement)
|
libweb_js_wrapper(HTML/HTMLVideoElement)
|
||||||
libweb_js_wrapper(HTML/ImageData)
|
libweb_js_wrapper(HTML/ImageData)
|
||||||
libweb_js_wrapper(HighResolutionTime/Performance)
|
libweb_js_wrapper(HighResolutionTime/Performance)
|
||||||
|
libweb_js_wrapper(SVG/SVGElement)
|
||||||
|
libweb_js_wrapper(SVG/SVGGeometryElement)
|
||||||
|
libweb_js_wrapper(SVG/SVGGraphicsElement)
|
||||||
|
libweb_js_wrapper(SVG/SVGPathElement)
|
||||||
|
libweb_js_wrapper(SVG/SVGSVGElement)
|
||||||
libweb_js_wrapper(UIEvents/MouseEvent)
|
libweb_js_wrapper(UIEvents/MouseEvent)
|
||||||
libweb_js_wrapper(UIEvents/UIEvent)
|
libweb_js_wrapper(UIEvents/UIEvent)
|
||||||
|
|
||||||
|
|
|
@ -290,7 +290,7 @@ int main(int argc, char** argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (namespace_.is_one_of("DOM", "HTML", "UIEvents", "HighResolutionTime")) {
|
if (namespace_.is_one_of("DOM", "HTML", "UIEvents", "HighResolutionTime", "SVG")) {
|
||||||
StringBuilder builder;
|
StringBuilder builder;
|
||||||
builder.append(namespace_);
|
builder.append(namespace_);
|
||||||
builder.append("::");
|
builder.append("::");
|
||||||
|
@ -381,6 +381,8 @@ static void generate_header(const IDL::Interface& interface)
|
||||||
out() << "#include <LibWeb/UIEvents/" << interface.name << ".h>";
|
out() << "#include <LibWeb/UIEvents/" << interface.name << ".h>";
|
||||||
out() << "#elif __has_include(<LibWeb/HighResolutionTime/" << interface.name << ".h>)";
|
out() << "#elif __has_include(<LibWeb/HighResolutionTime/" << interface.name << ".h>)";
|
||||||
out() << "#include <LibWeb/HighResolutionTime/" << interface.name << ".h>";
|
out() << "#include <LibWeb/HighResolutionTime/" << interface.name << ".h>";
|
||||||
|
out() << "#elif __has_include(<LibWeb/SVG/" << interface.name << ".h>)";
|
||||||
|
out() << "#include <LibWeb/SVG/" << interface.name << ".h>";
|
||||||
out() << "#endif";
|
out() << "#endif";
|
||||||
|
|
||||||
if (wrapper_base_class != "Wrapper")
|
if (wrapper_base_class != "Wrapper")
|
||||||
|
|
|
@ -136,6 +136,14 @@ namespace Web::HighResolutionTime {
|
||||||
class Performance;
|
class Performance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace Web::SVG {
|
||||||
|
class SVGElement;
|
||||||
|
class SVGGeometryElement;
|
||||||
|
class SVGGraphicsElement;
|
||||||
|
class SVGPathElement;
|
||||||
|
class SVGSVGElement;
|
||||||
|
}
|
||||||
|
|
||||||
namespace Web {
|
namespace Web {
|
||||||
class EventHandler;
|
class EventHandler;
|
||||||
class Frame;
|
class Frame;
|
||||||
|
@ -248,6 +256,11 @@ class MouseEventWrapper;
|
||||||
class NodeWrapper;
|
class NodeWrapper;
|
||||||
class PerformanceWrapper;
|
class PerformanceWrapper;
|
||||||
class ScriptExecutionContext;
|
class ScriptExecutionContext;
|
||||||
|
class SVGElementWrapper;
|
||||||
|
class SVGGeometryElementWrapper;
|
||||||
|
class SVGGraphicsElementWrapper;
|
||||||
|
class SVGPathElementWrapper;
|
||||||
|
class SVGSVGElementWrapper;
|
||||||
class TextWrapper;
|
class TextWrapper;
|
||||||
class UIEventWrapper;
|
class UIEventWrapper;
|
||||||
class WindowObject;
|
class WindowObject;
|
||||||
|
|
|
@ -32,6 +32,8 @@ namespace Web::SVG {
|
||||||
|
|
||||||
class SVGElement : public DOM::Element {
|
class SVGElement : public DOM::Element {
|
||||||
public:
|
public:
|
||||||
|
using WrapperType = Bindings::SVGElementWrapper;
|
||||||
|
|
||||||
virtual bool is_graphics_element() const { return false; }
|
virtual bool is_graphics_element() const { return false; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
3
Libraries/LibWeb/SVG/SVGElement.idl
Normal file
3
Libraries/LibWeb/SVG/SVGElement.idl
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
interface SVGElement : Element {
|
||||||
|
|
||||||
|
}
|
|
@ -32,6 +32,8 @@ namespace Web::SVG {
|
||||||
|
|
||||||
class SVGGeometryElement : public SVGGraphicsElement {
|
class SVGGeometryElement : public SVGGraphicsElement {
|
||||||
public:
|
public:
|
||||||
|
using WrapperType = Bindings::SVGGeometryElementWrapper;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
SVGGeometryElement(DOM::Document& document, const FlyString& tag_name);
|
SVGGeometryElement(DOM::Document& document, const FlyString& tag_name);
|
||||||
};
|
};
|
||||||
|
|
3
Libraries/LibWeb/SVG/SVGGeometryElement.idl
Normal file
3
Libraries/LibWeb/SVG/SVGGeometryElement.idl
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
interface SVGGeometryElement : SVGGraphicsElement {
|
||||||
|
|
||||||
|
}
|
|
@ -47,6 +47,8 @@ static const SVGPaintingContext default_painting_context = {
|
||||||
|
|
||||||
class SVGGraphicsElement : public SVGElement {
|
class SVGGraphicsElement : public SVGElement {
|
||||||
public:
|
public:
|
||||||
|
using WrapperType = Bindings::SVGGraphicsElementWrapper;
|
||||||
|
|
||||||
SVGGraphicsElement(DOM::Document&, const FlyString& tag_name);
|
SVGGraphicsElement(DOM::Document&, const FlyString& tag_name);
|
||||||
|
|
||||||
virtual void parse_attribute(const FlyString& name, const String& value) override;
|
virtual void parse_attribute(const FlyString& name, const String& value) override;
|
||||||
|
|
3
Libraries/LibWeb/SVG/SVGGraphicsElement.idl
Normal file
3
Libraries/LibWeb/SVG/SVGGraphicsElement.idl
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
interface SVGGraphicsElement : SVGElement {
|
||||||
|
|
||||||
|
}
|
|
@ -104,6 +104,8 @@ private:
|
||||||
|
|
||||||
class SVGPathElement final : public SVGGeometryElement {
|
class SVGPathElement final : public SVGGeometryElement {
|
||||||
public:
|
public:
|
||||||
|
using WrapperType = Bindings::SVGPathElementWrapper;
|
||||||
|
|
||||||
SVGPathElement(DOM::Document&, const FlyString& tag_name);
|
SVGPathElement(DOM::Document&, const FlyString& tag_name);
|
||||||
virtual ~SVGPathElement() override = default;
|
virtual ~SVGPathElement() override = default;
|
||||||
|
|
||||||
|
@ -116,3 +118,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AK_BEGIN_TYPE_TRAITS(Web::SVG::SVGPathElement)
|
||||||
|
static bool is_type(const Web::DOM::Node& node) { return node.is_svg_element() && downcast<Web::SVG::SVGElement>(node).local_name() == Web::SVG::TagNames::path; }
|
||||||
|
AK_END_TYPE_TRAITS()
|
||||||
|
|
3
Libraries/LibWeb/SVG/SVGPathElement.idl
Normal file
3
Libraries/LibWeb/SVG/SVGPathElement.idl
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
interface SVGPathElement : SVGGeometryElement {
|
||||||
|
|
||||||
|
}
|
|
@ -33,6 +33,8 @@ namespace Web::SVG {
|
||||||
|
|
||||||
class SVGSVGElement final : public SVGGraphicsElement {
|
class SVGSVGElement final : public SVGGraphicsElement {
|
||||||
public:
|
public:
|
||||||
|
using WrapperType = Bindings::SVGSVGElementWrapper;
|
||||||
|
|
||||||
SVGSVGElement(DOM::Document&, const FlyString& tag_name);
|
SVGSVGElement(DOM::Document&, const FlyString& tag_name);
|
||||||
|
|
||||||
virtual RefPtr<LayoutNode> create_layout_node(const CSS::StyleProperties* parent_style) override;
|
virtual RefPtr<LayoutNode> create_layout_node(const CSS::StyleProperties* parent_style) override;
|
||||||
|
@ -50,3 +52,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AK_BEGIN_TYPE_TRAITS(Web::SVG::SVGSVGElement)
|
||||||
|
static bool is_type(const Web::DOM::Node& node) { return node.is_svg_element() && downcast<Web::SVG::SVGElement>(node).local_name() == Web::SVG::TagNames::svg; }
|
||||||
|
AK_END_TYPE_TRAITS()
|
||||||
|
|
3
Libraries/LibWeb/SVG/SVGSVGElement.idl
Normal file
3
Libraries/LibWeb/SVG/SVGSVGElement.idl
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
interface SVGSVGElement : SVGGraphicsElement {
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue