mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 04:26:50 +03:00
add stub implemntation for event handling in elements
This commit is contained in:
parent
3052864773
commit
70ece8a428
@ -51,10 +51,10 @@ jsobject *js_newcompartment(jscontext *ctx, void *win_priv, void *doc_priv);
|
||||
/* execute some javascript in a context */
|
||||
bool js_exec(jscontext *ctx, const char *txt, size_t txtlen);
|
||||
|
||||
typedef struct dom_document dom_document;
|
||||
typedef struct dom_node dom_node;
|
||||
struct dom_document;
|
||||
struct dom_node;
|
||||
|
||||
/* fire an event at a dom node */
|
||||
bool js_fire_event(jscontext *ctx, const char *type, dom_document *doc, dom_node *target);
|
||||
bool js_fire_event(jscontext *ctx, const char *type, struct dom_document *doc, struct dom_node *target);
|
||||
|
||||
#endif /* _NETSURF_JAVASCRIPT_JS_H_ */
|
||||
|
@ -36,6 +36,8 @@ binding htmlelement {
|
||||
|
||||
private "dom_element *" node;
|
||||
private "struct html_content *" htmlc;
|
||||
|
||||
property unshared type EventHandler;
|
||||
}
|
||||
|
||||
api finalise %{
|
||||
@ -214,3 +216,26 @@ getter childElementCount %{
|
||||
}
|
||||
}
|
||||
%}
|
||||
|
||||
getter EventHandler %{
|
||||
JSLOG("propname[%d]=\"%s\"",
|
||||
tinyid,
|
||||
jsclass_properties[tinyid].name);
|
||||
%}
|
||||
|
||||
setter EventHandler %{
|
||||
JSLOG("propname[%d]=\"%s\"",
|
||||
tinyid,
|
||||
jsclass_properties[tinyid].name);
|
||||
|
||||
/*
|
||||
1. Create a dom_event_listener From a handle_event function pointer
|
||||
and a private word In a document context
|
||||
|
||||
2. Register for your events on a target (dom nodes are targets)
|
||||
dom_event_target_add_event_listener(node, evt_name, listener,
|
||||
capture_or_not)
|
||||
|
||||
*/
|
||||
|
||||
%}
|
||||
|
@ -258,12 +258,16 @@ getter EventHandler %{
|
||||
/* this implementation is unique to the window object as it is
|
||||
* not a dom node.
|
||||
*/
|
||||
JSLOG("propname[%d] %s %s", tinyid , jsclass_properties[tinyid].name, JS_GetTypeName(cx, JS_TypeOfValue(cx, tinyid_jsval)));
|
||||
JSLOG("propname[%d]=\"%s\"",
|
||||
tinyid,
|
||||
jsclass_properties[tinyid].name);
|
||||
%}
|
||||
|
||||
setter EventHandler %{
|
||||
/* this implementation is unique to the window object as it is
|
||||
* not a dom node.
|
||||
*/
|
||||
JSLOG("propname[%d] %s %s", tinyid, jsclass_properties[tinyid].name, JS_GetTypeName(cx, JS_TypeOfValue(cx, tinyid_jsval)));
|
||||
JSLOG("propname[%d]=\"%s\"",
|
||||
tinyid,
|
||||
jsclass_properties[tinyid].name);
|
||||
%}
|
||||
|
Loading…
Reference in New Issue
Block a user