feat(webkit): roll to r1944 (#28148)

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
This commit is contained in:
Playwright Service 2023-11-15 10:34:53 -08:00 committed by GitHub
parent b66839b039
commit bb241abaff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 5 deletions

View File

@ -39,7 +39,7 @@
},
{
"name": "webkit",
"revision": "1943",
"revision": "1944",
"installByDefault": true,
"revisionOverrides": {
"mac10.14": "1446",

View File

@ -14,6 +14,11 @@
* limitations under the License.
*/
let browserNameForWorkarounds = '';
export function setBrowserName(name: string) {
browserNameForWorkarounds = name;
}
export function isInsideScope(scope: Node, element: Element | undefined): boolean {
while (element) {
if (scope.contains(element))
@ -75,9 +80,9 @@ export function isElementStyleVisibilityVisible(element: Element, style?: CSSSty
// Element.checkVisibility checks for content-visibility and also looks at
// styles up the flat tree including user-agent ShadowRoots, such as the
// details element for example.
// @ts-ignore Typescript doesn't know that checkVisibility exists yet.
if (Element.prototype.checkVisibility) {
// @ts-ignore Typescript doesn't know that checkVisibility exists yet.
// 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') {
if (!element.checkVisibility({ checkOpacity: false, checkVisibilityCSS: false }))
return false;
} else {

View File

@ -24,7 +24,7 @@ import type { NestedSelectorBody, ParsedSelector, ParsedSelectorPart } from '../
import { visitAllSelectorParts, parseSelector, stringifySelector } from '../../utils/isomorphic/selectorParser';
import { type TextMatcher, elementMatchesText, elementText, type ElementText, getElementLabels } from './selectorUtils';
import { SelectorEvaluatorImpl, sortInDOMOrder } from './selectorEvaluator';
import { enclosingShadowRootOrDocument, isElementVisible, parentElementOrShadowHost } from './domUtils';
import { enclosingShadowRootOrDocument, isElementVisible, parentElementOrShadowHost, setBrowserName } from './domUtils';
import type { CSSComplexSelectorList } from '../../utils/isomorphic/cssParser';
import { generateSelector, type GenerateSelectorOptions } from './selectorGenerator';
import type * as channels from '@protocol/channels';
@ -137,6 +137,7 @@ export class InjectedScript {
this._stableRafCount = stableRafCount;
this._browserName = browserName;
setBrowserName(browserName);
this._setupGlobalListenersRemovalDetection();
this._setupHitTargetInterceptors();