| Index: third_party/WebKit/Source/core/html/ImageData.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/ImageData.cpp b/third_party/WebKit/Source/core/html/ImageData.cpp
|
| index 5cf5773b2eb3a0edba6703f048236006d606eb2f..f4280f194bfeea1580e6277e8818c55f3e5cbc2d 100644
|
| --- a/third_party/WebKit/Source/core/html/ImageData.cpp
|
| +++ b/third_party/WebKit/Source/core/html/ImageData.cpp
|
| @@ -148,14 +148,14 @@ ImageData* ImageData::create(DOMUint8ClampedArray* data, unsigned width, unsigne
|
|
|
| ScriptPromise ImageData::createImageBitmap(ScriptState* scriptState, EventTarget& eventTarget, int sx, int sy, int sw, int sh, const ImageBitmapOptions& options, ExceptionState& exceptionState)
|
| {
|
| - 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 (data()->bufferBase()->isNeutered()) {
|
| exceptionState.throwDOMException(InvalidStateError, "The source data has been neutered.");
|
| return ScriptPromise();
|
| }
|
| + if (!ImageBitmap::isResizeOptionValid(options, exceptionState))
|
| + return ScriptPromise();
|
| return ImageBitmapSource::fulfillImageBitmap(scriptState, ImageBitmap::create(this, IntRect(sx, sy, sw, sh), options));
|
| }
|
|
|
|
|