Issue #2546 - Part 2: Remove special FoxEye CreateImageBitmap method.

This commit is contained in:
Moonchild 2024-07-08 23:45:49 +02:00 committed by roytam1
commit 2b8d75e136
5 changed files with 0 additions and 77 deletions

View file

@ -14625,21 +14625,6 @@ nsGlobalWindow::CreateImageBitmap(const ImageBitmapSource& aImage,
return ImageBitmap::Create(this, aImage, Some(gfx::IntRect(aSx, aSy, aSw, aSh)), aRv);
}
already_AddRefed<mozilla::dom::Promise>
nsGlobalWindow::CreateImageBitmap(const ImageBitmapSource& aImage,
int32_t aOffset, int32_t aLength,
ImageBitmapFormat aFormat,
const Sequence<ChannelPixelLayout>& aLayout,
ErrorResult& aRv)
{
if (!ImageBitmap::ExtensionsEnabled(nullptr, nullptr)) {
aRv.Throw(NS_ERROR_TYPE_ERR);
return nullptr;
}
aRv.Throw(NS_ERROR_TYPE_ERR);
return nullptr;
}
// https://html.spec.whatwg.org/#structured-cloning
void
nsGlobalWindow::StructuredClone(JSContext* aCx,

View file

@ -1867,25 +1867,5 @@ ImageBitmap::MapDataInto(JSContext* aCx,
return promise.forget();
}
/*static*/ already_AddRefed<Promise>
ImageBitmap::Create(nsIGlobalObject* aGlobal,
const ImageBitmapSource& aBuffer,
int32_t aOffset, int32_t aLength,
mozilla::dom::ImageBitmapFormat aFormat,
const Sequence<ChannelPixelLayout>& aLayout,
ErrorResult& aRv)
{
MOZ_ASSERT(aGlobal);
RefPtr<Promise> promise = Promise::Create(aGlobal, aRv);
if (NS_WARN_IF(aRv.Failed())) {
return nullptr;
}
aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
return promise.forget();
}
} // namespace dom
} // namespace mozilla

View file

@ -132,14 +132,6 @@ public:
Create(nsIGlobalObject* aGlobal, const ImageBitmapSource& aSrc,
const Maybe<gfx::IntRect>& aCropRect, ErrorResult& aRv);
static already_AddRefed<Promise>
Create(nsIGlobalObject* aGlobal,
const ImageBitmapSource& aBuffer,
int32_t aOffset, int32_t aLength,
mozilla::dom::ImageBitmapFormat aFormat,
const Sequence<mozilla::dom::ChannelPixelLayout>& aLayout,
ErrorResult& aRv);
static JSObject*
ReadStructuredClone(JSContext* aCx,
JSStructuredCloneReader* aReader,

View file

@ -72,18 +72,3 @@ partial interface WindowOrWorkerGlobalScope {
[Throws, Func="mozilla::dom::cache::CacheStorage::PrefEnabled", SameObject]
readonly attribute CacheStorage caches;
};
// Mozilla extensions
partial interface WindowOrWorkerGlobalScope {
// Extensions to ImageBitmap bits.
// Bug 1141979 - [FoxEye] Extend ImageBitmap with interfaces to access its
// underlying image data
//
// Note:
// Overloaded functions cannot have different "extended attributes",
// so I cannot add preference on the extended version of createImageBitmap().
// To work around, I will then check the preference at run time and throw if
// the preference is set to be false.
[Throws]
Promise<ImageBitmap> createImageBitmap(ImageBitmapSource aImage, long aOffset, long aLength, ImageBitmapFormat aFormat, ImagePixelLayout aLayout);
};

View file

@ -461,25 +461,6 @@ WorkerGlobalScope::CreateImageBitmap(const ImageBitmapSource& aImage,
return ImageBitmap::Create(this, aImage, Some(gfx::IntRect(aSx, aSy, aSw, aSh)), aRv);
}
already_AddRefed<mozilla::dom::Promise>
WorkerGlobalScope::CreateImageBitmap(const ImageBitmapSource& aImage,
int32_t aOffset, int32_t aLength,
ImageBitmapFormat aFormat,
const Sequence<ChannelPixelLayout>& aLayout,
ErrorResult& aRv)
{
JSContext* cx = GetCurrentThreadJSContext();
MOZ_ASSERT(cx);
if (!ImageBitmap::ExtensionsEnabled(cx, nullptr)) {
aRv.Throw(NS_ERROR_TYPE_ERR);
return nullptr;
}
aRv.Throw(NS_ERROR_TYPE_ERR);
return nullptr;
}
// https://html.spec.whatwg.org/#structured-cloning
void WorkerGlobalScope::StructuredClone(JSContext* aCx,
JS::Handle<JS::Value> aValue,