chore: remove elementsFromPoint workaround (#13184)

The issue was fixed upstream in r982637.
This commit is contained in:
Dmitry Gozman 2022-04-05 19:37:07 -07:00 committed by GitHub
parent f3bd910820
commit faaac318f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -813,10 +813,7 @@ export class InjectedScript {
// elementFromPoint works incorrectly in Chromium (http://crbug.com/1188919),
// so we use elementsFromPoint instead.
const elements: Element[] = container.elementsFromPoint(x, y);
let innerElement = elements[0] as Element | undefined;
// Workaround https://bugs.chromium.org/p/chromium/issues/detail?id=1307458.
if (elements[0] && elements[1] && elements[0].contains(elements[1]) && container.elementFromPoint(x, y) === elements[1])
innerElement = elements[1];
const innerElement = elements[0] as Element | undefined;
if (!innerElement || element === innerElement)
break;
element = innerElement;