You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.3 KiB
JavaScript

'use strict';
const {registerHTMLClass} = require('../shared/register-html-class.js');
const {stringAttribute} = require('../shared/attributes.js');
const {HTMLElement} = require('./element.js');
const tagName = 'a';
/**
* @implements globalThis.HTMLAnchorElement
*/
class HTMLAnchorElement extends HTMLElement {
constructor(ownerDocument, localName = tagName) {
super(ownerDocument, localName);
}
/* c8 ignore start */ // copy paste from img.src, already covered
get href() { return encodeURI(decodeURI(stringAttribute.get(this, 'href'))); }
set href(value) { stringAttribute.set(this, 'href', decodeURI(value)); }
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'); }
set target(value) { stringAttribute.set(this, 'target', value); }
get type() { return stringAttribute.get(this, 'type'); }
set type(value) { stringAttribute.set(this, 'type', value); }
get rel() { return stringAttribute.get(this, 'rel'); }
set rel(value) { stringAttribute.set(this, 'rel', value); }
/* c8 ignore stop */
}
registerHTMLClass(tagName, HTMLAnchorElement);
exports.HTMLAnchorElement = HTMLAnchorElement;