mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 21:53:35 +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('/'))
|
if (selector.startsWith('/'))
|
||||||
selector = '.' + selector;
|
selector = '.' + selector;
|
||||||
const result: Element[] = [];
|
const result: Element[] = [];
|
||||||
const document = root instanceof Document ? root : root.ownerDocument;
|
const document = root.ownerDocument || root;
|
||||||
if (!document)
|
if (!document)
|
||||||
return result;
|
return result;
|
||||||
const it = document.evaluate(selector, root, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE);
|
const it = document.evaluate(selector, root, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE);
|
||||||
|
Loading…
Reference in New Issue
Block a user