summaryrefslogtreecommitdiff
path: root/javascript/jsapi/window.bnd
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2013-01-08 23:36:09 +0100
committerOle Loots <ole@monochrom.net>2013-01-08 23:36:09 +0100
commitb96d7afc771caf891a256adc82bd9e8a2dad9b7c (patch)
tree0c015f5c122fb8355bd86ad7e961433bdd46e33f /javascript/jsapi/window.bnd
parent13c71436ba6e81be6dc46e245bf1fff43e2e702c (diff)
parentd1dabbb0e28edc5614940c08d594957faa956daf (diff)
downloadnetsurf-b96d7afc771caf891a256adc82bd9e8a2dad9b7c.tar.gz
netsurf-b96d7afc771caf891a256adc82bd9e8a2dad9b7c.tar.bz2
Merge branch 'master' into mono/removing-windom-dependency
Diffstat (limited to 'javascript/jsapi/window.bnd')
-rw-r--r--javascript/jsapi/window.bnd40
1 files changed, 23 insertions, 17 deletions
diff --git a/javascript/jsapi/window.bnd b/javascript/jsapi/window.bnd
index 288b5b3d8..bba1eb7db 100644
--- a/javascript/jsapi/window.bnd
+++ b/javascript/jsapi/window.bnd
@@ -8,9 +8,9 @@
* http://www.opensource.org/licenses/mit-license
*/
-#include "dom.bnd"
webidlfile "html.idl";
+webidlfile "dom.idl";
hdrcomment "Copyright 2012 Vincent Sanders <vince@netsurf-browser.org>";
hdrcomment "This file is part of NetSurf, http://www.netsurf-browser.org/";
@@ -20,7 +20,7 @@ hdrcomment " http://www.opensource.org/licenses/mit-license";
preamble %{
#include <dom/dom.h>
-
+
#include "utils/config.h"
#include "utils/log.h"
#include "utils/corestrings.h"
@@ -35,6 +35,7 @@ preamble %{
#include "nodelist.h"
#include "htmldocument.h"
#include "text.h"
+#include "comment.h"
#include "htmlelement.h"
#include "window.h"
#include "location.h"
@@ -107,7 +108,7 @@ api init %{
return NULL;
/* Initialises all the user javascript classes to make their
- * prototypes available.
+ * prototypes available.
*/
/** @todo should we be managing these prototype objects ourselves */
user_proto = jsapi_InitClass_Document(cx, prototype);
@@ -150,6 +151,11 @@ api init %{
return NULL;
}
+ user_proto = jsapi_InitClass_Comment(cx, prototype);
+ if (user_proto == NULL) {
+ return NULL;
+ }
+
user_proto = jsapi_InitClass_Node(cx, prototype);
if (user_proto == NULL) {
return NULL;
@@ -166,16 +172,16 @@ api new %{
/* @todo sort out windows that are not globals */
assert(parent == NULL);
- /* the window object is the global so its prototype *is* the instance */
- newobject = prototype;
+ /* the window object is the global so its prototype *is* the instance */
+ newobject = prototype;
/* instantiate the subclasses off the window global */
private->document = jsapi_new_Document(cx,
- NULL,
- newobject,
- (dom_document *)dom_node_ref(htmlc->document),
- htmlc);
- if (private->document == NULL) {
+ NULL,
+ newobject,
+ (dom_document *)dom_node_ref(htmlc->document),
+ htmlc);
+ if (private->document == NULL) {
free(private);
return NULL;
}
@@ -212,7 +218,7 @@ operation prompt %{
/* boolean dispatchEvent(Event event); */
operation dispatchEvent %{
/* this implementation is unique to the window object as it is
- * not a "real" dom node.
+ * not a "real" dom node.
*/
/* caution, this must match the struct generated from event.bnd */
@@ -242,7 +248,7 @@ operation dispatchEvent %{
jsret = JS_CallFunctionValue(cx, NULL, eventval, 1, event_argv, &event_rval);
}
}
- }
+ }
%}
getter location %{
@@ -261,18 +267,18 @@ getter self %{
getter EventHandler %{
/* this implementation is unique to the window object as it is
- * not a dom node.
+ * not a dom node.
*/
- JSLOG("propname[%d]=\"%s\"",
+ 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.
+ * not a dom node.
*/
- JSLOG("propname[%d]=\"%s\"",
- tinyid,
+ JSLOG("propname[%d]=\"%s\"",
+ tinyid,
jsclass_properties[tinyid].name);
%}