script: Support decomposing ShadowRoot from mozjs HandleValue (#38984)

- Add `ShadowRoot` to `JSValue` to avoid
`WebDriverJSError::UnknownType`, and
`JavaScriptEvaluationError::SerializationError` when execute JS from
embedder.
- Add unit test.
- Move [is_detached](https://w3c.github.io/webdriver/#dfn-is-detached)
to `fn is_detached` to be reused.
- Other random simplification.

Testing: WebDriver conformance tests.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
Euclid Ye 2025-08-28 12:31:06 +08:00 committed by GitHub
parent 5308228436
commit 3ac226e841
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 43 additions and 39 deletions

View file

@ -35,8 +35,5 @@
[test_element_reference[frame\]]
expected: FAIL
[test_element_reference[shadow-root\]]
expected: FAIL
[test_element_reference[window\]]
expected: FAIL

View file

@ -1,13 +1,4 @@
[node.py]
[test_detached_shadow_root[top_context\]]
expected: FAIL
[test_detached_shadow_root[child_context\]]
expected: FAIL
[test_element_reference[shadow-root\]]
expected: FAIL
[test_not_supported_nodes[attribute\]]
expected: FAIL

View file

@ -35,8 +35,5 @@
[test_element_reference[frame\]]
expected: FAIL
[test_element_reference[shadow-root\]]
expected: FAIL
[test_element_reference[window\]]
expected: FAIL

View file

@ -1,13 +1,4 @@
[node.py]
[test_detached_shadow_root[top_context\]]
expected: FAIL
[test_detached_shadow_root[child_context\]]
expected: FAIL
[test_web_reference[shadow-root\]]
expected: FAIL
[test_not_supported_nodes[attribute\]]
expected: FAIL

View file

@ -1,6 +1,3 @@
[get.py]
[test_no_browsing_context]
expected: FAIL
[test_web_reference[shadowRoot-ShadowRoot\]]
expected: FAIL