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 ddd4a86b58293da2028e6df44b9ecee79cf99221..5926bd940f2aa5892ead573097d9f92966dabe89 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, ImageBitmapSource* bitmapSource, 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(static_cast<ImageBitmap*>(bitmapSource), IntRect(sx, sy, sw, sh))); |
+} |
+ |
void ImageBitmap::notifyImageSourceChanged() |
{ |
} |