Chromium Code Reviews| Index: third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp |
| diff --git a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp |
| index 550ae97f7812703f3bfd86bc1fb93d68371313ce..d04a4cd040075225594278e464eb9b30780d408e 100644 |
| --- a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp |
| +++ b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp |
| @@ -203,6 +203,12 @@ ScriptPromise OffscreenCanvas::convertToBlob(ScriptState* scriptState, |
| return exceptionState.reject(scriptState); |
| } |
| + if (!width() || !height()) { |
| + exceptionState.throwDOMException( |
| + IndexSizeError, "Zero-sized OffscreenCanvas cannot be transferred."); |
|
xlai (Olivia)
2016/11/21 16:34:00
Also, change the error msg. I think it has nothing
xidachen
2016/11/21 16:40:28
Done.
|
| + return exceptionState.reject(scriptState); |
| + } |
| + |
| if (!this->isPaintable()) { |
| return ScriptPromise(); |
|
xlai (Olivia)
2016/11/21 16:34:00
Actually, the third case is already handled in thi
xidachen
2016/11/21 16:40:28
Done, makes perfect sense.
|
| } |