LibWeb: Make HTMLVideoElement part of CanvasImageSource union

This commit is contained in:
Totto16 2024-10-05 03:38:33 +02:00 committed by Andreas Kling
commit abe1172d70
Notes: github-actions[bot] 2024-10-05 07:21:47 +00:00
7 changed files with 42 additions and 8 deletions

View file

@ -587,8 +587,13 @@ WebIDL::ExceptionOr<CanvasImageSourceUsability> check_usability_of_image(CanvasI
return Optional<CanvasImageSourceUsability> {};
},
// FIXME: HTMLVideoElement
// If image's readyState attribute is either HAVE_NOTHING or HAVE_METADATA, then return bad.
[](JS::Handle<HTML::HTMLVideoElement> const& video_element) -> WebIDL::ExceptionOr<Optional<CanvasImageSourceUsability>> {
// If image's readyState attribute is either HAVE_NOTHING or HAVE_METADATA, then return bad.
if (video_element->ready_state() == HTML::HTMLMediaElement::ReadyState::HaveNothing || video_element->ready_state() == HTML::HTMLMediaElement::ReadyState::HaveMetadata) {
return { CanvasImageSourceUsability::Bad };
}
return Optional<CanvasImageSourceUsability> {};
},
// HTMLCanvasElement
// FIXME: OffscreenCanvas
@ -627,10 +632,10 @@ bool image_is_not_origin_clean(CanvasImageSource const& image)
// FIXME: image's current request's image data is CORS-cross-origin.
return false;
},
// FIXME: HTMLVideoElement
// image's media data is CORS-cross-origin.
[](JS::Handle<HTML::HTMLVideoElement> const&) {
// FIXME: image's media data is CORS-cross-origin.
return false;
},
// HTMLCanvasElement
[](OneOf<JS::Handle<HTMLCanvasElement>, JS::Handle<ImageBitmap>> auto const&) {
// FIXME: image's bitmap's origin-clean flag is false.