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",
|
"name": "webkit",
|
||||||
"revision": "1943",
|
"revision": "1944",
|
||||||
"installByDefault": true,
|
"installByDefault": true,
|
||||||
"revisionOverrides": {
|
"revisionOverrides": {
|
||||||
"mac10.14": "1446",
|
"mac10.14": "1446",
|
||||||
|
|||||||
@ -14,6 +14,11 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
let browserNameForWorkarounds = '';
|
||||||
|
export function setBrowserName(name: string) {
|
||||||
|
browserNameForWorkarounds = name;
|
||||||
|
}
|
||||||
|
|
||||||
export function isInsideScope(scope: Node, element: Element | undefined): boolean {
|
export function isInsideScope(scope: Node, element: Element | undefined): boolean {
|
||||||
while (element) {
|
while (element) {
|
||||||
if (scope.contains(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
|
// Element.checkVisibility checks for content-visibility and also looks at
|
||||||
// styles up the flat tree including user-agent ShadowRoots, such as the
|
// styles up the flat tree including user-agent ShadowRoots, such as the
|
||||||
// details element for example.
|
// details element for example.
|
||||||
// @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:
|
||||||
if (Element.prototype.checkVisibility) {
|
// https://bugs.webkit.org/show_bug.cgi?id=264733
|
||||||
// @ts-ignore Typescript doesn't know that checkVisibility exists yet.
|
if (browserNameForWorkarounds !== 'webkit') {
|
||||||
if (!element.checkVisibility({ checkOpacity: false, checkVisibilityCSS: false }))
|
if (!element.checkVisibility({ checkOpacity: false, checkVisibilityCSS: false }))
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -24,7 +24,7 @@ import type { NestedSelectorBody, ParsedSelector, ParsedSelectorPart } from '../
|
|||||||
import { visitAllSelectorParts, parseSelector, stringifySelector } from '../../utils/isomorphic/selectorParser';
|
import { visitAllSelectorParts, parseSelector, stringifySelector } from '../../utils/isomorphic/selectorParser';
|
||||||
import { type TextMatcher, elementMatchesText, elementText, type ElementText, getElementLabels } from './selectorUtils';
|
import { type TextMatcher, elementMatchesText, elementText, type ElementText, getElementLabels } from './selectorUtils';
|
||||||
import { SelectorEvaluatorImpl, sortInDOMOrder } from './selectorEvaluator';
|
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 type { CSSComplexSelectorList } from '../../utils/isomorphic/cssParser';
|
||||||
import { generateSelector, type GenerateSelectorOptions } from './selectorGenerator';
|
import { generateSelector, type GenerateSelectorOptions } from './selectorGenerator';
|
||||||
import type * as channels from '@protocol/channels';
|
import type * as channels from '@protocol/channels';
|
||||||
@ -137,6 +137,7 @@ export class InjectedScript {
|
|||||||
|
|
||||||
this._stableRafCount = stableRafCount;
|
this._stableRafCount = stableRafCount;
|
||||||
this._browserName = browserName;
|
this._browserName = browserName;
|
||||||
|
setBrowserName(browserName);
|
||||||
|
|
||||||
this._setupGlobalListenersRemovalDetection();
|
this._setupGlobalListenersRemovalDetection();
|
||||||
this._setupHitTargetInterceptors();
|
this._setupHitTargetInterceptors();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user