* @param {FakeElement} element element * @returns {StyleDeclaration} computed style
(element)
| 151 | * @returns {StyleDeclaration} computed style |
| 152 | */ |
| 153 | getComputedStyle(element) { |
| 154 | /** @type {StyleDeclaration} */ |
| 155 | const style = { getPropertyValue }; |
| 156 | const links = this.getElementsByTagName("link"); |
| 157 | for (const link of links) { |
| 158 | if (!link.sheet) continue; |
| 159 | for (const rule of link.sheet.cssRules) { |
| 160 | if (rule.selectorText === element._type) { |
| 161 | Object.assign(style, rule.style); |
| 162 | } |
| 163 | } |
| 164 | } |
| 165 | return style; |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | class FakeElement { |
nothing calls this directly
no test coverage detected