Skip to content

Commit

Permalink
Link from shadow root doc strings to note in User Guide
Browse files Browse the repository at this point in the history
  • Loading branch information
dgr committed Jul 15, 2024
1 parent ba93bd4 commit 285de94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 2 additions & 0 deletions doc/01-user-guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,7 @@ The following query will find a vector of `div` tags, then return a set of all `
;; => ("a1" "a2" "a3" "a4" "a5" "a6" "a7" "a8" "a9")
----

[#shadow-dom]
=== Querying the Shadow DOM

The shadow DOM provides a way to attach another DOM tree to a specified element in the normal DOM and have the internals of that tree hidden from JavaScript and CSS on the same page.
Expand Down Expand Up @@ -961,6 +962,7 @@ The `query-shadow-root-el` and `query-all-shadow-root-el` allow you to specify t
;; => ("I'm in the shadow DOM" "I'm also in the shadow DOM")
----

[#shadow-root-browser-limitations]
[NOTE]
====
In the previous shadow root queries, you should note that we used CSS selectors for the `shadow-q` argument in each case.
Expand Down
12 changes: 4 additions & 8 deletions src/etaoin/api.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1671,8 +1671,7 @@
The `shadow-q` parameter is similar to the `q` parameter of
the [[query]] function, but some drivers may limit it to specific
formats (e.g., CSS). See [this page](https://wpt.fyi/results/webdriver/tests/classic/find_element_from_shadow_root/find.py?label=experimental&label=master&aligned) on the Web Platform
Tests website for more information on specific browser support."
formats (e.g., CSS). See [this note](/doc/01-user-guide.adoc#shadow-root-browser-limitations] for more information."
[driver shadow-root-el shadow-q]
(let [[loc term] (query/expand driver shadow-q)]
(find-element-from-shadow-root* driver shadow-root-el loc term)))
Expand All @@ -1683,8 +1682,7 @@
The `shadow-q` parameter is similar to the `q` parameter of
the [[query]] function, but some drivers may limit it to specific
formats (e.g., CSS). See [this page](https://wpt.fyi/results/webdriver/tests/classic/find_element_from_shadow_root/find.py?label=experimental&label=master&aligned) on the Web Platform
Tests website for more information on specific browser support."
formats (e.g., CSS). See [this note](/doc/01-user-guide.adoc#shadow-root-browser-limitations] for more information."
[driver shadow-root-el shadow-q]
(let [[loc term] (query/expand driver shadow-q)]
(find-elements-from-shadow-root* driver shadow-root-el loc term)))
Expand All @@ -1698,8 +1696,7 @@
The `shadow-q` parameter is similar to the `q` parameter of
the [[query]] function, but some drivers may limit it to specific
formats (e.g., CSS). See [this page](https://wpt.fyi/results/webdriver/tests/classic/find_element_from_shadow_root/find.py?label=experimental&label=master&aligned) on the Web Platform
Tests website for more information on specific browser support."
formats (e.g., CSS). See [this note](/doc/01-user-guide.adoc#shadow-root-browser-limitations] for more information."
[driver q shadow-q]
(query-shadow-root-el driver (get-element-shadow-root driver q) shadow-q))

Expand All @@ -1712,8 +1709,7 @@
The `shadow-q` parameter is similar to the `q` parameter of
the [[query]] function, but some drivers may limit it to specific
formats (e.g., CSS). See [this page](https://wpt.fyi/results/webdriver/tests/classic/find_element_from_shadow_root/find.py?label=experimental&label=master&aligned) on the Web Platform
Tests website for more information on specific browser support."
formats (e.g., CSS). See [this note](/doc/01-user-guide.adoc#shadow-root-browser-limitations] for more information."
[driver q shadow-q]
(query-all-shadow-root-el driver (get-element-shadow-root driver q) shadow-q))

Expand Down

0 comments on commit 285de94

Please sign in to comment.