diff --git a/lib/jsdom/level2/html.js b/lib/jsdom/level2/html.js index 549e5f37fd..72da1a0388 100644 --- a/lib/jsdom/level2/html.js +++ b/lib/jsdom/level2/html.js @@ -430,6 +430,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', @@ -969,7 +974,7 @@ define('HTMLAnchorElement', { focus: function() { }, get href() { - return this.getAttribute('href').replace(/^\.\//,'/'); + return core.resourceLoader.resolve(this.ownerDocument, this.getAttribute('href')); } }, attributes: [