mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 13:45:36 +03:00
chore: fix xpath-in-iframe (#21367)
Fixes https://github.com/microsoft/playwright/issues/21364
This commit is contained in:
parent
e29a6e7bb0
commit
c17eea7a3c
@ -21,7 +21,7 @@ export const XPathEngine: SelectorEngine = {
|
||||
if (selector.startsWith('/'))
|
||||
selector = '.' + selector;
|
||||
const result: Element[] = [];
|
||||
const document = root instanceof Document ? root : root.ownerDocument;
|
||||
const document = root.ownerDocument || root;
|
||||
if (!document)
|
||||
return result;
|
||||
const it = document.evaluate(selector, root, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE);
|
||||
|
Loading…
Reference in New Issue
Block a user