Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/b002ba73578c2d3bdb230...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/b002ba73578c2d3bdb230c1...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/b002ba73578c2d3bdb230c17f...
The branch, master has been updated
via b002ba73578c2d3bdb230c17ff474487c767f827 (commit)
via b58176c65efa467b358eda1e921ea914dcee1a1b (commit)
from b3c524cea10d636bd7e657d274ba9f94c1d1e433 (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=b002ba73578c2d3bdb2...
commit b002ba73578c2d3bdb230c17ff474487c767f827
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Simplify special element handling in node inserted callback.
diff --git a/render/html.c b/render/html.c
index 0c278a7..cdd78e7 100644
--- a/render/html.c
+++ b/render/html.c
@@ -629,7 +629,6 @@ dom_default_action_DOMNodeInserted_cb(struct dom_event *evt, void
*pw)
{
dom_event_target *node;
dom_node_type type;
- dom_string *name;
dom_exception exc;
html_content *htmlc = pw;
@@ -638,38 +637,39 @@ dom_default_action_DOMNodeInserted_cb(struct dom_event *evt, void
*pw)
exc = dom_node_get_node_type(node, &type);
if ((exc == DOM_NO_ERR) && (type == DOM_ELEMENT_NODE)) {
/* an element node has been inserted */
- exc = dom_node_get_node_name(node, &name);
- if ((exc == DOM_NO_ERR) && (name != NULL)) {
+ dom_html_element_type tag_type;
- if (dom_string_caseless_isequal(name,
- corestring_dom_link)) {
- /* Handle stylesheet loading */
- html_css_process_link(htmlc,
- (dom_node *)node);
- /* Generic link handling */
- html_process_link(htmlc,
- (dom_node *)node);
-
- } else if (dom_string_caseless_lwc_isequal(name,
- corestring_lwc_meta) &&
- htmlc->refresh == false) {
- html_meta_refresh_process_element(htmlc,
- (dom_node *)node);
- } else if (dom_string_caseless_lwc_isequal(
- name, corestring_lwc_base)) {
- html_process_base(htmlc,
- (dom_node *)node);
- } else if (dom_string_caseless_lwc_isequal(
- name, corestring_lwc_title) &&
- htmlc->title == NULL) {
- htmlc->title = dom_node_ref(node);
- } else if (dom_string_caseless_lwc_isequal(
- name, corestring_lwc_img)) {
- html_process_img(htmlc,
- (dom_node *) node);
- }
+ exc = dom_html_element_get_tag_type(node, &tag_type);
+ if (exc != DOM_NO_ERR) {
+ tag_type = DOM_HTML_ELEMENT_TYPE__UNKNOWN;
+ }
- dom_string_unref(name);
+ switch (tag_type) {
+ case DOM_HTML_ELEMENT_TYPE_LINK:
+ /* Handle stylesheet loading */
+ html_css_process_link(htmlc, (dom_node *)node);
+ /* Generic link handling */
+ html_process_link(htmlc, (dom_node *)node);
+ break;
+ case DOM_HTML_ELEMENT_TYPE_META:
+ if (htmlc->refresh)
+ break;
+ html_meta_refresh_process_element(htmlc,
+ (dom_node *)node);
+ break;
+ case DOM_HTML_ELEMENT_TYPE_TITLE:
+ if (htmlc->title != NULL)
+ break;
+ htmlc->title = dom_node_ref(node);
+ break;
+ case DOM_HTML_ELEMENT_TYPE_BASE:
+ html_process_base(htmlc, (dom_node *)node);
+ break;
+ case DOM_HTML_ELEMENT_TYPE_IMG:
+ html_process_img(htmlc, (dom_node *) node);
+ break;
+ default:
+ break;
}
if (htmlc->enable_scripting) {
/* ensure javascript context is available */
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=b58176c65efa467b358...
commit b58176c65efa467b358eda1e921ea914dcee1a1b
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Spaces to tabs.
diff --git a/render/box_construct.c b/render/box_construct.c
index 6a36316..25686c9 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -65,7 +65,7 @@ struct box_construct_ctx {
box_construct_complete_cb cb; /**< Callback to invoke on completion */
- int *bctx; /**< talloc context */
+ int *bctx; /**< talloc context */
};
/**
-----------------------------------------------------------------------
Summary of changes:
render/box_construct.c | 2 +-
render/html.c | 62 ++++++++++++++++++++++++------------------------
2 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/render/box_construct.c b/render/box_construct.c
index 6a36316..25686c9 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -65,7 +65,7 @@ struct box_construct_ctx {
box_construct_complete_cb cb; /**< Callback to invoke on completion */
- int *bctx; /**< talloc context */
+ int *bctx; /**< talloc context */
};
/**
diff --git a/render/html.c b/render/html.c
index 0c278a7..cdd78e7 100644
--- a/render/html.c
+++ b/render/html.c
@@ -629,7 +629,6 @@ dom_default_action_DOMNodeInserted_cb(struct dom_event *evt, void
*pw)
{
dom_event_target *node;
dom_node_type type;
- dom_string *name;
dom_exception exc;
html_content *htmlc = pw;
@@ -638,38 +637,39 @@ dom_default_action_DOMNodeInserted_cb(struct dom_event *evt, void
*pw)
exc = dom_node_get_node_type(node, &type);
if ((exc == DOM_NO_ERR) && (type == DOM_ELEMENT_NODE)) {
/* an element node has been inserted */
- exc = dom_node_get_node_name(node, &name);
- if ((exc == DOM_NO_ERR) && (name != NULL)) {
+ dom_html_element_type tag_type;
- if (dom_string_caseless_isequal(name,
- corestring_dom_link)) {
- /* Handle stylesheet loading */
- html_css_process_link(htmlc,
- (dom_node *)node);
- /* Generic link handling */
- html_process_link(htmlc,
- (dom_node *)node);
-
- } else if (dom_string_caseless_lwc_isequal(name,
- corestring_lwc_meta) &&
- htmlc->refresh == false) {
- html_meta_refresh_process_element(htmlc,
- (dom_node *)node);
- } else if (dom_string_caseless_lwc_isequal(
- name, corestring_lwc_base)) {
- html_process_base(htmlc,
- (dom_node *)node);
- } else if (dom_string_caseless_lwc_isequal(
- name, corestring_lwc_title) &&
- htmlc->title == NULL) {
- htmlc->title = dom_node_ref(node);
- } else if (dom_string_caseless_lwc_isequal(
- name, corestring_lwc_img)) {
- html_process_img(htmlc,
- (dom_node *) node);
- }
+ exc = dom_html_element_get_tag_type(node, &tag_type);
+ if (exc != DOM_NO_ERR) {
+ tag_type = DOM_HTML_ELEMENT_TYPE__UNKNOWN;
+ }
- dom_string_unref(name);
+ switch (tag_type) {
+ case DOM_HTML_ELEMENT_TYPE_LINK:
+ /* Handle stylesheet loading */
+ html_css_process_link(htmlc, (dom_node *)node);
+ /* Generic link handling */
+ html_process_link(htmlc, (dom_node *)node);
+ break;
+ case DOM_HTML_ELEMENT_TYPE_META:
+ if (htmlc->refresh)
+ break;
+ html_meta_refresh_process_element(htmlc,
+ (dom_node *)node);
+ break;
+ case DOM_HTML_ELEMENT_TYPE_TITLE:
+ if (htmlc->title != NULL)
+ break;
+ htmlc->title = dom_node_ref(node);
+ break;
+ case DOM_HTML_ELEMENT_TYPE_BASE:
+ html_process_base(htmlc, (dom_node *)node);
+ break;
+ case DOM_HTML_ELEMENT_TYPE_IMG:
+ html_process_img(htmlc, (dom_node *) node);
+ break;
+ default:
+ break;
}
if (htmlc->enable_scripting) {
/* ensure javascript context is available */
--
NetSurf Browser