Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/b41b672fe5228be936715...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/b41b672fe5228be93671525...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/b41b672fe5228be9367152540...
The branch, master has been updated
via b41b672fe5228be936715254003132ee21843242 (commit)
from f7ebec7142321c0d97789015d8185c5b0cacda0c (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=b41b672fe5228be9367...
commit b41b672fe5228be936715254003132ee21843242
Author: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Commit: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Hacky fix to prevent attribute fetch on document objects
diff --git a/javascript/duktape/dukky.c b/javascript/duktape/dukky.c
index b65e94b..3549cd5 100644
--- a/javascript/duktape/dukky.c
+++ b/javascript/duktape/dukky.c
@@ -457,6 +457,22 @@ static void dukky_push_handler_code_(duk_context *ctx, dom_string
*name,
dom_string *onname, *val;
dom_element *ele = (dom_element *)et;
dom_exception exc;
+ dom_node_type ntype;
+
+ /* Currently safe since libdom has no event targets which are not
+ * nodes. Reconsider this as and when we work out how to have
+ * window do stuff
+ */
+ exc = dom_node_get_node_type(et, &ntype);
+ if (exc != DOM_NO_ERR) {
+ duk_push_lstring(ctx, "", 0);
+ return;
+ }
+
+ if (ntype != DOM_ELEMENT_NODE) {
+ duk_push_lstring(ctx, "", 0);
+ return;
+ }
exc = dom_string_concat(corestring_dom_on, name, &onname);
if (exc != DOM_NO_ERR) {
@@ -494,6 +510,8 @@ bool dukky_get_current_value_of_event_handler(duk_context *ctx,
duk_pop_2(ctx);
/* ... node */
dukky_push_handler_code_(ctx, name, et);
+ /* ... node handlercode? */
+ /* TODO: If this is null, clean up and propagate */
/* ... node handlercode */
/** @todo This is entirely wrong, but it's hard to get right */
duk_push_string(ctx, "function (event) {");
-----------------------------------------------------------------------
Summary of changes:
javascript/duktape/dukky.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/javascript/duktape/dukky.c b/javascript/duktape/dukky.c
index b65e94b..3549cd5 100644
--- a/javascript/duktape/dukky.c
+++ b/javascript/duktape/dukky.c
@@ -457,6 +457,22 @@ static void dukky_push_handler_code_(duk_context *ctx, dom_string
*name,
dom_string *onname, *val;
dom_element *ele = (dom_element *)et;
dom_exception exc;
+ dom_node_type ntype;
+
+ /* Currently safe since libdom has no event targets which are not
+ * nodes. Reconsider this as and when we work out how to have
+ * window do stuff
+ */
+ exc = dom_node_get_node_type(et, &ntype);
+ if (exc != DOM_NO_ERR) {
+ duk_push_lstring(ctx, "", 0);
+ return;
+ }
+
+ if (ntype != DOM_ELEMENT_NODE) {
+ duk_push_lstring(ctx, "", 0);
+ return;
+ }
exc = dom_string_concat(corestring_dom_on, name, &onname);
if (exc != DOM_NO_ERR) {
@@ -494,6 +510,8 @@ bool dukky_get_current_value_of_event_handler(duk_context *ctx,
duk_pop_2(ctx);
/* ... node */
dukky_push_handler_code_(ctx, name, et);
+ /* ... node handlercode? */
+ /* TODO: If this is null, clean up and propagate */
/* ... node handlercode */
/** @todo This is entirely wrong, but it's hard to get right */
duk_push_string(ctx, "function (event) {");
--
NetSurf Browser