1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[ecmascript] Removed unused walk_tree_content

This commit is contained in:
Witold Filipczyk 2024-07-12 20:12:28 +02:00
parent 90f73d8394
commit fd04e5cbb2
3 changed files with 0 additions and 111 deletions

View File

@ -1292,43 +1292,6 @@ mjs_element_get_property_value(js_State *J)
js_pushstring(J, fs->value);
}
static void
walk_tree_content(struct string *buf, dom_node *node)
{
dom_node_type type;
dom_nodelist *children = NULL;
dom_exception exc;
exc = dom_node_get_node_type(node, &type);
if (exc != DOM_NO_ERR && type == DOM_TEXT_NODE) {
dom_string *content = NULL;
exc = dom_node_get_text_content(node, &content);
if (exc == DOM_NO_ERR && content) {
add_bytes_to_string(buf, dom_string_data(content), dom_string_length(content));
dom_string_unref(content);
}
}
exc = dom_node_get_child_nodes(node, &children);
if (exc == DOM_NO_ERR && children) {
uint32_t i, size;
exc = dom_nodelist_get_length(children, &size);
for (i = 0; i < size; i++) {
dom_node *item = NULL;
exc = dom_nodelist_item(children, i, &item);
if (exc == DOM_NO_ERR && item) {
walk_tree_content(buf, item);
dom_node_unref(item);
}
}
dom_nodelist_unref(children);
}
}
static void
mjs_element_get_property_innerHtml(js_State *J)
{

View File

@ -1460,43 +1460,6 @@ js_element_get_property_value(JSContext *ctx, JSValueConst this_val)
RETURN_JS(r);
}
static void
walk_tree_content(struct string *buf, dom_node *node)
{
dom_node_type type;
dom_nodelist *children = NULL;
dom_exception exc;
exc = dom_node_get_node_type(node, &type);
if (exc != DOM_NO_ERR && type == DOM_TEXT_NODE) {
dom_string *content = NULL;
exc = dom_node_get_text_content(node, &content);
if (exc == DOM_NO_ERR && content) {
add_bytes_to_string(buf, dom_string_data(content), dom_string_length(content));
dom_string_unref(content);
}
}
exc = dom_node_get_child_nodes(node, &children);
if (exc == DOM_NO_ERR && children) {
uint32_t i, size;
exc = dom_nodelist_get_length(children, &size);
for (i = 0; i < size; i++) {
dom_node *item = NULL;
exc = dom_nodelist_item(children, i, &item);
if (exc == DOM_NO_ERR && item) {
walk_tree_content(buf, item);
dom_node_unref(item);
}
}
dom_nodelist_unref(children);
}
}
static JSValue
js_element_get_property_innerHtml(JSContext *ctx, JSValueConst this_val)
{

View File

@ -2587,43 +2587,6 @@ element_get_property_value(JSContext *ctx, unsigned int argc, JS::Value *vp)
return true;
}
static void
walk_tree_content(struct string *buf, dom_node *node)
{
dom_node_type type;
dom_nodelist *children = NULL;
dom_exception exc;
exc = dom_node_get_node_type(node, &type);
if (exc != DOM_NO_ERR && type == DOM_TEXT_NODE) {
dom_string *content = NULL;
exc = dom_node_get_text_content(node, &content);
if (exc == DOM_NO_ERR && content) {
add_bytes_to_string(buf, dom_string_data(content), dom_string_length(content));
dom_string_unref(content);
}
}
exc = dom_node_get_child_nodes(node, &children);
if (exc == DOM_NO_ERR && children) {
uint32_t i, size;
exc = dom_nodelist_get_length(children, &size);
for (i = 0; i < size; i++) {
dom_node *item = NULL;
exc = dom_nodelist_item(children, i, &item);
if (exc == DOM_NO_ERR && item) {
walk_tree_content(buf, item);
dom_node_unref(item);
}
}
dom_nodelist_unref(children);
}
}
static bool
element_get_property_innerHtml(JSContext *ctx, unsigned int argc, JS::Value *vp)
{