Debian Codegraph @

mixmark-io-domino/lib/Window.js

raw symbols SCIP
1 "use strict";
2 var DOMImplementation = require('./DOMImplementation');
3 var EventTarget = require('./EventTarget');
4 var Location = require('./Location');
5 var utils = require('./utils');
6
7 module.exports = Window;
8
9 function Window(document) {
10 this.document = document || new DOMImplementation(null).createHTMLDocument("");
11 this.document._scripting_enabled = true;
12 this.document.defaultView = this;
13 this.location = new Location(this, this.document._address || 'about:blank');
14 }
15
16 Window.prototype = Object.create(EventTarget.prototype, {
17 console: { value: console },
18 history: { value: {
19 back: utils.nyi,
20 forward: utils.nyi,
21 go: utils.nyi
22 }},
23 navigator: { value: require("./NavigatorID") },
24
25 // Self-referential properties
26 window: { get: function() { return this; }},
27 self: { get: function() { return this; }},
28 frames: { get: function() { return this; }},
29
30 // Self-referential properties for a top-level window
31 parent: { get: function() { return this; }},
32 top: { get: function() { return this; }},
33
34 // We don't support any other windows for now
35 length: { value: 0 }, // no frames
36 frameElement: { value: null }, // not part of a frame
37 opener: { value: null }, // not opened by another window
38
39 // The onload event handler.
40 // XXX: need to support a bunch of other event types, too,
41 // and have them interoperate with document.body.
42
43 onload: {
44 get: function() {
45 return this._getEventHandler("load");
46 },
47 set: function(v) {
48 this._setEventHandler("load", v);
49 }
50 },
51
52 // XXX This is a completely broken implementation
53 getComputedStyle: { value: function getComputedStyle(elt) {
54 return elt.style;
55 }}
56
57 });
58
59 utils.expose(require('./WindowTimers'), Window);
60 utils.expose(require('./impl'), Window);