| 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..eb8006af399bafda61db7223b7ff61d76385abd0 100644
|
| --- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
|
| +++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
|
| @@ -1112,6 +1112,10 @@ ScriptPromise HTMLCanvasElement::createImageBitmap(ScriptState* scriptState, Eve
|
| exceptionState.throwDOMException(IndexSizeError, String::format("The source %s provided is 0.", sw ? "height" : "width"));
|
| return ScriptPromise();
|
| }
|
| + if ((options.hasResizeWidth() && options.resizeWidth() <= 0) || (options.hasResizeHeight() && options.resizeHeight() <= 0)) {
|
| + exceptionState.throwDOMException(InvalidStateError, "The resizeWidth or/and resizeHeight is less than or equals to 0.");
|
| + return ScriptPromise();
|
| + }
|
| return ImageBitmapSource::fulfillImageBitmap(scriptState, isPaintable() ? ImageBitmap::create(this, IntRect(sx, sy, sw, sh), options) : nullptr);
|
| }
|
|
|
|
|