diff options
author | Andreas Kling <kling@serenityos.org> | 2020-06-20 17:44:54 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-20 17:50:48 +0200 |
commit | 8194dfb9f4f4163ccee6272ade3cdb3a5b298c4c (patch) | |
tree | df81da13778a74575aa8f0dd2928aaef1bb5abc7 /Libraries/LibWeb/Bindings | |
parent | e1f9da142e422b5706a127086946c34da1a4bf8b (diff) | |
download | serenity-8194dfb9f4f4163ccee6272ade3cdb3a5b298c4c.zip |
LibWeb: JS wrappers need to call base class initialize()
Diffstat (limited to 'Libraries/LibWeb/Bindings')
8 files changed, 17 insertions, 9 deletions
diff --git a/Libraries/LibWeb/Bindings/CanvasRenderingContext2DWrapper.cpp b/Libraries/LibWeb/Bindings/CanvasRenderingContext2DWrapper.cpp index d8f4fa32ff..99b39cc95c 100644 --- a/Libraries/LibWeb/Bindings/CanvasRenderingContext2DWrapper.cpp +++ b/Libraries/LibWeb/Bindings/CanvasRenderingContext2DWrapper.cpp @@ -53,8 +53,9 @@ CanvasRenderingContext2DWrapper::CanvasRenderingContext2DWrapper(JS::GlobalObjec { } -void CanvasRenderingContext2DWrapper::initialize(JS::Interpreter&, JS::GlobalObject&) +void CanvasRenderingContext2DWrapper::initialize(JS::Interpreter& interpreter, JS::GlobalObject& global_object) { + Wrapper::initialize(interpreter, global_object); define_native_function("fillRect", fill_rect, 4); define_native_function("scale", scale, 2); define_native_function("translate", translate, 2); diff --git a/Libraries/LibWeb/Bindings/DocumentWrapper.cpp b/Libraries/LibWeb/Bindings/DocumentWrapper.cpp index 3ea58469d4..021e9f147b 100644 --- a/Libraries/LibWeb/Bindings/DocumentWrapper.cpp +++ b/Libraries/LibWeb/Bindings/DocumentWrapper.cpp @@ -43,8 +43,9 @@ DocumentWrapper::DocumentWrapper(JS::GlobalObject& global_object, Document& docu { } -void DocumentWrapper::initialize(JS::Interpreter&, JS::GlobalObject&) +void DocumentWrapper::initialize(JS::Interpreter& interpreter, JS::GlobalObject& global_object) { + NodeWrapper::initialize(interpreter, global_object); define_native_function("getElementById", get_element_by_id, 1); define_native_function("querySelector", query_selector, 1); define_native_function("querySelectorAll", query_selector_all, 1); diff --git a/Libraries/LibWeb/Bindings/ElementWrapper.cpp b/Libraries/LibWeb/Bindings/ElementWrapper.cpp index 463cb4fdff..7b18b46f66 100644 --- a/Libraries/LibWeb/Bindings/ElementWrapper.cpp +++ b/Libraries/LibWeb/Bindings/ElementWrapper.cpp @@ -43,8 +43,10 @@ ElementWrapper::ElementWrapper(JS::GlobalObject& global_object, Element& element { } -void ElementWrapper::initialize(JS::Interpreter&, JS::GlobalObject&) +void ElementWrapper::initialize(JS::Interpreter& interpreter, JS::GlobalObject& global_object) { + NodeWrapper::initialize(interpreter, global_object); + define_native_property("innerHTML", inner_html_getter, inner_html_setter); define_native_property("id", id_getter, id_setter); diff --git a/Libraries/LibWeb/Bindings/EventTargetWrapper.cpp b/Libraries/LibWeb/Bindings/EventTargetWrapper.cpp index 9fe5436a99..7aa0913748 100644 --- a/Libraries/LibWeb/Bindings/EventTargetWrapper.cpp +++ b/Libraries/LibWeb/Bindings/EventTargetWrapper.cpp @@ -44,8 +44,9 @@ EventTargetWrapper::EventTargetWrapper(JS::GlobalObject& global_object, EventTar { } -void EventTargetWrapper::initialize(JS::Interpreter&, JS::GlobalObject&) +void EventTargetWrapper::initialize(JS::Interpreter& interpreter, JS::GlobalObject& global_object) { + Wrapper::initialize(interpreter, global_object); define_native_function("addEventListener", add_event_listener, 2); } diff --git a/Libraries/LibWeb/Bindings/HTMLCanvasElementWrapper.cpp b/Libraries/LibWeb/Bindings/HTMLCanvasElementWrapper.cpp index c9539c94bc..fdf30bd244 100644 --- a/Libraries/LibWeb/Bindings/HTMLCanvasElementWrapper.cpp +++ b/Libraries/LibWeb/Bindings/HTMLCanvasElementWrapper.cpp @@ -43,10 +43,10 @@ HTMLCanvasElementWrapper::HTMLCanvasElementWrapper(JS::GlobalObject& global_obje { } -void HTMLCanvasElementWrapper::initialize(JS::Interpreter&, JS::GlobalObject&) +void HTMLCanvasElementWrapper::initialize(JS::Interpreter& interpreter, JS::GlobalObject& global_object) { + ElementWrapper::initialize(interpreter, global_object); define_native_function("getContext", get_context, 1); - define_native_property("width", width_getter, nullptr); define_native_property("height", height_getter, nullptr); } diff --git a/Libraries/LibWeb/Bindings/ImageDataWrapper.cpp b/Libraries/LibWeb/Bindings/ImageDataWrapper.cpp index a18aac8536..b94b83f026 100644 --- a/Libraries/LibWeb/Bindings/ImageDataWrapper.cpp +++ b/Libraries/LibWeb/Bindings/ImageDataWrapper.cpp @@ -46,8 +46,9 @@ ImageDataWrapper::ImageDataWrapper(JS::GlobalObject& global_object, ImageData& i { } -void ImageDataWrapper::initialize(JS::Interpreter&, JS::GlobalObject&) +void ImageDataWrapper::initialize(JS::Interpreter& interpreter, JS::GlobalObject& global_object) { + Wrapper::initialize(interpreter, global_object); define_native_property("width", width_getter, nullptr); define_native_property("height", height_getter, nullptr); define_native_property("data", data_getter, nullptr); diff --git a/Libraries/LibWeb/Bindings/MouseEventWrapper.cpp b/Libraries/LibWeb/Bindings/MouseEventWrapper.cpp index 6f50ac5da3..6d3ff58fb9 100644 --- a/Libraries/LibWeb/Bindings/MouseEventWrapper.cpp +++ b/Libraries/LibWeb/Bindings/MouseEventWrapper.cpp @@ -40,8 +40,9 @@ MouseEventWrapper::MouseEventWrapper(JS::GlobalObject& global_object, MouseEvent { } -void MouseEventWrapper::initialize(JS::Interpreter&, JS::GlobalObject&) +void MouseEventWrapper::initialize(JS::Interpreter& interpreter, JS::GlobalObject& global_object) { + EventWrapper::initialize(interpreter, global_object); define_native_property("offsetX", offset_x_getter, nullptr); define_native_property("offsetY", offset_y_getter, nullptr); } diff --git a/Libraries/LibWeb/Bindings/NodeWrapper.cpp b/Libraries/LibWeb/Bindings/NodeWrapper.cpp index 5351807952..bb822fe01c 100644 --- a/Libraries/LibWeb/Bindings/NodeWrapper.cpp +++ b/Libraries/LibWeb/Bindings/NodeWrapper.cpp @@ -57,8 +57,9 @@ NodeWrapper::NodeWrapper(JS::GlobalObject& global_object, Node& node) { } -void NodeWrapper::initialize(JS::Interpreter& interpreter, JS::GlobalObject&) +void NodeWrapper::initialize(JS::Interpreter& interpreter, JS::GlobalObject& global_object) { + EventTargetWrapper::initialize(interpreter, global_object); put("nodeName", JS::js_string(interpreter.heap(), node().node_name())); } |