summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2017-02-05 11:20:08 (GMT)
committer Daniel Silverstone <dsilvers@digital-scurf.org>2017-02-05 11:20:08 (GMT)
commit108cc0cebdca9a3300c9b524d3409eb10fa09b05 (patch)
tree544063dbc75d73b7b0e002e466343be2b1566e45
parent10f1b7a1aaec183defb6ae724576910494026954 (diff)
downloadnetsurf-108cc0cebdca9a3300c9b524d3409eb10fa09b05.tar.gz
netsurf-108cc0cebdca9a3300c9b524d3409eb10fa09b05.tar.bz2
Support fixed nsgenbind bindings
-rw-r--r--content/handlers/javascript/duktape/dukky.c7
-rw-r--r--content/handlers/javascript/duktape/dukky.h3
-rw-r--r--utils/corestrings.c26
-rw-r--r--utils/corestrings.h10
4 files changed, 41 insertions, 5 deletions
diff --git a/content/handlers/javascript/duktape/dukky.c b/content/handlers/javascript/duktape/dukky.c
index 1282ad9..66d1b05 100644
--- a/content/handlers/javascript/duktape/dukky.c
+++ b/content/handlers/javascript/duktape/dukky.c
@@ -895,7 +895,8 @@ static void dukky_generic_event_handler(dom_event *evt, void *pw)
void dukky_register_event_listener_for(duk_context *ctx,
struct dom_element *ele,
- dom_string *name)
+ dom_string *name,
+ bool capture)
{
dom_event_listener *listen = NULL;
dom_exception exc;
@@ -927,7 +928,7 @@ void dukky_register_event_listener_for(duk_context *ctx,
&listen);
if (exc != DOM_NO_ERR) return;
exc = dom_event_target_add_event_listener(
- ele, name, listen, false);
+ ele, name, listen, capture);
if (exc != DOM_NO_ERR) {
LOG("Unable to register listener for %p.%*s",
ele, dom_string_length(name), dom_string_data(name));
@@ -995,7 +996,7 @@ void js_handle_new_element(jscontext *ctx, struct dom_element *node)
&sub);
if (exc == DOM_NO_ERR) {
dukky_register_event_listener_for(
- CTX, node, sub);
+ CTX, node, sub, false);
dom_string_unref(sub);
}
}
diff --git a/content/handlers/javascript/duktape/dukky.h b/content/handlers/javascript/duktape/dukky.h
index 0c3ff0e..1d6baee 100644
--- a/content/handlers/javascript/duktape/dukky.h
+++ b/content/handlers/javascript/duktape/dukky.h
@@ -37,7 +37,8 @@ duk_bool_t dukky_push_node(duk_context *ctx, struct dom_node *node);
void dukky_inject_not_ctr(duk_context *ctx, int idx, const char *name);
void dukky_register_event_listener_for(duk_context *ctx,
struct dom_element *ele,
- dom_string *name);
+ dom_string *name,
+ bool capture);
bool dukky_get_current_value_of_event_handler(duk_context *ctx,
dom_string *name,
dom_event_target *et);
diff --git a/utils/corestrings.c b/utils/corestrings.c
index 363c851..87a3423 100644
--- a/utils/corestrings.c
+++ b/utils/corestrings.c
@@ -277,6 +277,14 @@ dom_string *corestring_dom_onfocus;
dom_string *corestring_dom_onload;
dom_string *corestring_dom_onresize;
dom_string *corestring_dom_onscroll;
+dom_string *corestring_dom_autocomplete;
+dom_string *corestring_dom_autocompleteerror;
+dom_string *corestring_dom_dragexit;
+dom_string *corestring_dom_mouseenter;
+dom_string *corestring_dom_mouseleave;
+dom_string *corestring_dom_wheel;
+dom_string *corestring_dom_sort;
+dom_string *corestring_dom_toggle;
dom_string *corestring_dom___ns_key_box_node_data;
dom_string *corestring_dom___ns_key_libcss_node_data;
dom_string *corestring_dom___ns_key_file_name_node_data;
@@ -563,6 +571,15 @@ void corestrings_fini(void)
CSS_DOM_STRING_UNREF(onload);
CSS_DOM_STRING_UNREF(onresize);
CSS_DOM_STRING_UNREF(onscroll);
+ /* Corestrings used by DOM event registration */
+ CSS_DOM_STRING_UNREF(autocomplete);
+ CSS_DOM_STRING_UNREF(autocompleteerror);
+ CSS_DOM_STRING_UNREF(dragexit);
+ CSS_DOM_STRING_UNREF(mouseenter);
+ CSS_DOM_STRING_UNREF(mouseleave);
+ CSS_DOM_STRING_UNREF(wheel);
+ CSS_DOM_STRING_UNREF(sort);
+ CSS_DOM_STRING_UNREF(toggle);
/* DOM userdata keys, not really CSS */
CSS_DOM_STRING_UNREF(__ns_key_box_node_data);
CSS_DOM_STRING_UNREF(__ns_key_libcss_node_data);
@@ -894,6 +911,15 @@ nserror corestrings_init(void)
CSS_DOM_STRING_INTERN(onload);
CSS_DOM_STRING_INTERN(onresize);
CSS_DOM_STRING_INTERN(onscroll);
+ /* Corestrings used by DOM event registration */
+ CSS_DOM_STRING_INTERN(autocomplete);
+ CSS_DOM_STRING_INTERN(autocompleteerror);
+ CSS_DOM_STRING_INTERN(dragexit);
+ CSS_DOM_STRING_INTERN(mouseenter);
+ CSS_DOM_STRING_INTERN(mouseleave);
+ CSS_DOM_STRING_INTERN(wheel);
+ CSS_DOM_STRING_INTERN(sort);
+ CSS_DOM_STRING_INTERN(toggle);
/* DOM userdata keys, not really CSS */
CSS_DOM_STRING_INTERN(__ns_key_box_node_data);
CSS_DOM_STRING_INTERN(__ns_key_libcss_node_data);
diff --git a/utils/corestrings.h b/utils/corestrings.h
index a02bdda..88dc2ce 100644
--- a/utils/corestrings.h
+++ b/utils/corestrings.h
@@ -295,7 +295,15 @@ extern struct dom_string *corestring_dom_onfocus;
extern struct dom_string *corestring_dom_onload;
extern struct dom_string *corestring_dom_onresize;
extern struct dom_string *corestring_dom_onscroll;
-
+/* Corestrings used by DOM event registration */
+extern struct dom_string *corestring_dom_autocomplete;
+extern struct dom_string *corestring_dom_autocompleteerror;
+extern struct dom_string *corestring_dom_dragexit;
+extern struct dom_string *corestring_dom_mouseenter;
+extern struct dom_string *corestring_dom_mouseleave;
+extern struct dom_string *corestring_dom_wheel;
+extern struct dom_string *corestring_dom_sort;
+extern struct dom_string *corestring_dom_toggle;
/* DOM userdata keys */
extern struct dom_string *corestring_dom___ns_key_box_node_data;
extern struct dom_string *corestring_dom___ns_key_libcss_node_data;