Propagate CanGc arguments through callers in constructors (#35541)

Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
This commit is contained in:
Auguste Baum 2025-02-20 17:17:45 +01:00 committed by GitHub
parent 5465bfc2af
commit 863d2ce871
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
260 changed files with 986 additions and 603 deletions

View file

@ -54,6 +54,7 @@ impl TextTrack {
}
}
#[allow(clippy::too_many_arguments)]
pub(crate) fn new(
window: &Window,
id: DOMString,
@ -62,19 +63,20 @@ impl TextTrack {
language: DOMString,
mode: TextTrackMode,
track_list: Option<&TextTrackList>,
can_gc: CanGc,
) -> DomRoot<TextTrack> {
reflect_dom_object(
Box::new(TextTrack::new_inherited(
id, kind, label, language, mode, track_list,
)),
window,
CanGc::note(),
can_gc,
)
}
pub(crate) fn get_cues(&self) -> DomRoot<TextTrackCueList> {
self.cue_list
.or_init(|| TextTrackCueList::new(self.global().as_window(), &[]))
.or_init(|| TextTrackCueList::new(self.global().as_window(), &[], CanGc::note()))
}
pub(crate) fn id(&self) -> &str {
@ -133,7 +135,11 @@ impl TextTrackMethods<crate::DomTypeHolder> for TextTrack {
fn GetActiveCues(&self) -> Option<DomRoot<TextTrackCueList>> {
// XXX implement active cues logic
// https://github.com/servo/servo/issues/22314
Some(TextTrackCueList::new(self.global().as_window(), &[]))
Some(TextTrackCueList::new(
self.global().as_window(),
&[],
CanGc::note(),
))
}
// https://html.spec.whatwg.org/multipage/#dom-texttrack-addcue