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>
This commit is contained in:
Kunga Derick Abongho 2025-03-29 14:09:56 +01:00 committed by GitHub
parent b5c8164e99
commit 83da63f638
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
60 changed files with 600 additions and 435 deletions

View file

@ -113,14 +113,14 @@ impl VirtualMethods for HTMLTemplateElement {
}
/// <https://html.spec.whatwg.org/multipage/#template-adopting-steps>
fn adopting_steps(&self, old_doc: &Document) {
self.super_type().unwrap().adopting_steps(old_doc);
fn adopting_steps(&self, old_doc: &Document, can_gc: CanGc) {
self.super_type().unwrap().adopting_steps(old_doc, can_gc);
// Step 1.
let doc = self
.owner_document()
.appropriate_template_contents_owner_document(CanGc::note());
// Step 2.
Node::adopt(self.Content(CanGc::note()).upcast(), &doc);
Node::adopt(self.Content(CanGc::note()).upcast(), &doc, can_gc);
}
/// <https://html.spec.whatwg.org/multipage/#the-template-element:concept-node-clone-ext>
@ -129,10 +129,11 @@ impl VirtualMethods for HTMLTemplateElement {
copy: &Node,
maybe_doc: Option<&Document>,
clone_children: CloneChildrenFlag,
can_gc: CanGc,
) {
self.super_type()
.unwrap()
.cloning_steps(copy, maybe_doc, clone_children);
.cloning_steps(copy, maybe_doc, clone_children, can_gc);
if clone_children == CloneChildrenFlag::DoNotCloneChildren {
// Step 1.
return;