Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cjs/html/anchor-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class HTMLAnchorElement extends HTMLElement {
}

/* c8 ignore start */ // copy paste from img.src, already covered
get href() { return encodeURI(stringAttribute.get(this, 'href')); }
get href() { return encodeURI(decodeURI(stringAttribute.get(this, 'href'))); }
set href(value) { stringAttribute.set(this, 'href', decodeURI(value)); }

get download() { return encodeURI(stringAttribute.get(this, 'download')); }
get download() { return encodeURI(decodeURI(stringAttribute.get(this, 'download'))); }
set download(value) { stringAttribute.set(this, 'download', decodeURI(value)); }

get target() { return stringAttribute.get(this, 'target'); }
Expand Down
4 changes: 2 additions & 2 deletions esm/html/anchor-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ class HTMLAnchorElement extends HTMLElement {
}

/* c8 ignore start */ // copy paste from img.src, already covered
get href() { return encodeURI(stringAttribute.get(this, 'href')); }
get href() { return encodeURI(decodeURI(stringAttribute.get(this, 'href'))); }
set href(value) { stringAttribute.set(this, 'href', decodeURI(value)); }

get download() { return encodeURI(stringAttribute.get(this, 'download')); }
get download() { return encodeURI(decodeURI(stringAttribute.get(this, 'download'))); }
set download(value) { stringAttribute.set(this, 'download', decodeURI(value)); }

get target() { return stringAttribute.get(this, 'target'); }
Expand Down
3 changes: 2 additions & 1 deletion test/html/anchor-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ a.setAttribute('href', 'https://google.com/?q=1&page=2&test="');
assert(a.toString(), '<a href="https://google.com/?q=1&page=2&test=&quot;">click me</a>');
a.setAttribute('href', 'https://google.com/?q=asd&lol=<2>"');
assert(a.href, 'https://google.com/?q=asd&lol=%3C2%3E%22');

a.setAttribute('href', 'https://google.com/path%20to%20some%20file.pdf');
assert(a.href, 'https://google.com/path%20to%20some%20file.pdf');
4 changes: 2 additions & 2 deletions worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -11043,10 +11043,10 @@ class HTMLAnchorElement extends HTMLElement {
}

/* c8 ignore start */ // copy paste from img.src, already covered
get href() { return encodeURI(stringAttribute.get(this, 'href')); }
get href() { return encodeURI(decodeURI(stringAttribute.get(this, 'href'))); }
set href(value) { stringAttribute.set(this, 'href', decodeURI(value)); }

get download() { return encodeURI(stringAttribute.get(this, 'download')); }
get download() { return encodeURI(decodeURI(stringAttribute.get(this, 'download'))); }
set download(value) { stringAttribute.set(this, 'download', decodeURI(value)); }

get target() { return stringAttribute.get(this, 'target'); }
Expand Down