We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 186f8f1 commit 43a4182Copy full SHA for 43a4182
migrate/text-from-element.ts
@@ -24,15 +24,15 @@ function isBlockElement(node: Node): boolean {
24
return true;
25
}
26
27
- const style = window.getComputedStyle(element);
+ const style = element.ownerDocument.defaultView!.getComputedStyle(element);
28
return style.display === 'block' ||
29
style.display === 'flex' ||
30
style.display === 'grid' ||
31
style.display.startsWith('table');
32
33
34
function isElementVisible(element: HTMLElement): boolean {
35
36
return style.display !== 'none' &&
37
style.visibility !== 'hidden' &&
38
style.opacity !== '0';
0 commit comments