From fd04e5cbb2e54d062f7f328d1cc9c84cef2c45d6 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Fri, 12 Jul 2024 20:12:28 +0200 Subject: [PATCH] [ecmascript] Removed unused walk_tree_content --- src/ecmascript/mujs/element.c | 37 ------------------------- src/ecmascript/quickjs/element.c | 37 ------------------------- src/ecmascript/spidermonkey/element.cpp | 37 ------------------------- 3 files changed, 111 deletions(-) diff --git a/src/ecmascript/mujs/element.c b/src/ecmascript/mujs/element.c index be8315d9f..f6b00b288 100644 --- a/src/ecmascript/mujs/element.c +++ b/src/ecmascript/mujs/element.c @@ -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) { diff --git a/src/ecmascript/quickjs/element.c b/src/ecmascript/quickjs/element.c index ec061c774..467fd37ca 100644 --- a/src/ecmascript/quickjs/element.c +++ b/src/ecmascript/quickjs/element.c @@ -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) { diff --git a/src/ecmascript/spidermonkey/element.cpp b/src/ecmascript/spidermonkey/element.cpp index bafc51b77..214da6c4d 100644 --- a/src/ecmascript/spidermonkey/element.cpp +++ b/src/ecmascript/spidermonkey/element.cpp @@ -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) {