| 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..44c0207cbb2efb39613813c9c3fcd58127f62140 100644
|
| --- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
|
| +++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
|
| @@ -690,10 +690,10 @@ void HTMLImageElement::forceReload() const
|
| ScriptPromise HTMLImageElement::createImageBitmap(ScriptState* scriptState, EventTarget& eventTarget, int sx, int sy, int sw, int sh, const ImageBitmapOptions& options, ExceptionState& exceptionState)
|
| {
|
| ASSERT(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, ImageBitmap::create(this, IntRect(sx, sy, sw, sh), eventTarget.toLocalDOMWindow()->document(), options));
|
| }
|
|
|
|
|