Issue #2546 - Part 1: Remove BufferSource support in CreateImageBitmap.

This commit is contained in:
Moonchild 2024-07-08 23:36:40 +02:00 committed by roytam1
commit 60fbaa2155
6 changed files with 15 additions and 328 deletions

View file

@ -14614,11 +14614,6 @@ already_AddRefed<Promise>
nsGlobalWindow::CreateImageBitmap(const ImageBitmapSource& aImage,
ErrorResult& aRv)
{
if (aImage.IsArrayBuffer() || aImage.IsArrayBufferView()) {
aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
return nullptr;
}
return ImageBitmap::Create(this, aImage, Nothing(), aRv);
}
@ -14627,11 +14622,6 @@ nsGlobalWindow::CreateImageBitmap(const ImageBitmapSource& aImage,
int32_t aSx, int32_t aSy, int32_t aSw, int32_t aSh,
ErrorResult& aRv)
{
if (aImage.IsArrayBuffer() || aImage.IsArrayBufferView()) {
aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
return nullptr;
}
return ImageBitmap::Create(this, aImage, Some(gfx::IntRect(aSx, aSy, aSw, aSh)), aRv);
}
@ -14646,13 +14636,8 @@ nsGlobalWindow::CreateImageBitmap(const ImageBitmapSource& aImage,
aRv.Throw(NS_ERROR_TYPE_ERR);
return nullptr;
}
if (aImage.IsArrayBuffer() || aImage.IsArrayBufferView()) {
return ImageBitmap::Create(this, aImage, aOffset, aLength, aFormat, aLayout,
aRv);
} else {
aRv.Throw(NS_ERROR_TYPE_ERR);
return nullptr;
}
aRv.Throw(NS_ERROR_TYPE_ERR);
return nullptr;
}
// https://html.spec.whatwg.org/#structured-cloning