script: Rename CanGc::note() to CanGc::deprecated_note() (#44081)

Per the suggestion in

https://servo.zulipchat.com/#narrow/channel/263398-general/topic/PSA.3A.20avoid.20new.20usages.20of.20CanGc.20whenever.20possible/near/583995807
to mark this method as deprecated and make clear it shouldn't be used
anymore, as alternatives exist.

Part of #40600

Testing: It compiles

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
Tim van der Lippe
2026-04-10 08:07:52 +02:00
committed by GitHub
parent 55e586737b
commit c8029ea092
112 changed files with 540 additions and 410 deletions

View File

@@ -876,10 +876,10 @@ impl HTMLMediaElement {
this.fulfill_in_flight_play_promises(|| {
// Step 2.3.1. Fire an event named timeupdate at the element.
this.upcast::<EventTarget>().fire_event(atom!("timeupdate"), CanGc::note());
this.upcast::<EventTarget>().fire_event(atom!("timeupdate"), CanGc::deprecated_note());
// Step 2.3.2. Fire an event named pause at the element.
this.upcast::<EventTarget>().fire_event(atom!("pause"), CanGc::note());
this.upcast::<EventTarget>().fire_event(atom!("pause"), CanGc::deprecated_note());
// Step 2.3.3. Reject pending play promises with promises and an
// "AbortError" DOMException.
@@ -920,7 +920,7 @@ impl HTMLMediaElement {
this.fulfill_in_flight_play_promises(|| {
// Step 2.1. Fire an event named playing at the element.
this.upcast::<EventTarget>().fire_event(atom!("playing"), CanGc::note());
this.upcast::<EventTarget>().fire_event(atom!("playing"), CanGc::deprecated_note());
// Step 2.2. Resolve pending play promises with promises.
// Done after running this closure in `fulfill_in_flight_play_promises`.
@@ -1858,8 +1858,8 @@ impl HTMLMediaElement {
f();
for promise in &*promises {
match result {
Ok(ref value) => promise.resolve_native(value, CanGc::note()),
Err(ref error) => promise.reject_error(error.clone(), CanGc::note()),
Ok(ref value) => promise.resolve_native(value, CanGc::deprecated_note()),
Err(ref error) => promise.reject_error(error.clone(), CanGc::deprecated_note()),
}
}
}
@@ -2300,7 +2300,7 @@ impl HTMLMediaElement {
}
// Step 3.1. Fire an event named timeupdate at the media element.
this.upcast::<EventTarget>().fire_event(atom!("timeupdate"), CanGc::note());
this.upcast::<EventTarget>().fire_event(atom!("timeupdate"), CanGc::deprecated_note());
// Step 3.2. If the media element has ended playback, the direction of playback is
// forwards, and paused is false, then:
@@ -2311,7 +2311,7 @@ impl HTMLMediaElement {
this.paused.set(true);
// Step 3.2.2. Fire an event named pause at the media element.
this.upcast::<EventTarget>().fire_event(atom!("pause"), CanGc::note());
this.upcast::<EventTarget>().fire_event(atom!("pause"), CanGc::deprecated_note());
// Step 3.2.3. Take pending play promises and reject pending play promises with
// the result and an "AbortError" DOMException.
@@ -2320,7 +2320,7 @@ impl HTMLMediaElement {
}
// Step 3.3. Fire an event named ended at the media element.
this.upcast::<EventTarget>().fire_event(atom!("ended"), CanGc::note());
this.upcast::<EventTarget>().fire_event(atom!("ended"), CanGc::deprecated_note());
}));
// <https://html.spec.whatwg.org/multipage/#dom-media-have_current_data>