fix(electron/android): re-add Element.prototype.checkVisibility check (#28173)

Regressed in https://github.com/microsoft/playwright/pull/28148.
This commit is contained in:
Max Schmitt 2023-11-16 00:10:13 +01:00 committed by GitHub
parent 7ffcb42551
commit 80bab8afae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {