Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/4137739b8ae3829d679b5...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/4137739b8ae3829d679b59a...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/4137739b8ae3829d679b59a08...
The branch, master has been updated
via 4137739b8ae3829d679b59a0894d1189a4e776d4 (commit)
via c92726d3aa05e7fd3ffb00a2b115c61e42c6270d (commit)
via 180a8f452e0904bdcd6ee7c47a31877e1625bde4 (commit)
via b42a910ed91c91da71e53b4efb9889aa46938aee (commit)
from 9fe01f09c879bd75c369ea064be519adaf3d9837 (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=4137739b8ae3829d679...
commit 4137739b8ae3829d679b59a0894d1189a4e776d4
Author: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Commit: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Tests for body onload behaviour
diff --git a/test/js/event-onloadfrombody.html b/test/js/event-onloadfrombody.html
new file mode 100644
index 0000000..be491e6
--- /dev/null
+++ b/test/js/event-onloadfrombody.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+<title>alert based onload (from body) example</title>
+
+</head>
+
+<body onload="alert('Running onload')">
+<h1>Just look at the log</h1>
+</body>
+</html>
diff --git a/test/js/event-onloadfrombody2.html b/test/js/event-onloadfrombody2.html
new file mode 100644
index 0000000..542e5ec
--- /dev/null
+++ b/test/js/event-onloadfrombody2.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+<title>alert based onload (from body IDL attribute) example</title>
+
+</head>
+
+<body>
+ <h1>Just look at the log</h1>
+ <script type="text/javascript">
+ document.body.onload = function() { alert("onload event from IDL
attribute"); };
+ </script>
+</body>
+</html>
diff --git a/test/js/index.html b/test/js/index.html
index a1bc4c4..f5420ed 100644
--- a/test/js/index.html
+++ b/test/js/index.html
@@ -80,6 +80,7 @@
<h2>Dom events</h2>
<ul>
<li><a href="event-onload.html">window.onload</a></li>
+<li><a
href="event-onloadfrombody.html">body.onload</a></li>
<li><a
href="event-onclick.html">button.onclick</a></li>
</ul>
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=c92726d3aa05e7fd3ff...
commit c92726d3aa05e7fd3ffb00a2b115c61e42c6270d
Author: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Commit: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Support (in a slightly dodgy way) the onload event
diff --git a/javascript/duktape/dukky.c b/javascript/duktape/dukky.c
index d442c7a..f1f62d4 100644
--- a/javascript/duktape/dukky.c
+++ b/javascript/duktape/dukky.c
@@ -448,13 +448,6 @@ bool js_exec(jscontext *ctx, const char *txt, size_t txtlen)
return duk_get_boolean(CTX, 0);
}
-bool js_fire_event(jscontext *ctx, const char *type, struct dom_document *doc, struct
dom_node *target)
-{
- /* La La La */
- LOG("Oh dear, an event: %s", type);
- return true;
-}
-
/*** New style event handling ***/
static void dukky_push_event(duk_context *ctx, dom_event *evt)
@@ -805,3 +798,106 @@ void js_event_cleanup(jscontext *ctx, struct dom_event *evt)
duk_pop(CTX);
/* ... */
}
+
+bool js_fire_event(jscontext *ctx, const char *type, struct dom_document *doc, struct
dom_node *target)
+{
+ dom_exception exc;
+ dom_event *evt;
+ dom_event_target *body;
+
+ LOG("Event: %s (doc=%p, target=%p)", type, doc, target);
+
+ /** @todo Make this more generic, this only handles load and only
+ * targetting the window, so that we actually stand a chance of
+ * getting 3.4 out.
+ */
+
+ if (target != NULL)
+ /* Swallow non-Window-targetted events quietly */
+ return true;
+
+ if (strcmp(type, "load") != 0)
+ /* Swallow non-load events quietly */
+ return true;
+
+ /* Okay, we're processing load, targetted at Window, do the single
+ * thing which gets us there, which is to find the appropriate event
+ * handler and call it. If we have no event handler on Window then
+ * we divert to the body, and if there's no event handler there
+ * we swallow the event silently
+ */
+
+ exc = dom_event_create(&evt);
+ if (exc != DOM_NO_ERR) return true;
+ exc = dom_event_init(evt, corestring_dom_load, false, false);
+ if (exc != DOM_NO_ERR) {
+ dom_event_unref(evt);
+ return true;
+ }
+ /* ... */
+ duk_get_global_string(CTX, HANDLER_MAGIC);
+ /* ... handlers */
+ duk_push_lstring(CTX, "load", 4);
+ /* ... handlers "load" */
+ duk_get_prop(CTX, -2);
+ /* ... handlers handler? */
+ if (duk_is_undefined(CTX, -1)) {
+ /* No handler here, *try* and retrieve a handler from
+ * the body
+ */
+ duk_pop(CTX);
+ /* ... handlers */
+ exc = dom_html_document_get_body(doc, &body);
+ if (exc != DOM_NO_ERR) {
+ dom_event_unref(evt);
+ return true;
+ }
+ dukky_push_node(CTX, (struct dom_node *)body);
+ /* ... handlers bodynode */
+ if (dukky_get_current_value_of_event_handler(
+ CTX, corestring_dom_load, body) == false) {
+ /* ... handlers */
+ duk_pop(CTX);
+ return true;
+ }
+ /* ... handlers handler bodynode */
+ duk_pop(CTX);
+ }
+ /* ... handlers handler */
+ duk_insert(CTX, -2);
+ /* ... handler handlers */
+ duk_pop(CTX);
+ /* ... handler */
+ duk_push_global_object(CTX);
+ /* ... handler Window */
+ dukky_push_event(CTX, evt);
+ /* ... handler Window event */
+ if (duk_pcall_method(CTX, 1) != 0) {
+ /* Failed to run the handler */
+ /* ... err */
+ LOG("OH NOES! An error running a handler. Meh.");
+ duk_get_prop_string(CTX, -1, "name");
+ duk_get_prop_string(CTX, -2, "message");
+ duk_get_prop_string(CTX, -3, "fileName");
+ duk_get_prop_string(CTX, -4, "lineNumber");
+ duk_get_prop_string(CTX, -5, "stack");
+ /* ... err name message fileName lineNumber stack */
+ LOG("Uncaught error in JS: %s: %s", duk_safe_to_string(CTX, -5),
+ duk_safe_to_string(CTX, -4));
+ LOG(" was at: %s line %s", duk_safe_to_string(CTX, -3),
+ duk_safe_to_string(CTX, -2));
+ LOG(" Stack trace: %s", duk_safe_to_string(CTX, -1));
+
+ duk_pop_n(CTX, 6);
+ /* ... */
+ js_event_cleanup(ctx, evt);
+ dom_event_unref(evt);
+ return true;
+ }
+ /* ... result */
+ duk_pop(CTX);
+ /* ... */
+ js_event_cleanup(ctx, evt);
+ dom_event_unref(evt);
+ return true;
+}
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=180a8f452e0904bdcd6...
commit 180a8f452e0904bdcd6ee7c47a31877e1625bde4
Author: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Commit: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Add missing finaliser -- releases events properly
diff --git a/javascript/duktape/Event.bnd b/javascript/duktape/Event.bnd
index 38e4640..a0bc3c3 100644
--- a/javascript/duktape/Event.bnd
+++ b/javascript/duktape/Event.bnd
@@ -19,6 +19,11 @@ init Event (struct dom_event *evt)
dom_event_ref(evt);
%}
+fini Event ()
+%{
+ dom_event_unref(priv->evt);
+%}
+
/* Note: many of these could be automatics once nsgenbind gets there. */
getter Event::type ()
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=b42a910ed91c91da71e...
commit b42a910ed91c91da71e53b4efb9889aa46938aee
Author: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Commit: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Ensure that those events listed in 8.1.5.2 as forwarded from body to window, don't
get registered for listeners on body
diff --git a/javascript/duktape/dukky.c b/javascript/duktape/dukky.c
index e56d517..d442c7a 100644
--- a/javascript/duktape/dukky.c
+++ b/javascript/duktape/dukky.c
@@ -726,6 +726,16 @@ void js_handle_new_element(jscontext *ctx, struct dom_element *node)
dom_ulong siz;
dom_attr *attr = NULL;
dom_string *key = NULL;
+ dom_string *nodename;
+ duk_bool_t is_body = false;
+
+ exc = dom_node_get_node_name(node, &nodename);
+ if (exc != DOM_NO_ERR) return;
+
+ if (nodename == corestring_dom_BODY)
+ is_body = true;
+
+ dom_string_unref(nodename);
exc = dom_node_get_attributes(node, &map);
if (exc != DOM_NO_ERR) return;
@@ -739,6 +749,19 @@ void js_handle_new_element(jscontext *ctx, struct dom_element *node)
if (exc != DOM_NO_ERR) goto out;
exc = dom_attr_get_name(attr, &key);
if (exc != DOM_NO_ERR) goto out;
+ if (is_body && (
+ key == corestring_dom_onblur ||
+ key == corestring_dom_onerror ||
+ key == corestring_dom_onfocus ||
+ key == corestring_dom_onload ||
+ key == corestring_dom_onresize ||
+ key == corestring_dom_onscroll)) {
+ /* This is a forwarded event, it doesn't matter,
+ * we should skip registering for it and later
+ * we will register it for Window itself
+ */
+ goto skip_register;
+ }
if (dom_string_length(key) > 2) {
/* Can be on* */
const uint8_t *data = (const uint8_t *)dom_string_data(key);
@@ -754,6 +777,7 @@ void js_handle_new_element(jscontext *ctx, struct dom_element *node)
}
}
}
+ skip_register:
dom_string_unref(key); key = NULL;
dom_node_unref(attr); attr = NULL;
}
diff --git a/utils/corestrings.c b/utils/corestrings.c
index c263565..493dace 100644
--- a/utils/corestrings.c
+++ b/utils/corestrings.c
@@ -269,6 +269,12 @@ dom_string *corestring_dom_radio;
dom_string *corestring_dom_checkbox;
dom_string *corestring_dom_file;
dom_string *corestring_dom_on;
+dom_string *corestring_dom_onblur;
+dom_string *corestring_dom_onerror;
+dom_string *corestring_dom_onfocus;
+dom_string *corestring_dom_onload;
+dom_string *corestring_dom_onresize;
+dom_string *corestring_dom_onscroll;
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;
@@ -544,7 +550,15 @@ void corestrings_fini(void)
CSS_DOM_STRING_UNREF(radio);
CSS_DOM_STRING_UNREF(checkbox);
CSS_DOM_STRING_UNREF(file);
+ /* DOM event prefix */
CSS_DOM_STRING_UNREF(on);
+ /* DOM events forwarded from body to window */
+ CSS_DOM_STRING_UNREF(onblur);
+ CSS_DOM_STRING_UNREF(onerror);
+ CSS_DOM_STRING_UNREF(onfocus);
+ CSS_DOM_STRING_UNREF(onload);
+ CSS_DOM_STRING_UNREF(onresize);
+ CSS_DOM_STRING_UNREF(onscroll);
/* DOM userdata keys, not really CSS */
CSS_DOM_STRING_UNREF(__ns_key_box_node_data);
CSS_DOM_STRING_UNREF(__ns_key_libcss_node_data);
@@ -863,7 +877,15 @@ nserror corestrings_init(void)
CSS_DOM_STRING_INTERN(radio);
CSS_DOM_STRING_INTERN(checkbox);
CSS_DOM_STRING_INTERN(file);
+ /* DOM event prefix */
CSS_DOM_STRING_INTERN(on);
+ /* DOM events forwarded from body to window */
+ CSS_DOM_STRING_INTERN(onblur);
+ CSS_DOM_STRING_INTERN(onerror);
+ CSS_DOM_STRING_INTERN(onfocus);
+ CSS_DOM_STRING_INTERN(onload);
+ CSS_DOM_STRING_INTERN(onresize);
+ CSS_DOM_STRING_INTERN(onscroll);
/* 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 c72e8b0..4913e73 100644
--- a/utils/corestrings.h
+++ b/utils/corestrings.h
@@ -284,7 +284,16 @@ extern struct dom_string *corestring_dom_image;
extern struct dom_string *corestring_dom_radio;
extern struct dom_string *corestring_dom_checkbox;
extern struct dom_string *corestring_dom_file;
+/* Event prefix */
extern struct dom_string *corestring_dom_on;
+/* These are the event attributes which forward from body to window */
+extern struct dom_string *corestring_dom_onblur;
+extern struct dom_string *corestring_dom_onerror;
+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;
+
/* 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;
-----------------------------------------------------------------------
Summary of changes:
javascript/duktape/Event.bnd | 5 ++
javascript/duktape/dukky.c | 134 ++++++++++++++++++++++++++++++++++--
test/js/event-onloadfrombody.html | 10 +++
test/js/event-onloadfrombody2.html | 13 ++++
test/js/index.html | 1 +
utils/corestrings.c | 22 ++++++
utils/corestrings.h | 9 +++
7 files changed, 187 insertions(+), 7 deletions(-)
create mode 100644 test/js/event-onloadfrombody.html
create mode 100644 test/js/event-onloadfrombody2.html
diff --git a/javascript/duktape/Event.bnd b/javascript/duktape/Event.bnd
index 38e4640..a0bc3c3 100644
--- a/javascript/duktape/Event.bnd
+++ b/javascript/duktape/Event.bnd
@@ -19,6 +19,11 @@ init Event (struct dom_event *evt)
dom_event_ref(evt);
%}
+fini Event ()
+%{
+ dom_event_unref(priv->evt);
+%}
+
/* Note: many of these could be automatics once nsgenbind gets there. */
getter Event::type ()
diff --git a/javascript/duktape/dukky.c b/javascript/duktape/dukky.c
index e56d517..f1f62d4 100644
--- a/javascript/duktape/dukky.c
+++ b/javascript/duktape/dukky.c
@@ -448,13 +448,6 @@ bool js_exec(jscontext *ctx, const char *txt, size_t txtlen)
return duk_get_boolean(CTX, 0);
}
-bool js_fire_event(jscontext *ctx, const char *type, struct dom_document *doc, struct
dom_node *target)
-{
- /* La La La */
- LOG("Oh dear, an event: %s", type);
- return true;
-}
-
/*** New style event handling ***/
static void dukky_push_event(duk_context *ctx, dom_event *evt)
@@ -726,6 +719,16 @@ void js_handle_new_element(jscontext *ctx, struct dom_element *node)
dom_ulong siz;
dom_attr *attr = NULL;
dom_string *key = NULL;
+ dom_string *nodename;
+ duk_bool_t is_body = false;
+
+ exc = dom_node_get_node_name(node, &nodename);
+ if (exc != DOM_NO_ERR) return;
+
+ if (nodename == corestring_dom_BODY)
+ is_body = true;
+
+ dom_string_unref(nodename);
exc = dom_node_get_attributes(node, &map);
if (exc != DOM_NO_ERR) return;
@@ -739,6 +742,19 @@ void js_handle_new_element(jscontext *ctx, struct dom_element *node)
if (exc != DOM_NO_ERR) goto out;
exc = dom_attr_get_name(attr, &key);
if (exc != DOM_NO_ERR) goto out;
+ if (is_body && (
+ key == corestring_dom_onblur ||
+ key == corestring_dom_onerror ||
+ key == corestring_dom_onfocus ||
+ key == corestring_dom_onload ||
+ key == corestring_dom_onresize ||
+ key == corestring_dom_onscroll)) {
+ /* This is a forwarded event, it doesn't matter,
+ * we should skip registering for it and later
+ * we will register it for Window itself
+ */
+ goto skip_register;
+ }
if (dom_string_length(key) > 2) {
/* Can be on* */
const uint8_t *data = (const uint8_t *)dom_string_data(key);
@@ -754,6 +770,7 @@ void js_handle_new_element(jscontext *ctx, struct dom_element *node)
}
}
}
+ skip_register:
dom_string_unref(key); key = NULL;
dom_node_unref(attr); attr = NULL;
}
@@ -781,3 +798,106 @@ void js_event_cleanup(jscontext *ctx, struct dom_event *evt)
duk_pop(CTX);
/* ... */
}
+
+bool js_fire_event(jscontext *ctx, const char *type, struct dom_document *doc, struct
dom_node *target)
+{
+ dom_exception exc;
+ dom_event *evt;
+ dom_event_target *body;
+
+ LOG("Event: %s (doc=%p, target=%p)", type, doc, target);
+
+ /** @todo Make this more generic, this only handles load and only
+ * targetting the window, so that we actually stand a chance of
+ * getting 3.4 out.
+ */
+
+ if (target != NULL)
+ /* Swallow non-Window-targetted events quietly */
+ return true;
+
+ if (strcmp(type, "load") != 0)
+ /* Swallow non-load events quietly */
+ return true;
+
+ /* Okay, we're processing load, targetted at Window, do the single
+ * thing which gets us there, which is to find the appropriate event
+ * handler and call it. If we have no event handler on Window then
+ * we divert to the body, and if there's no event handler there
+ * we swallow the event silently
+ */
+
+ exc = dom_event_create(&evt);
+ if (exc != DOM_NO_ERR) return true;
+ exc = dom_event_init(evt, corestring_dom_load, false, false);
+ if (exc != DOM_NO_ERR) {
+ dom_event_unref(evt);
+ return true;
+ }
+ /* ... */
+ duk_get_global_string(CTX, HANDLER_MAGIC);
+ /* ... handlers */
+ duk_push_lstring(CTX, "load", 4);
+ /* ... handlers "load" */
+ duk_get_prop(CTX, -2);
+ /* ... handlers handler? */
+ if (duk_is_undefined(CTX, -1)) {
+ /* No handler here, *try* and retrieve a handler from
+ * the body
+ */
+ duk_pop(CTX);
+ /* ... handlers */
+ exc = dom_html_document_get_body(doc, &body);
+ if (exc != DOM_NO_ERR) {
+ dom_event_unref(evt);
+ return true;
+ }
+ dukky_push_node(CTX, (struct dom_node *)body);
+ /* ... handlers bodynode */
+ if (dukky_get_current_value_of_event_handler(
+ CTX, corestring_dom_load, body) == false) {
+ /* ... handlers */
+ duk_pop(CTX);
+ return true;
+ }
+ /* ... handlers handler bodynode */
+ duk_pop(CTX);
+ }
+ /* ... handlers handler */
+ duk_insert(CTX, -2);
+ /* ... handler handlers */
+ duk_pop(CTX);
+ /* ... handler */
+ duk_push_global_object(CTX);
+ /* ... handler Window */
+ dukky_push_event(CTX, evt);
+ /* ... handler Window event */
+ if (duk_pcall_method(CTX, 1) != 0) {
+ /* Failed to run the handler */
+ /* ... err */
+ LOG("OH NOES! An error running a handler. Meh.");
+ duk_get_prop_string(CTX, -1, "name");
+ duk_get_prop_string(CTX, -2, "message");
+ duk_get_prop_string(CTX, -3, "fileName");
+ duk_get_prop_string(CTX, -4, "lineNumber");
+ duk_get_prop_string(CTX, -5, "stack");
+ /* ... err name message fileName lineNumber stack */
+ LOG("Uncaught error in JS: %s: %s", duk_safe_to_string(CTX, -5),
+ duk_safe_to_string(CTX, -4));
+ LOG(" was at: %s line %s", duk_safe_to_string(CTX, -3),
+ duk_safe_to_string(CTX, -2));
+ LOG(" Stack trace: %s", duk_safe_to_string(CTX, -1));
+
+ duk_pop_n(CTX, 6);
+ /* ... */
+ js_event_cleanup(ctx, evt);
+ dom_event_unref(evt);
+ return true;
+ }
+ /* ... result */
+ duk_pop(CTX);
+ /* ... */
+ js_event_cleanup(ctx, evt);
+ dom_event_unref(evt);
+ return true;
+}
diff --git a/test/js/event-onloadfrombody.html b/test/js/event-onloadfrombody.html
new file mode 100644
index 0000000..be491e6
--- /dev/null
+++ b/test/js/event-onloadfrombody.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+<title>alert based onload (from body) example</title>
+
+</head>
+
+<body onload="alert('Running onload')">
+<h1>Just look at the log</h1>
+</body>
+</html>
diff --git a/test/js/event-onloadfrombody2.html b/test/js/event-onloadfrombody2.html
new file mode 100644
index 0000000..542e5ec
--- /dev/null
+++ b/test/js/event-onloadfrombody2.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+<title>alert based onload (from body IDL attribute) example</title>
+
+</head>
+
+<body>
+ <h1>Just look at the log</h1>
+ <script type="text/javascript">
+ document.body.onload = function() { alert("onload event from IDL
attribute"); };
+ </script>
+</body>
+</html>
diff --git a/test/js/index.html b/test/js/index.html
index a1bc4c4..f5420ed 100644
--- a/test/js/index.html
+++ b/test/js/index.html
@@ -80,6 +80,7 @@
<h2>Dom events</h2>
<ul>
<li><a href="event-onload.html">window.onload</a></li>
+<li><a
href="event-onloadfrombody.html">body.onload</a></li>
<li><a
href="event-onclick.html">button.onclick</a></li>
</ul>
diff --git a/utils/corestrings.c b/utils/corestrings.c
index c263565..493dace 100644
--- a/utils/corestrings.c
+++ b/utils/corestrings.c
@@ -269,6 +269,12 @@ dom_string *corestring_dom_radio;
dom_string *corestring_dom_checkbox;
dom_string *corestring_dom_file;
dom_string *corestring_dom_on;
+dom_string *corestring_dom_onblur;
+dom_string *corestring_dom_onerror;
+dom_string *corestring_dom_onfocus;
+dom_string *corestring_dom_onload;
+dom_string *corestring_dom_onresize;
+dom_string *corestring_dom_onscroll;
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;
@@ -544,7 +550,15 @@ void corestrings_fini(void)
CSS_DOM_STRING_UNREF(radio);
CSS_DOM_STRING_UNREF(checkbox);
CSS_DOM_STRING_UNREF(file);
+ /* DOM event prefix */
CSS_DOM_STRING_UNREF(on);
+ /* DOM events forwarded from body to window */
+ CSS_DOM_STRING_UNREF(onblur);
+ CSS_DOM_STRING_UNREF(onerror);
+ CSS_DOM_STRING_UNREF(onfocus);
+ CSS_DOM_STRING_UNREF(onload);
+ CSS_DOM_STRING_UNREF(onresize);
+ CSS_DOM_STRING_UNREF(onscroll);
/* DOM userdata keys, not really CSS */
CSS_DOM_STRING_UNREF(__ns_key_box_node_data);
CSS_DOM_STRING_UNREF(__ns_key_libcss_node_data);
@@ -863,7 +877,15 @@ nserror corestrings_init(void)
CSS_DOM_STRING_INTERN(radio);
CSS_DOM_STRING_INTERN(checkbox);
CSS_DOM_STRING_INTERN(file);
+ /* DOM event prefix */
CSS_DOM_STRING_INTERN(on);
+ /* DOM events forwarded from body to window */
+ CSS_DOM_STRING_INTERN(onblur);
+ CSS_DOM_STRING_INTERN(onerror);
+ CSS_DOM_STRING_INTERN(onfocus);
+ CSS_DOM_STRING_INTERN(onload);
+ CSS_DOM_STRING_INTERN(onresize);
+ CSS_DOM_STRING_INTERN(onscroll);
/* 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 c72e8b0..4913e73 100644
--- a/utils/corestrings.h
+++ b/utils/corestrings.h
@@ -284,7 +284,16 @@ extern struct dom_string *corestring_dom_image;
extern struct dom_string *corestring_dom_radio;
extern struct dom_string *corestring_dom_checkbox;
extern struct dom_string *corestring_dom_file;
+/* Event prefix */
extern struct dom_string *corestring_dom_on;
+/* These are the event attributes which forward from body to window */
+extern struct dom_string *corestring_dom_onblur;
+extern struct dom_string *corestring_dom_onerror;
+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;
+
/* 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;
--
NetSurf Browser