From 80bab8afae12603e9a8ed6a094cf7a7317e51a45 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Thu, 16 Nov 2023 00:10:13 +0100 Subject: [PATCH] fix(electron/android): re-add Element.prototype.checkVisibility check (#28173) Regressed in https://github.com/microsoft/playwright/pull/28148. --- packages/playwright-core/src/server/injected/domUtils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/playwright-core/src/server/injected/domUtils.ts b/packages/playwright-core/src/server/injected/domUtils.ts index b20de887545fc..b88cb44c0a0f0 100644 --- a/packages/playwright-core/src/server/injected/domUtils.ts +++ b/packages/playwright-core/src/server/injected/domUtils.ts @@ -82,7 +82,8 @@ export function isElementStyleVisibilityVisible(element: Element, style?: CSSSty // details element for example. // All the browser implement it, but WebKit has a bug which prevents us from using it: // https://bugs.webkit.org/show_bug.cgi?id=264733 - if (browserNameForWorkarounds !== 'webkit') { + // @ts-ignore + if (Element.prototype.checkVisibility && browserNameForWorkarounds !== 'webkit') { if (!element.checkVisibility({ checkOpacity: false, checkVisibilityCSS: false })) return false; } else {