Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(856)

Unified Diff: third_party/WebKit/Source/core/html/HTMLVideoElement.cpp

Issue 2035113002: Implement ImageBitmapOptions resize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: spec is clear, patch is now ready Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp b/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
index 04ae3c0f4c4b88d04dc13ea5d87e69732cfcd376..7c2e0e51e5c63b6df2d7a9c7f4ef4f551209e213 100644
--- a/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
@@ -342,6 +342,10 @@ ScriptPromise HTMLVideoElement::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));
}

Powered by Google App Engine
This is Rietveld 408576698