mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Start marking functions that can transitively trigger a GC (#33144)
* Mark JS reflector wrappers as CanGc. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Propagate CanGc from reflect_dom_object_with_proto. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Mark DOM constructors as GC operations. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
9a1051c917
commit
60ef6bc461
140 changed files with 1336 additions and 304 deletions
|
@ -177,7 +177,7 @@ use crate::dom::window::{ReflowReason, Window};
|
|||
use crate::dom::windowproxy::WindowProxy;
|
||||
use crate::fetch::FetchCanceller;
|
||||
use crate::realms::{AlreadyInRealm, InRealm};
|
||||
use crate::script_runtime::{CommonScriptMsg, ScriptThreadEventCategory};
|
||||
use crate::script_runtime::{CanGc, CommonScriptMsg, ScriptThreadEventCategory};
|
||||
use crate::script_thread::{MainThreadScriptMsg, ScriptThread};
|
||||
use crate::stylesheet_set::StylesheetSetRef;
|
||||
use crate::task::TaskBox;
|
||||
|
@ -3409,6 +3409,7 @@ impl Document {
|
|||
pub fn Constructor(
|
||||
window: &Window,
|
||||
proto: Option<HandleObject>,
|
||||
can_gc: CanGc,
|
||||
) -> Fallible<DomRoot<Document>> {
|
||||
let doc = window.Document();
|
||||
let docloader = DocumentLoader::new(&doc.loader());
|
||||
|
@ -3428,6 +3429,7 @@ impl Document {
|
|||
None,
|
||||
None,
|
||||
Default::default(),
|
||||
can_gc,
|
||||
))
|
||||
}
|
||||
|
||||
|
@ -3464,6 +3466,7 @@ impl Document {
|
|||
referrer_policy,
|
||||
status_code,
|
||||
canceller,
|
||||
CanGc::note(),
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -3484,6 +3487,7 @@ impl Document {
|
|||
referrer_policy: Option<ReferrerPolicy>,
|
||||
status_code: Option<u16>,
|
||||
canceller: FetchCanceller,
|
||||
can_gc: CanGc,
|
||||
) -> DomRoot<Document> {
|
||||
let document = reflect_dom_object_with_proto(
|
||||
Box::new(Document::new_inherited(
|
||||
|
@ -3504,6 +3508,7 @@ impl Document {
|
|||
)),
|
||||
window,
|
||||
proto,
|
||||
can_gc,
|
||||
);
|
||||
{
|
||||
let node = document.upcast::<Node>();
|
||||
|
@ -4593,7 +4598,7 @@ impl DocumentMethods for Document {
|
|||
|
||||
// https://dom.spec.whatwg.org/#dom-document-createrange
|
||||
fn CreateRange(&self) -> DomRoot<Range> {
|
||||
Range::new_with_doc(self, None)
|
||||
Range::new_with_doc(self, None, CanGc::note())
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-document-createnodeiteratorroot-whattoshow-filter
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue