| Index: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
|
| index c4f61a920737688205b7a09ae86f9296d2369585..4000614412d90583b35b036e4f9d0376ab05e3f1 100644
|
| --- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
|
| +++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
|
| @@ -1108,10 +1108,10 @@ IntSize HTMLCanvasElement::bitmapSourceSize() const
|
| ScriptPromise HTMLCanvasElement::createImageBitmap(ScriptState* scriptState, EventTarget& eventTarget, int sx, int sy, int sw, int sh, const ImageBitmapOptions& options, ExceptionState& exceptionState)
|
| {
|
| DCHECK(eventTarget.toLocalDOMWindow());
|
| - if (!sw || !sh) {
|
| - exceptionState.throwDOMException(IndexSizeError, String::format("The source %s provided is 0.", sw ? "height" : "width"));
|
| + if (!ImageBitmap::isSWSHValid(sw, sh, exceptionState))
|
| + return ScriptPromise();
|
| + if (!ImageBitmap::isResizeOptionValid(options, exceptionState))
|
| return ScriptPromise();
|
| - }
|
| return ImageBitmapSource::fulfillImageBitmap(scriptState, isPaintable() ? ImageBitmap::create(this, IntRect(sx, sy, sw, sh), options) : nullptr);
|
| }
|
|
|
|
|