diff --git a/src/ecmascript/mujs/element.c b/src/ecmascript/mujs/element.c index 61ff18ba..97e862f6 100644 --- a/src/ecmascript/mujs/element.c +++ b/src/ecmascript/mujs/element.c @@ -255,7 +255,7 @@ mjs_element_get_property_className(js_State *J) #ifdef ECMASCRIPT_DEBUG fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__); #endif - dom_node *el = (dom_node *)(mjs_getprivate(J, 0)); + dom_html_element *el = (dom_html_element *)(mjs_getprivate(J, 0)); dom_string *classstr = NULL; dom_exception exc; @@ -263,7 +263,7 @@ mjs_element_get_property_className(js_State *J) js_pushnull(J); return; } - exc = dom_element_get_attribute(el, corestring_dom_class, &classstr); + exc = dom_html_element_get_class_name(el, &classstr); if (exc != DOM_NO_ERR) { js_pushnull(J); @@ -1581,7 +1581,7 @@ mjs_element_set_property_className(js_State *J) dom_exception exc; struct ecmascript_interpreter *interpreter = (struct ecmascript_interpreter *)js_getcontext(J); assert(interpreter); - dom_node *el = (dom_node *)(mjs_getprivate(J, 0)); + dom_html_element *el = (dom_html_element *)(mjs_getprivate(J, 0)); if (!el) { js_pushundefined(J); @@ -1596,7 +1596,7 @@ mjs_element_set_property_className(js_State *J) exc = dom_string_create((const uint8_t *)str, strlen(str), &classstr); if (exc == DOM_NO_ERR && classstr) { - exc = dom_element_set_attribute(el, corestring_dom_class, classstr); + exc = dom_html_element_set_class_name(el, classstr); interpreter->changed = 1; dom_string_unref(classstr); } diff --git a/src/ecmascript/quickjs/element.c b/src/ecmascript/quickjs/element.c index 695ba87f..284cdcad 100644 --- a/src/ecmascript/quickjs/element.c +++ b/src/ecmascript/quickjs/element.c @@ -346,7 +346,7 @@ js_element_get_property_className(JSContext *ctx, JSValueConst this_val) REF_JS(this_val); JSValue r; - dom_node *el = (dom_node *)(js_getopaque(this_val, js_element_class_id)); + dom_html_element *el = (dom_html_element *)(js_getopaque(this_val, js_element_class_id)); dom_string *classstr = NULL; dom_exception exc; @@ -354,7 +354,8 @@ js_element_get_property_className(JSContext *ctx, JSValueConst this_val) return JS_NULL; } dom_node_ref(el); - exc = dom_element_get_attribute(el, corestring_dom_class, &classstr); + + exc = dom_html_element_get_class_name(el, &classstr); if (exc != DOM_NO_ERR) { dom_node_unref(el); @@ -1691,7 +1692,7 @@ js_element_set_property_className(JSContext *ctx, JSValueConst this_val, JSValue dom_exception exc; struct ecmascript_interpreter *interpreter = (struct ecmascript_interpreter *)JS_GetContextOpaque(ctx); assert(interpreter); - dom_node *el = (dom_node *)(js_getopaque(this_val, js_element_class_id)); + dom_html_element *el = (dom_html_element *)(js_getopaque(this_val, js_element_class_id)); if (!el) { return JS_UNDEFINED; @@ -1707,7 +1708,7 @@ js_element_set_property_className(JSContext *ctx, JSValueConst this_val, JSValue exc = dom_string_create((const uint8_t *)str, len, &classstr); if (exc == DOM_NO_ERR && classstr) { - exc = dom_element_set_attribute(el, corestring_dom_class, classstr); + exc = dom_html_element_set_class_name(el, classstr); interpreter->changed = 1; dom_string_unref(classstr); } diff --git a/src/ecmascript/spidermonkey/element.cpp b/src/ecmascript/spidermonkey/element.cpp index 324745f1..7a80f5b3 100644 --- a/src/ecmascript/spidermonkey/element.cpp +++ b/src/ecmascript/spidermonkey/element.cpp @@ -584,7 +584,7 @@ element_get_property_className(JSContext *ctx, unsigned int argc, JS::Value *vp) return false; } - dom_node *el = (dom_node *)JS::GetMaybePtrFromReservedSlot(hobj, 0); + dom_html_element *el = (dom_html_element *)JS::GetMaybePtrFromReservedSlot(hobj, 0); dom_string *classstr = NULL; dom_exception exc; @@ -592,7 +592,7 @@ element_get_property_className(JSContext *ctx, unsigned int argc, JS::Value *vp) args.rval().setNull(); return true; } - exc = dom_element_get_attribute(el, corestring_dom_class, &classstr); + exc = dom_html_element_get_class_name(el, &classstr); if (exc != DOM_NO_ERR) { args.rval().setNull(); @@ -2938,7 +2938,7 @@ element_set_property_className(JSContext *ctx, unsigned int argc, JS::Value *vp) struct document_view *doc_view = vs->doc_view; struct document *document = doc_view->document; - dom_node *el = (dom_node *)JS::GetMaybePtrFromReservedSlot(hobj, 0); + dom_html_element *el = (dom_html_element *)JS::GetMaybePtrFromReservedSlot(hobj, 0); if (!el) { return true; @@ -2953,7 +2953,7 @@ element_set_property_className(JSContext *ctx, unsigned int argc, JS::Value *vp) dom_exception exc = dom_string_create((const uint8_t *)str, len, &classstr); if (exc == DOM_NO_ERR && classstr) { - exc = dom_element_set_attribute(el, corestring_dom_class, classstr); + exc = dom_html_element_set_class_name(el, classstr); interpreter->changed = 1; dom_string_unref(classstr); debug_dump_xhtml(document->dom);