(node: HTMLDivElement, selector: string)
| 110 | return computed |
| 111 | |
| 112 | function matchesSafe(node: HTMLDivElement, selector: string) { |
| 113 | if (!selector) { |
| 114 | return false |
| 115 | } |
| 116 | try { |
| 117 | return node.matches(selector) |
| 118 | } catch (error) { |
| 119 | return false |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | function readRule(rule: CSSStyleRule, dest: ComputedStyles) { |
| 124 | if (matchesSafe(div, rule.selectorText)) { |