mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
fix(selectors): resolve text to the innermost match and scan the root in both forms
an element's text is its whole subtree's text on web and on ios, so every ancestor of a matching element matched too, up to the root. a match a descendant also makes is now dropped, in internal/hierarchy, in the chrome xpath translation and in the page-side web runtime, so all three resolvers name the same element. a raw attribute now matches on a substring (exact for true/false) the way the docs describe, and tree-level FindBySelector considers the root, so ax.find("id:page") and ax.find({id: "page"}) agree.
This commit is contained in:
1 parent
a245194120
commit
ca667b1b77
9 files changed
+526
-49
No files matched your search
@@ -184,7 +184,7 @@ func findNodeFromJS(runtime *goja.Runtime, tree *hierarchy.Tree, arg goja.Value)
|
||||
return nil
|
||||
}
|
||||
requireKnownSelectorKeys(runtime, tree, sel)
|
||||
return tree.Root.FindBySelector(sel)
|
||||
return tree.FindBySelector(sel)
|
||||
}
|
||||
|
||||
// findAllNodesFromJS dispatches a JS value to Tree-level multi-node lookup.
|
||||
@@ -204,7 +204,7 @@ func findAllNodesFromJS(runtime *goja.Runtime, tree *hierarchy.Tree, arg goja.Va
|
||||
return nil
|
||||
}
|
||||
requireKnownSelectorKeys(runtime, tree, sel)
|
||||
return tree.Root.FindAllBySelector(sel)
|
||||
return tree.FindAllBySelector(sel)
|
||||
}
|
||||
|
||||
// findNodeInSubtreeFromJS dispatches a JS value to Node-level scoped lookup.
|
||||
|
||||
Reference in new issue
Block a user