mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
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:
parent
5308228436
commit
3ac226e841
12 changed files with 43 additions and 39 deletions
|
@ -617,7 +617,7 @@ impl HTMLElementMethods<crate::DomTypeHolder> for HTMLElement {
|
|||
// Note: the element can pass this check without yet being a custom
|
||||
// element, as long as there is a registered definition
|
||||
// that could upgrade it to one later.
|
||||
let registry = self.owner_document().window().CustomElements();
|
||||
let registry = self.owner_window().CustomElements();
|
||||
let definition = registry.lookup_definition(self.as_element().local_name(), None);
|
||||
|
||||
// Step 3: If definition is null, then throw an "NotSupportedError" DOMException
|
||||
|
|
|
@ -1282,7 +1282,7 @@ impl Node {
|
|||
pub(crate) fn summarize(&self, can_gc: CanGc) -> NodeInfo {
|
||||
let USVString(base_uri) = self.BaseURI();
|
||||
let node_type = self.NodeType();
|
||||
let pipeline = self.owner_document().window().pipeline_id();
|
||||
let pipeline = self.owner_window().pipeline_id();
|
||||
|
||||
let maybe_shadow_root = self.downcast::<ShadowRoot>();
|
||||
let shadow_root_mode = maybe_shadow_root
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue