Skip to content

Commit 3034e36

Browse files
authored
Merge branch 'cppdoc-cc:main' into main
2 parents dbce1f2 + 43a4182 commit 3034e36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

migrate/text-from-element.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ function isBlockElement(node: Node): boolean {
2424
return true;
2525
}
2626

27-
const style = window.getComputedStyle(element);
27+
const style = element.ownerDocument.defaultView!.getComputedStyle(element);
2828
return style.display === 'block' ||
2929
style.display === 'flex' ||
3030
style.display === 'grid' ||
3131
style.display.startsWith('table');
3232
}
3333

3434
function isElementVisible(element: HTMLElement): boolean {
35-
const style = window.getComputedStyle(element);
35+
const style = element.ownerDocument.defaultView!.getComputedStyle(element);
3636
return style.display !== 'none' &&
3737
style.visibility !== 'hidden' &&
3838
style.opacity !== '0';

0 commit comments

Comments
 (0)