var _a; import CSSStyleSheet from '../../css/CSSStyleSheet.js'; import * as PropertySymbol from '../../PropertySymbol.js'; import HTMLElement from '../html-element/HTMLElement.js'; /** * HTML Style Element. * * Reference: * https://developer.mozilla.org/en-US/docs/Web/API/HTMLStyleElement. */ class HTMLStyleElement extends HTMLElement { constructor() { super(...arguments); this[_a] = null; } /** * Returns CSS style sheet. * * @returns CSS style sheet. */ get sheet() { if (!this[PropertySymbol.isConnected]) { return null; } if (!this[PropertySymbol.sheet]) { this[PropertySymbol.sheet] = new CSSStyleSheet(); } this[PropertySymbol.sheet].replaceSync(this.textContent); return this[PropertySymbol.sheet]; } /** * Returns media. * * @returns Media. */ get media() { return this.getAttribute('media') || ''; } /** * Sets media. * * @param media Media. */ set media(media) { this.setAttribute('media', media); } /** * Returns type. * * @returns Type. */ get type() { return this.getAttribute('type') || ''; } /** * Sets type. * * @param type Type. */ set type(type) { this.setAttribute('type', type); } /** * Returns disabled. * * @returns Disabled. */ get disabled() { return this.getAttribute('disabled') !== null; } /** * Sets disabled. * * @param disabled Disabled. */ set disabled(disabled) { if (!disabled) { this.removeAttribute('disabled'); } else { this.setAttribute('disabled', ''); } } } _a = PropertySymbol.sheet; export default HTMLStyleElement; //# sourceMappingURL=HTMLStyleElement.js.map