1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-19 01:36:33 -04:00

[ecmascript] Swapped order of parameters for camel_to_html

The result string as the last parameter not the first one.
This commit is contained in:
Witold Filipczyk 2024-08-06 16:58:53 +02:00
parent b5e85bc15c
commit 299a8fd5a3
5 changed files with 11 additions and 11 deletions

View File

@ -784,7 +784,7 @@ get_elements_by_class_name(dom_html_document *doc, dom_node *node, const char *c
}
void
camel_to_html(struct string *result, const char *text)
camel_to_html(const char *text, struct string *result)
{
add_to_string(result, "data-");

View File

@ -76,7 +76,7 @@ void *walk_tree_query(dom_node *node, const char *selector, int depth);
void walk_tree_query_append(dom_node *node, const char *selector, int depth, LIST_OF(struct selector_node) *result_list);
void *get_elements_by_class_name(dom_html_document *doc, dom_node *node, const char *classes);
void camel_to_html(struct string *result, const char *camel);
void camel_to_html(const char *camel, struct string *result);
void ecmascript_walk_tree(struct string *buf, void *nod, bool start, bool toSortAttrs);
void free_el_dom_collection(void *ctx);

View File

@ -51,7 +51,7 @@ mjs_obj_dataset_has(js_State *J, void *p, const char *property)
if (!el ||!init_string(&data)) {
return 0;
}
camel_to_html(&data, property);
camel_to_html(property, &data);
dom_string *attr_name = NULL;
dom_exception exc = dom_string_create((const uint8_t *)data.source, data.length, &attr_name);
done_string(&data);
@ -94,7 +94,7 @@ mjs_obj_dataset_put(js_State *J, void *p, const char *property)
if (!el ||!init_string(&data)) {
return 0;
}
camel_to_html(&data, property);
camel_to_html(property, &data);
dom_string *attr_name = NULL;
dom_exception exc = dom_string_create((const uint8_t *)data.source, data.length, &attr_name);
done_string(&data);
@ -134,7 +134,7 @@ mjs_obj_dataset_del(js_State *J, void *p, const char *property)
if (!el ||!init_string(&data)) {
return 0;
}
camel_to_html(&data, property);
camel_to_html(property, &data);
dom_string *attr_name = NULL;
dom_exception exc = dom_string_create((const uint8_t *)data.source, data.length, &attr_name);
done_string(&data);

View File

@ -61,7 +61,7 @@ js_obj_delete_property(JSContext *ctx, JSValueConst obj, JSAtom prop)
JS_FreeCString(ctx, property);
return 0;
}
camel_to_html(&data, property);
camel_to_html(property, &data);
JS_FreeCString(ctx, property);
dom_string *attr_name = NULL;
@ -111,7 +111,7 @@ js_obj_get_property(JSContext *ctx, JSValueConst obj, JSAtom atom, JSValueConst
JS_FreeCString(ctx, property);
return JS_UNDEFINED;
}
camel_to_html(&data, property);
camel_to_html(property, &data);
JS_FreeCString(ctx, property);
dom_string *attr_name = NULL;
@ -162,7 +162,7 @@ js_obj_set_property(JSContext *ctx, JSValueConst obj, JSAtom atom, JSValueConst
JS_FreeCString(ctx, value);
return 0;
}
camel_to_html(&data, property);
camel_to_html(property, &data);
JS_FreeCString(ctx, property);
dom_string *attr_name = NULL;

View File

@ -89,7 +89,7 @@ dataset_obj_getProperty(JSContext* ctx, JS::HandleObject obj, JS::HandleValue re
mem_free(property);
return true;
}
camel_to_html(&data, property);
camel_to_html(property, &data);
mem_free(property);
dom_string *attr_name = NULL;
@ -150,7 +150,7 @@ dataset_obj_setProperty(JSContext* ctx, JS::HandleObject obj, JS::HandleId id, J
mem_free(value);
return result.failInvalidDescriptor();
}
camel_to_html(&data, property);
camel_to_html(property, &data);
mem_free(property);
dom_string *attr_name = NULL;
@ -207,7 +207,7 @@ dataset_obj_deleteProperty(JSContext* ctx, JS::HandleObject obj, JS::HandleId id
mem_free(property);
return result.failCantDelete();
}
camel_to_html(&data, property);
camel_to_html(property, &data);
mem_free(property);
dom_string *attr_name = NULL;