Skip to content

Commit

Permalink
Merge branch 'onload-events' into multi-window
Browse files Browse the repository at this point in the history
  • Loading branch information
gleneivey committed Jul 24, 2009
2 parents 13d810a + cee6d5a commit 051e115
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 77 deletions.
1 change: 1 addition & 0 deletions build.xml
Expand Up @@ -81,6 +81,7 @@
<fileset dir="${SRC_DIR}" includes="html/area.js" />
<fileset dir="${SRC_DIR}" includes="html/base.js" />
<fileset dir="${SRC_DIR}" includes="html/blockquote-q.js" />
<fileset dir="${SRC_DIR}" includes="html/body.js" />
<fileset dir="${SRC_DIR}" includes="html/button.js" />
<fileset dir="${SRC_DIR}" includes="html/col-colgroup.js" />
<fileset dir="${SRC_DIR}" includes="html/del-ins.js" />
Expand Down
95 changes: 57 additions & 38 deletions dist/env.js
Expand Up @@ -4945,18 +4945,18 @@ HTMLDocument.prototype = new DOMDocument;
__extend__(HTMLDocument.prototype, {
createElement: function(tagName){
// throw Exception if the tagName string contains an illegal character
if (__ownerDocument__(this).implementation.errorChecking &&
if (__ownerDocument__(this).implementation.errorChecking &&
(!__isValidName__(tagName))) {
throw(new DOMException(DOMException.INVALID_CHARACTER_ERR));
}
tagName = tagName.toUpperCase();
// create DOMElement specifying 'this' as ownerDocument
//This is an html document so we need to use explicit interfaces per the
//This is an html document so we need to use explicit interfaces per the
if( tagName.match(/^A$/)) {node = new HTMLAnchorElement(this);}
else if(tagName.match(/AREA/)) {node = new HTMLAreaElement(this);}
else if(tagName.match(/BASE/)) {node = new HTMLBaseElement(this);}
else if(tagName.match(/BLOCKQUOTE|Q/)) {node = new HTMLQuoteElement(this);}
else if(tagName.match(/BODY/)) {node = new HTMLElement(this);}
else if(tagName.match(/BODY/)) {node = new HTMLBodyElement(this);}
else if(tagName.match(/BR/)) {node = new HTMLElement(this);}
else if(tagName.match(/BUTTON/)) {node = new HTMLButtonElement(this);}
else if(tagName.match(/CAPTION/)) {node = new HTMLElement(this);}
Expand Down Expand Up @@ -5001,27 +5001,27 @@ __extend__(HTMLDocument.prototype, {
else{
node = new HTMLElement(this);
}

// assign values to properties (and aliases)
node.tagName = tagName;
return node;
},
get anchors(){
return new HTMLCollection(this.getElementsByTagName('a'), 'Anchor');

},
get applets(){
return new HTMLCollection(this.getElementsByTagName('applet'), 'Applet');

},
get body(){
get body(){
var nodelist = this.getElementsByTagName('body');
return nodelist.item(0);

},
set body(html){
return this.replaceNode(this.body,html);

},

get title(){
Expand Down Expand Up @@ -5049,44 +5049,44 @@ __extend__(HTMLDocument.prototype, {
//set/get cookie see cookie.js
get domain(){
return this._domain||window.location.domain;

},
set domain(){
/* TODO - requires a bit of thought to enforce domain restrictions */
return;
/* TODO - requires a bit of thought to enforce domain restrictions */
return;

},
get forms(){
return new HTMLCollection(this.getElementsByTagName('form'), 'Form');
},
get images(){
return new HTMLCollection(this.getElementsByTagName('img'), 'Image');

},
get lastModified(){
get lastModified(){
/* TODO */
return this._lastModified;
return this._lastModified;

},
get links(){
return new HTMLCollection(this.getElementsByTagName('a'), 'Link');

},
get location(){
return $w.location
},
get referrer(){
/* TODO */
return this._refferer;
return this._refferer;

},
get URL(){
/* TODO*/
return this._url;
return this._url;

},
close : function(){
/* TODO */
close : function(){
/* TODO */
this._open = false;
},
getElementsByName : function(name){
Expand All @@ -5103,28 +5103,28 @@ __extend__(HTMLDocument.prototype, {
}
return retNodes;
},
open : function(){
open : function(){
/* TODO */
this._open = true;
this._open = true;
},
write: function(htmlstring){
write: function(htmlstring){
/* TODO */
return;
return;

},
writeln: function(htmlstring){
this.write(htmlstring+'\n');
writeln: function(htmlstring){
this.write(htmlstring+'\n');
},
toString: function(){
return "Document" + (typeof this._url == "string" ? ": " + this._url : "");
toString: function(){
return "Document" + (typeof this._url == "string" ? ": " + this._url : "");
},
get innerHTML(){
return this.documentElement.outerHTML;
get innerHTML(){
return this.documentElement.outerHTML;

},
get __html__(){
return true;

}
});

Expand Down Expand Up @@ -5729,7 +5729,23 @@ __extend__(HTMLQuoteElement.prototype, {
}
});

$w.HTMLQuoteElement = HTMLQuoteElement; $debug("Defining HTMLButtonElement");
$w.HTMLQuoteElement = HTMLQuoteElement; $debug("Defining HTMLBodyElement");
/*
* HTMLBodyElement - DOM Level 2
*/
var HTMLBodyElement = function(ownerDocument) {
this.HTMLElement = HTMLElement;
this.HTMLElement(ownerDocument);
};
HTMLBodyElement.prototype = new HTMLElement;
__extend__(HTMLBodyElement.prototype, {
onload: function(event){
__eval__(this.getAttribute('onload')||'')
}
});

$w.HTMLBodyElement = HTMLBodyElement;
$debug("Defining HTMLButtonElement");
/*
* HTMLButtonElement - DOM Level 2
*/
Expand Down Expand Up @@ -6075,6 +6091,9 @@ __extend__(HTMLFrameElement.prototype, {
},
get contentWindow(){
return this._content;
},
onload: function(event){
__eval__(this.getAttribute('onload')||'')
}
});

Expand Down
95 changes: 57 additions & 38 deletions dist/env.rhino.js
Expand Up @@ -5384,18 +5384,18 @@ HTMLDocument.prototype = new DOMDocument;
__extend__(HTMLDocument.prototype, {
createElement: function(tagName){
// throw Exception if the tagName string contains an illegal character
if (__ownerDocument__(this).implementation.errorChecking &&
if (__ownerDocument__(this).implementation.errorChecking &&
(!__isValidName__(tagName))) {
throw(new DOMException(DOMException.INVALID_CHARACTER_ERR));
}
tagName = tagName.toUpperCase();
// create DOMElement specifying 'this' as ownerDocument
//This is an html document so we need to use explicit interfaces per the
//This is an html document so we need to use explicit interfaces per the
if( tagName.match(/^A$/)) {node = new HTMLAnchorElement(this);}
else if(tagName.match(/AREA/)) {node = new HTMLAreaElement(this);}
else if(tagName.match(/BASE/)) {node = new HTMLBaseElement(this);}
else if(tagName.match(/BLOCKQUOTE|Q/)) {node = new HTMLQuoteElement(this);}
else if(tagName.match(/BODY/)) {node = new HTMLElement(this);}
else if(tagName.match(/BODY/)) {node = new HTMLBodyElement(this);}
else if(tagName.match(/BR/)) {node = new HTMLElement(this);}
else if(tagName.match(/BUTTON/)) {node = new HTMLButtonElement(this);}
else if(tagName.match(/CAPTION/)) {node = new HTMLElement(this);}
Expand Down Expand Up @@ -5440,27 +5440,27 @@ __extend__(HTMLDocument.prototype, {
else{
node = new HTMLElement(this);
}

// assign values to properties (and aliases)
node.tagName = tagName;
return node;
},
get anchors(){
return new HTMLCollection(this.getElementsByTagName('a'), 'Anchor');

},
get applets(){
return new HTMLCollection(this.getElementsByTagName('applet'), 'Applet');

},
get body(){
get body(){
var nodelist = this.getElementsByTagName('body');
return nodelist.item(0);

},
set body(html){
return this.replaceNode(this.body,html);

},

get title(){
Expand Down Expand Up @@ -5488,44 +5488,44 @@ __extend__(HTMLDocument.prototype, {
//set/get cookie see cookie.js
get domain(){
return this._domain||window.location.domain;

},
set domain(){
/* TODO - requires a bit of thought to enforce domain restrictions */
return;
/* TODO - requires a bit of thought to enforce domain restrictions */
return;

},
get forms(){
return new HTMLCollection(this.getElementsByTagName('form'), 'Form');
},
get images(){
return new HTMLCollection(this.getElementsByTagName('img'), 'Image');

},
get lastModified(){
get lastModified(){
/* TODO */
return this._lastModified;
return this._lastModified;

},
get links(){
return new HTMLCollection(this.getElementsByTagName('a'), 'Link');

},
get location(){
return $w.location
},
get referrer(){
/* TODO */
return this._refferer;
return this._refferer;

},
get URL(){
/* TODO*/
return this._url;
return this._url;

},
close : function(){
/* TODO */
close : function(){
/* TODO */
this._open = false;
},
getElementsByName : function(name){
Expand All @@ -5542,28 +5542,28 @@ __extend__(HTMLDocument.prototype, {
}
return retNodes;
},
open : function(){
open : function(){
/* TODO */
this._open = true;
this._open = true;
},
write: function(htmlstring){
write: function(htmlstring){
/* TODO */
return;
return;

},
writeln: function(htmlstring){
this.write(htmlstring+'\n');
writeln: function(htmlstring){
this.write(htmlstring+'\n');
},
toString: function(){
return "Document" + (typeof this._url == "string" ? ": " + this._url : "");
toString: function(){
return "Document" + (typeof this._url == "string" ? ": " + this._url : "");
},
get innerHTML(){
return this.documentElement.outerHTML;
get innerHTML(){
return this.documentElement.outerHTML;

},
get __html__(){
return true;

}
});

Expand Down Expand Up @@ -6168,7 +6168,23 @@ __extend__(HTMLQuoteElement.prototype, {
}
});

$w.HTMLQuoteElement = HTMLQuoteElement; $debug("Defining HTMLButtonElement");
$w.HTMLQuoteElement = HTMLQuoteElement; $debug("Defining HTMLBodyElement");
/*
* HTMLBodyElement - DOM Level 2
*/
var HTMLBodyElement = function(ownerDocument) {
this.HTMLElement = HTMLElement;
this.HTMLElement(ownerDocument);
};
HTMLBodyElement.prototype = new HTMLElement;
__extend__(HTMLBodyElement.prototype, {
onload: function(event){
__eval__(this.getAttribute('onload')||'')
}
});

$w.HTMLBodyElement = HTMLBodyElement;
$debug("Defining HTMLButtonElement");
/*
* HTMLButtonElement - DOM Level 2
*/
Expand Down Expand Up @@ -6514,6 +6530,9 @@ __extend__(HTMLFrameElement.prototype, {
},
get contentWindow(){
return this._content;
},
onload: function(event){
__eval__(this.getAttribute('onload')||'')
}
});

Expand Down

0 comments on commit 051e115

Please sign in to comment.