Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/b56d74b5df9becb324ef2d49bfe079acc505e76b
...commit
http://git.netsurf-browser.org/netsurf.git/commit/b56d74b5df9becb324ef2d49bfe079acc505e76b
...tree
http://git.netsurf-browser.org/netsurf.git/tree/b56d74b5df9becb324ef2d49bfe079acc505e76b
The branch, master has been updated
via b56d74b5df9becb324ef2d49bfe079acc505e76b (commit)
from 7e6acf326bc52fbd97d5e330799240f977db5ccb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=b56d74b5df9becb324ef2d49bfe079acc505e76b
commit b56d74b5df9becb324ef2d49bfe079acc505e76b
Author: John-Mark Bell <[email protected]>
Commit: John-Mark Bell <[email protected]>
Retire long-dead code
diff --git a/utils/libdom.c b/utils/libdom.c
index a996e98..c39aad3 100644
--- a/utils/libdom.c
+++ b/utils/libdom.c
@@ -28,129 +28,6 @@
#include "utils/log.h"
#include "utils/libdom.h"
-/* exported interface documented in libdom.h */
-bool libdom_treewalk(dom_node *root,
- bool (*callback)(dom_node *node, dom_string *name, void *ctx),
- void *ctx)
-{
- dom_node *node;
- bool result = true;
-
- node = dom_node_ref(root); /* tree root */
-
- while (node != NULL) {
- dom_node *next = NULL;
- dom_node_type type;
- dom_string *name;
- dom_exception exc;
-
- exc = dom_node_get_first_child(node, &next);
- if (exc != DOM_NO_ERR) {
- dom_node_unref(node);
- break;
- }
-
- if (next != NULL) {
- /* 1. Got children */
- dom_node_unref(node);
- node = next;
- } else {
- /* No children; siblings & ancestor's siblings */
- while (node != NULL) {
- exc = dom_node_get_next_sibling(node, &next);
- if (exc != DOM_NO_ERR) {
- dom_node_unref(node);
- node = NULL;
- break;
- }
-
- if (next != NULL) {
- /* 2. Got sibling */
- break;
- }
-
- exc = dom_node_get_parent_node(node, &next);
- if (exc != DOM_NO_ERR) {
- dom_node_unref(node);
- node = NULL;
- break;
- }
-
- /* 3. Try parent */
- dom_node_unref(node);
- node = next;
- }
-
- if (node == NULL)
- break;
-
- dom_node_unref(node);
- node = next;
- }
-
- assert(node != NULL);
-
- exc = dom_node_get_node_type(node, &type);
- if ((exc != DOM_NO_ERR) || (type != DOM_ELEMENT_NODE))
- continue;
-
- exc = dom_node_get_node_name(node, &name);
- if (exc != DOM_NO_ERR)
- continue;
-
- result = callback(node, name, ctx);
-
- dom_string_unref(name);
-
- if (result == false) {
- break; /* callback caused early termination */
- }
-
- }
- return result;
-}
-
-
-/* libdom_treewalk context for libdom_find_element */
-struct find_element_ctx {
- lwc_string *search;
- dom_node *found;
-};
-
-/* libdom_treewalk callback for libdom_find_element */
-static bool libdom_find_element_callback(dom_node *node, dom_string *name,
- void *ctx)
-{
- struct find_element_ctx *data = ctx;
-
- if (dom_string_caseless_lwc_isequal(name, data->search)) {
- /* Found element */
- data->found = node;
- return false; /* Discontinue search */
- }
-
- return true; /* Continue search */
-}
-
-
-/* exported interface documented in libdom.h */
-dom_node *libdom_find_element(dom_node *node, lwc_string *element_name)
-{
- struct find_element_ctx data;
-
- assert(element_name != NULL);
-
- if (node == NULL)
- return NULL;
-
- data.search = element_name;
- data.found = NULL;
-
- libdom_treewalk(node, libdom_find_element_callback, &data);
-
- return data.found;
-}
-
/* exported interface documented in libdom.h */
dom_node *libdom_find_first_element(dom_node *parent, lwc_string *element_name)
diff --git a/utils/libdom.h b/utils/libdom.h
index 306aa0f..6384193 100644
--- a/utils/libdom.h
+++ b/utils/libdom.h
@@ -33,29 +33,6 @@
#include <dom/bindings/hubbub/errors.h>
/**
- * depth-first walk the dom calling callback for each element
- *
- * \param root the dom node to use as the root of the tree walk
- * \param callback The function called for each element
- * \param ctx The context passed to the callback.
- * \return true if all nodes were examined, false if the callback terminated
- * the walk early.
- */
-bool libdom_treewalk(dom_node *root,
- bool (*callback)(dom_node *node, dom_string *name, void *ctx),
- void *ctx);
-
-/**
- * Search the descendants of a node for an element.
- *
- * \param node dom_node to search children of, or NULL
- * \param element_name name of element to find
- * \return first child of node which is an element and matches name, or
- * NULL if not found or parameter node is NULL
- */
-dom_node *libdom_find_element(dom_node *node, lwc_string *element_name);
-
-/**
* Search children of a node for first named element
* \param parent dom_node to search children of, or NULL
* \param element_name name of element to find
-----------------------------------------------------------------------
Summary of changes:
utils/libdom.c | 123 --------------------------------------------------------
utils/libdom.h | 23 -----------
2 files changed, 146 deletions(-)
diff --git a/utils/libdom.c b/utils/libdom.c
index a996e98..c39aad3 100644
--- a/utils/libdom.c
+++ b/utils/libdom.c
@@ -28,129 +28,6 @@
#include "utils/log.h"
#include "utils/libdom.h"
-/* exported interface documented in libdom.h */
-bool libdom_treewalk(dom_node *root,
- bool (*callback)(dom_node *node, dom_string *name, void *ctx),
- void *ctx)
-{
- dom_node *node;
- bool result = true;
-
- node = dom_node_ref(root); /* tree root */
-
- while (node != NULL) {
- dom_node *next = NULL;
- dom_node_type type;
- dom_string *name;
- dom_exception exc;
-
- exc = dom_node_get_first_child(node, &next);
- if (exc != DOM_NO_ERR) {
- dom_node_unref(node);
- break;
- }
-
- if (next != NULL) {
- /* 1. Got children */
- dom_node_unref(node);
- node = next;
- } else {
- /* No children; siblings & ancestor's siblings */
- while (node != NULL) {
- exc = dom_node_get_next_sibling(node, &next);
- if (exc != DOM_NO_ERR) {
- dom_node_unref(node);
- node = NULL;
- break;
- }
-
- if (next != NULL) {
- /* 2. Got sibling */
- break;
- }
-
- exc = dom_node_get_parent_node(node, &next);
- if (exc != DOM_NO_ERR) {
- dom_node_unref(node);
- node = NULL;
- break;
- }
-
- /* 3. Try parent */
- dom_node_unref(node);
- node = next;
- }
-
- if (node == NULL)
- break;
-
- dom_node_unref(node);
- node = next;
- }
-
- assert(node != NULL);
-
- exc = dom_node_get_node_type(node, &type);
- if ((exc != DOM_NO_ERR) || (type != DOM_ELEMENT_NODE))
- continue;
-
- exc = dom_node_get_node_name(node, &name);
- if (exc != DOM_NO_ERR)
- continue;
-
- result = callback(node, name, ctx);
-
- dom_string_unref(name);
-
- if (result == false) {
- break; /* callback caused early termination */
- }
-
- }
- return result;
-}
-
-
-/* libdom_treewalk context for libdom_find_element */
-struct find_element_ctx {
- lwc_string *search;
- dom_node *found;
-};
-
-/* libdom_treewalk callback for libdom_find_element */
-static bool libdom_find_element_callback(dom_node *node, dom_string *name,
- void *ctx)
-{
- struct find_element_ctx *data = ctx;
-
- if (dom_string_caseless_lwc_isequal(name, data->search)) {
- /* Found element */
- data->found = node;
- return false; /* Discontinue search */
- }
-
- return true; /* Continue search */
-}
-
-
-/* exported interface documented in libdom.h */
-dom_node *libdom_find_element(dom_node *node, lwc_string *element_name)
-{
- struct find_element_ctx data;
-
- assert(element_name != NULL);
-
- if (node == NULL)
- return NULL;
-
- data.search = element_name;
- data.found = NULL;
-
- libdom_treewalk(node, libdom_find_element_callback, &data);
-
- return data.found;
-}
-
/* exported interface documented in libdom.h */
dom_node *libdom_find_first_element(dom_node *parent, lwc_string *element_name)
diff --git a/utils/libdom.h b/utils/libdom.h
index 306aa0f..6384193 100644
--- a/utils/libdom.h
+++ b/utils/libdom.h
@@ -33,29 +33,6 @@
#include <dom/bindings/hubbub/errors.h>
/**
- * depth-first walk the dom calling callback for each element
- *
- * \param root the dom node to use as the root of the tree walk
- * \param callback The function called for each element
- * \param ctx The context passed to the callback.
- * \return true if all nodes were examined, false if the callback terminated
- * the walk early.
- */
-bool libdom_treewalk(dom_node *root,
- bool (*callback)(dom_node *node, dom_string *name, void *ctx),
- void *ctx);
-
-/**
- * Search the descendants of a node for an element.
- *
- * \param node dom_node to search children of, or NULL
- * \param element_name name of element to find
- * \return first child of node which is an element and matches name, or
- * NULL if not found or parameter node is NULL
- */
-dom_node *libdom_find_element(dom_node *node, lwc_string *element_name);
-
-/**
* Search children of a node for first named element
* \param parent dom_node to search children of, or NULL
* \param element_name name of element to find
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]