| Index: third_party/WebKit/Source/core/html/HTMLImageElement.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
|
| index 7511b30e3909957401b419099360b25114d6fa16..9732660498ac78951e5539b236642630b8892245 100644
|
| --- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
|
| +++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
|
| @@ -694,6 +694,10 @@ ScriptPromise HTMLImageElement::createImageBitmap(ScriptState* scriptState, Even
|
| 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, ImageBitmap::create(this, IntRect(sx, sy, sw, sh), eventTarget.toLocalDOMWindow()->document(), options));
|
| }
|
|
|
|
|