mirror of
https://github.com/servo/servo
synced 2026-04-26 01:25:32 +02:00
script: Add message to Dom exception Error::NotSupported (#40745)
Adding an optional message to Error::NotSupported. Unblocks https://github.com/servo/servo/issues/39050. The enum definition of NotSupported is now `NotSupported(Option<String>)`. Testing: Just a refactor Fixes: Partially https://github.com/servo/servo/issues/39053 Signed-off-by: Dennis Kraus <kraus@posteo.de>
This commit is contained in:
@@ -1549,7 +1549,7 @@ impl HTMLMediaElement {
|
||||
fn queue_dedicated_media_source_failure_steps(&self) {
|
||||
let this = Trusted::new(self);
|
||||
let generation_id = self.generation_id.get();
|
||||
self.take_pending_play_promises(Err(Error::NotSupported));
|
||||
self.take_pending_play_promises(Err(Error::NotSupported(None)));
|
||||
self.owner_global()
|
||||
.task_manager()
|
||||
.media_element_task_source()
|
||||
@@ -3009,7 +3009,7 @@ impl HTMLMediaElementMethods<crate::DomTypeHolder> for HTMLMediaElement {
|
||||
.get()
|
||||
.is_some_and(|e| e.Code() == MEDIA_ERR_SRC_NOT_SUPPORTED)
|
||||
{
|
||||
promise.reject_error(Error::NotSupported, can_gc);
|
||||
promise.reject_error(Error::NotSupported(None), can_gc);
|
||||
return promise;
|
||||
}
|
||||
|
||||
@@ -3051,7 +3051,7 @@ impl HTMLMediaElementMethods<crate::DomTypeHolder> for HTMLMediaElement {
|
||||
let min_allowed = -64.0;
|
||||
let max_allowed = 64.0;
|
||||
if *value < min_allowed || *value > max_allowed {
|
||||
return Err(Error::NotSupported);
|
||||
return Err(Error::NotSupported(None));
|
||||
}
|
||||
|
||||
if *value != self.defaultPlaybackRate.get() {
|
||||
@@ -3072,7 +3072,7 @@ impl HTMLMediaElementMethods<crate::DomTypeHolder> for HTMLMediaElement {
|
||||
let min_allowed = -64.0;
|
||||
let max_allowed = 64.0;
|
||||
if *value < min_allowed || *value > max_allowed {
|
||||
return Err(Error::NotSupported);
|
||||
return Err(Error::NotSupported(None));
|
||||
}
|
||||
|
||||
if *value != self.playbackRate.get() {
|
||||
|
||||
Reference in New Issue
Block a user