Skip to content

Commit

Permalink
Fixed .href returning relative urls (https://github.com/tmpvar/jsdom/…
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Wolf committed Nov 23, 2010
1 parent 3b47e36 commit 71f1a26
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/jsdom/level2/html.js
Expand Up @@ -423,6 +423,11 @@ define('HTMLFormElement', {

define('HTMLLinkElement', {
tagName: 'LINK',
proto: {
get href() {
return core.resourceLoader.resolve(this.ownerDocument, this.getAttribute('href'));
}
},
attributes: [
{prop: 'disabled', type: 'boolean'},
'charset',
Expand Down Expand Up @@ -962,7 +967,7 @@ define('HTMLAnchorElement', {
focus: function() {
},
get href() {
return this.getAttribute('href').replace(/^\.\//,'/');
return core.resourceLoader.resolve(this.ownerDocument, this.getAttribute('href'));
}
},
attributes: [
Expand Down

0 comments on commit 71f1a26

Please sign in to comment.