Index: third_party/WebKit/Source/core/frame/ImageBitmap.cpp |
diff --git a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp |
index 24d94caad6a7f3cab0a02785eaf97135de9cf6df..4c125cbc7f246cfec5f5c2638225402edbaee884 100644 |
--- a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp |
+++ b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp |
@@ -187,6 +187,15 @@ IntSize ImageBitmap::size() const |
return IntSize(m_image->width(), m_image->height()); |
} |
+ScriptPromise ImageBitmap::createImageBitmap(ScriptState* scriptState, EventTarget& eventTarget, int sx, int sy, int sw, int sh, ExceptionState& exceptionState) |
+{ |
+ if (!sw || !sh) { |
+ exceptionState.throwDOMException(IndexSizeError, String::format("The source %s provided is 0.", sw ? "height" : "width")); |
+ return ScriptPromise(); |
+ } |
+ return ImageBitmapSource::fulfillImageBitmap(scriptState, create(this, IntRect(sx, sy, sw, sh))); |
+} |
+ |
void ImageBitmap::notifyImageSourceChanged() |
{ |
} |