Index: Source/modules/imagebitmap/ImageBitmapFactories.cpp |
diff --git a/Source/modules/imagebitmap/ImageBitmapFactories.cpp b/Source/modules/imagebitmap/ImageBitmapFactories.cpp |
index 386c5ba8b1851d7a5fad908a0d745ac2d2e9faf9..16fd2c2068869a73fa0057dee4ab1f5fcdc9865f 100644 |
--- a/Source/modules/imagebitmap/ImageBitmapFactories.cpp |
+++ b/Source/modules/imagebitmap/ImageBitmapFactories.cpp |
@@ -88,10 +88,6 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(EventTarget& eventTarget, |
// This variant does not work in worker threads. |
ASSERT(eventTarget.toDOMWindow()); |
- if (!image) { |
- exceptionState.throwTypeError("The image element provided is invalid."); |
- return ScriptPromise(); |
- } |
if (!image->cachedImage()) { |
exceptionState.throwDOMException(InvalidStateError, "No image can be retrieved from the provided element."); |
return ScriptPromise(); |
@@ -127,10 +123,6 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(EventTarget& eventTarget, |
// This variant does not work in worker threads. |
ASSERT(eventTarget.toDOMWindow()); |
- if (!video) { |
- exceptionState.throwTypeError("The video element provided is invalid."); |
- return ScriptPromise(); |
- } |
if (!video->player()) { |
exceptionState.throwDOMException(InvalidStateError, "No player can be retrieved from the provided video element."); |
return ScriptPromise(); |
@@ -179,10 +171,6 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(EventTarget& eventTarget, |
// This variant does not work in worker threads. |
ASSERT(eventTarget.toDOMWindow()); |
- if (!canvas) { |
- exceptionState.throwTypeError("The canvas element provided is invalid."); |
- return ScriptPromise(); |
- } |
if (!canvas->originClean()) { |
exceptionState.throwSecurityError("The canvas element provided is tainted with cross-origin data."); |
return ScriptPromise(); |
@@ -198,10 +186,6 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(EventTarget& eventTarget, |
ScriptPromise ImageBitmapFactories::createImageBitmap(EventTarget& eventTarget, Blob* blob, ExceptionState& exceptionState) |
{ |
- if (!blob) { |
- exceptionState.throwTypeError("The blob provided is invalid."); |
- return ScriptPromise(); |
- } |
RefPtr<ImageBitmapLoader> loader = ImageBitmapFactories::ImageBitmapLoader::create(from(eventTarget), eventTarget.executionContext(), IntRect()); |
ScriptPromise promise = loader->promise(); |
from(eventTarget).addLoader(loader); |
@@ -211,10 +195,6 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(EventTarget& eventTarget, |
ScriptPromise ImageBitmapFactories::createImageBitmap(EventTarget& eventTarget, Blob* blob, int sx, int sy, int sw, int sh, ExceptionState& exceptionState) |
{ |
- if (!blob) { |
- exceptionState.throwTypeError("The blob provided is invalid."); |
- return ScriptPromise(); |
- } |
if (!sw || !sh) { |
exceptionState.throwDOMException(IndexSizeError, String::format("The source %s provided is 0.", sw ? "height" : "width")); |
return ScriptPromise(); |
@@ -233,10 +213,6 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(EventTarget& eventTarget, |
ScriptPromise ImageBitmapFactories::createImageBitmap(EventTarget& eventTarget, ImageData* data, int sx, int sy, int sw, int sh, ExceptionState& exceptionState) |
{ |
- if (!data) { |
- exceptionState.throwTypeError("The ImageData provided is invalid."); |
- return ScriptPromise(); |
- } |
if (!sw || !sh) { |
exceptionState.throwDOMException(IndexSizeError, String::format("The source %s provided is 0.", sw ? "height" : "width")); |
return ScriptPromise(); |
@@ -252,10 +228,6 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(EventTarget& eventTarget, |
ScriptPromise ImageBitmapFactories::createImageBitmap(EventTarget& eventTarget, ImageBitmap* bitmap, int sx, int sy, int sw, int sh, ExceptionState& exceptionState) |
{ |
- if (!bitmap) { |
- exceptionState.throwTypeError("The ImageBitmap provided is invalid."); |
- return ScriptPromise(); |
- } |
if (!sw || !sh) { |
exceptionState.throwDOMException(IndexSizeError, String::format("The source %s provided is 0.", sw ? "height" : "width")); |
return ScriptPromise(); |