(content: string)
| 120 | } |
| 121 | |
| 122 | applyText(content: string) { |
| 123 | if (this.lastContent === content) { |
| 124 | return; |
| 125 | } |
| 126 | this.lastContent = content; |
| 127 | this.lastUrl = undefined; |
| 128 | const element = document.createElement('style'); |
| 129 | element.setAttribute('type', 'text/css'); |
| 130 | if (this.id) { |
| 131 | element.setAttribute('data-id', this.id); |
| 132 | } |
| 133 | element.appendChild(document.createTextNode(content)); |
| 134 | document.head.insertBefore(element, this.placeholder.parentNode === document.head ? this.placeholder.nextSibling : null); |
| 135 | document.head.removeChild(this.placeholder); |
| 136 | this.placeholder = element; |
| 137 | } |
| 138 | |
| 139 | applyUrl(url: string) { |
| 140 | if (this.lastUrl === url) { |
no test coverage detected