From 81c692e6b8ec334f03c3ca2f25468e0f20e86c41 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Fri, 26 Jan 2024 21:17:30 +0100 Subject: [PATCH] [mujs] element.clientLeft and element.clientTop They always return 0. --- src/ecmascript/mujs/element.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/ecmascript/mujs/element.c b/src/ecmascript/mujs/element.c index 9f0bdb65..f232c715 100644 --- a/src/ecmascript/mujs/element.c +++ b/src/ecmascript/mujs/element.c @@ -269,6 +269,24 @@ mjs_element_get_property_className(js_State *J) } } +static void +mjs_element_get_property_clientLeft(js_State *J) +{ +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__); +#endif + js_pushnumber(J, 0); +} + +static void +mjs_element_get_property_clientTop(js_State *J) +{ +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__); +#endif + js_pushnumber(J, 0); +} + static void mjs_element_get_property_dir(js_State *J) { @@ -2680,6 +2698,8 @@ mjs_push_element(js_State *J, void *node) addproperty(J, "childElementCount", mjs_element_get_property_childElementCount, NULL); addproperty(J, "childNodes", mjs_element_get_property_childNodes, NULL); addproperty(J, "className", mjs_element_get_property_className, mjs_element_set_property_className); + addproperty(J, "clientLeft", mjs_element_get_property_clientLeft, NULL); + addproperty(J, "clientTop", mjs_element_get_property_clientTop, NULL); addproperty(J, "dir", mjs_element_get_property_dir, mjs_element_set_property_dir); addproperty(J, "firstChild", mjs_element_get_property_firstChild, NULL); addproperty(J, "firstElementChild", mjs_element_get_property_firstElementChild, NULL);