Bug 1348168 - Disable Mozilla custom ImageBitmap extensions that didn't go through proper API review; r=bzbarsky

This commit is contained in:
Ehsan Akhgari 2017-03-16 22:52:43 -04:00
Родитель b00f1b075f
Коммит 3c91e7a4b7
3 изменённых файлов: 13 добавлений и 5 удалений

Просмотреть файл

@ -14691,6 +14691,10 @@ nsGlobalWindow::CreateImageBitmap(const ImageBitmapSource& aImage,
const Sequence<ChannelPixelLayout>& aLayout,
ErrorResult& aRv)
{
if (!ImageBitmap::ExtensionsEnabled(nullptr, nullptr)) {
aRv.Throw(NS_ERROR_TYPE_ERR);
return nullptr;
}
if (aImage.IsArrayBuffer() || aImage.IsArrayBufferView()) {
return ImageBitmap::Create(this, aImage, aOffset, aLength, aFormat, aLayout,
aRv);

Просмотреть файл

@ -472,6 +472,14 @@ WorkerGlobalScope::CreateImageBitmap(const ImageBitmapSource& aImage,
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;
}
if (aImage.IsArrayBuffer() || aImage.IsArrayBufferView()) {
return ImageBitmap::Create(this, aImage, aOffset, aLength, aFormat, aLayout,
aRv);

Просмотреть файл

@ -858,12 +858,8 @@ pref("canvas.filters.enabled", true);
pref("canvas.path.enabled", true);
pref("canvas.capturestream.enabled", true);
// Disable the ImageBitmap-extensions in the release build.
#ifdef RELEASE_OR_BETA
// Disable the ImageBitmap-extensions for now.
pref("canvas.imagebitmap_extensions.enabled", false);
#else
pref("canvas.imagebitmap_extensions.enabled", true);
#endif
// We want the ability to forcibly disable platform a11y, because
// some non-a11y-related components attempt to bring it up. See bug