diff options
author | Kunga Derick Abongho <abonghoderick@gmail.com> | 2025-03-29 14:09:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-29 13:09:56 +0000 |
commit | 83da63f638b15009b842a1f712fa5116f0e2d466 (patch) | |
tree | 7a81fe22a5726a2c0742e42da36a43cc2145406f /components/script/dom/shadowroot.rs | |
parent | b5c8164e9982ebd6212ad21910826ce8b2631930 (diff) | |
download | servo-83da63f638b15009b842a1f712fa5116f0e2d466.tar.gz servo-83da63f638b15009b842a1f712fa5116f0e2d466.zip |
resolve issue #36074 new_js_regex and matches_js_regex need a CanGc argument (#36111)
* new_js_regex and matches_js_regex need a CanGc argument
Signed-off-by: dericko681 <abonghoderick@gmail.com>
* new_js_regex and matches_js_regex need a CanGc argument
Signed-off-by: dericko681 <abonghoderick@gmail.com>
* edit Propagate CanGc arguments through new_js_regex and matches_js_regex
Signed-off-by: dericko681 <abonghoderick@gmail.com>
* Propagate CanGc arguments through new_js_regex and matches_js_regex
Signed-off-by: dericko681 <abonghoderick@gmail.com>
* Propagate CanGc arguments through new_js_regex and matches_js_regex
Signed-off-by: dericko681 <abonghoderick@gmail.com>
* Propagate CanGc arguments through new_js_regex and matches_js_regex
Signed-off-by: dericko681 <abonghoderick@gmail.com>
---------
Signed-off-by: dericko681 <abonghoderick@gmail.com>
Diffstat (limited to 'components/script/dom/shadowroot.rs')
-rw-r--r-- | components/script/dom/shadowroot.rs | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/components/script/dom/shadowroot.rs b/components/script/dom/shadowroot.rs index 57ec0303188..72b074ed6f4 100644 --- a/components/script/dom/shadowroot.rs +++ b/components/script/dom/shadowroot.rs @@ -153,11 +153,11 @@ impl ShadowRoot { ) } - pub(crate) fn detach(&self) { + pub(crate) fn detach(&self, can_gc: CanGc) { self.document.unregister_shadow_root(self); let node = self.upcast::<Node>(); node.set_containing_shadow_root(None); - Node::complete_remove_subtree(node, &UnbindContext::new(node, None, None, None)); + Node::complete_remove_subtree(node, &UnbindContext::new(node, None, None, None), can_gc); self.host.set(None); } @@ -221,7 +221,7 @@ impl ShadowRoot { /// Remove any existing association between the provided id and any elements /// in this shadow tree. - pub(crate) fn unregister_element_id(&self, to_unregister: &Element, id: Atom) { + pub(crate) fn unregister_element_id(&self, to_unregister: &Element, id: Atom, _can_gc: CanGc) { self.document_or_shadow_root.unregister_named_element( self.document_fragment.id_map(), to_unregister, @@ -230,7 +230,7 @@ impl ShadowRoot { } /// Associate an element present in this shadow tree with the provided id. - pub(crate) fn register_element_id(&self, element: &Element, id: Atom) { + pub(crate) fn register_element_id(&self, element: &Element, id: Atom, _can_gc: CanGc) { let root = self .upcast::<Node>() .inclusive_ancestors(ShadowIncluding::No) @@ -445,7 +445,7 @@ impl ShadowRootMethods<crate::DomTypeHolder> for ShadowRoot { }; // Step 4. Replace all with fragment within this. - Node::replace_all(Some(frag.upcast()), self.upcast()); + Node::replace_all(Some(frag.upcast()), self.upcast(), can_gc); } /// <https://dom.spec.whatwg.org/#dom-shadowroot-slotassignment> @@ -462,9 +462,9 @@ impl VirtualMethods for ShadowRoot { Some(self.upcast::<DocumentFragment>() as &dyn VirtualMethods) } - fn bind_to_tree(&self, context: &BindContext) { + fn bind_to_tree(&self, context: &BindContext, can_gc: CanGc) { if let Some(s) = self.super_type() { - s.bind_to_tree(context); + s.bind_to_tree(context, can_gc); } if context.tree_connected { @@ -482,17 +482,20 @@ impl VirtualMethods for ShadowRoot { // Out-of-document elements never have the descendants flag set debug_assert!(!node.get_flag(NodeFlags::HAS_DIRTY_DESCENDANTS)); - vtable_for(&node).bind_to_tree(&BindContext { - tree_connected: context.tree_connected, - tree_is_in_a_document_tree: false, - tree_is_in_a_shadow_tree: true, - }); + vtable_for(&node).bind_to_tree( + &BindContext { + tree_connected: context.tree_connected, + tree_is_in_a_document_tree: false, + tree_is_in_a_shadow_tree: true, + }, + can_gc, + ); } } - fn unbind_from_tree(&self, context: &UnbindContext) { + fn unbind_from_tree(&self, context: &UnbindContext, can_gc: CanGc) { if let Some(s) = self.super_type() { - s.unbind_from_tree(context); + s.unbind_from_tree(context, can_gc); } if context.tree_connected { |