mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
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:
parent
b66839b039
commit
bb241abaff
@ -39,7 +39,7 @@
|
||||
},
|
||||
{
|
||||
"name": "webkit",
|
||||
"revision": "1943",
|
||||
"revision": "1944",
|
||||
"installByDefault": true,
|
||||
"revisionOverrides": {
|
||||
"mac10.14": "1446",
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user