| 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 200d0ba317fc6a5655325e01f63532bc247c3607..66bdaf2d16ea1d48b05b9b7981c9ff01e514ed9c 100644
|
| --- a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
|
| +++ b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
|
| @@ -27,20 +27,24 @@ OffscreenCanvas* OffscreenCanvas::create(unsigned width, unsigned height)
|
| return new OffscreenCanvas(IntSize(clampTo<int>(width), clampTo<int>(height)));
|
| }
|
|
|
| -void OffscreenCanvas::setWidth(unsigned width)
|
| +void OffscreenCanvas::setWidth(unsigned width, ExceptionState& exceptionState)
|
| {
|
| // If this OffscreenCanvas is transferred control by an html canvas,
|
| // its size is determined by html canvas's size and cannot be resized.
|
| - if (m_canvasId >= 0)
|
| + if (m_canvasId >= 0) {
|
| + exceptionState.throwDOMException(InvalidStateError, "Resizing is not allowed on an OffscreenCanvas that has been transferred control from a canvas.");
|
| return;
|
| + }
|
| m_size.setWidth(clampTo<int>(width));
|
| }
|
|
|
| -void OffscreenCanvas::setHeight(unsigned height)
|
| +void OffscreenCanvas::setHeight(unsigned height, ExceptionState& exceptionState)
|
| {
|
| // Same comment as above.
|
| - if (m_canvasId >= 0)
|
| + if (m_canvasId >= 0) {
|
| + exceptionState.throwDOMException(InvalidStateError, "Resizing is not allowed on an OffscreenCanvas that has been transferred control from a canvas.");
|
| return;
|
| + }
|
| m_size.setHeight(clampTo<int>(height));
|
| }
|
|
|
|
|