Index: Source/core/html/canvas/CanvasRenderingContext2D.cpp |
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp |
index 8fb31fa2206334a4892cae55288da7a9b2a5c53e..b79400a91044110604ab6261ca253806184f773a 100644 |
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp |
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp |
@@ -1795,15 +1795,10 @@ PassRefPtrWillBeRawPtr<ImageData> CanvasRenderingContext2D::createImageData(Pass |
PassRefPtrWillBeRawPtr<ImageData> CanvasRenderingContext2D::createImageData(float sw, float sh, ExceptionState& exceptionState) const |
{ |
- if (!sw || !sh) |
+ if (!sw || !sh) { |
exceptionState.throwDOMException(IndexSizeError, String::format("The source %s is 0.", sw ? "height" : "width")); |
- else if (!std::isfinite(sw)) |
- exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::notAFiniteNumber(sw, "source width")); |
- else if (!std::isfinite(sh)) |
- exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::notAFiniteNumber(sh, "source height")); |
- |
- if (exceptionState.hadException()) |
return nullptr; |
+ } |
FloatSize logicalSize(fabs(sw), fabs(sh)); |
if (!logicalSize.isExpressibleAsIntSize()) |