Skip to content

Commit

Permalink
Added support for Element.form
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Gnass committed Oct 5, 2010
1 parent bf4d1c7 commit a495397
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/jsdom/browser/index.js
Expand Up @@ -624,6 +624,17 @@ var browserAugmentation = exports.browserAugmentation = function(dom, options) {
}
});

dom.Element.prototype.__defineGetter__('form', function() {
var e = this;
while (e) {
if (e.nodeName.toUpperCase() == 'FORM') {
return e;
}
e = this.parentNode;
}
return undefined;
});

dom.Element.prototype.__defineGetter__('textContent', function() {
var stripHTML = /<\S[^><]*>/g;
var out = this.innerHTML;
Expand Down

0 comments on commit a495397

Please sign in to comment.