| Index: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
|
| index ef72bebdf0a1ea54dd5949843575781ef1f9e3f7..2e58bec4cd36bf80e7f4042a0613b8a186f9b851 100644
|
| --- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
|
| +++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
|
| @@ -174,36 +174,14 @@
|
| return HTMLElement::insertedInto(node);
|
| }
|
|
|
| -void HTMLCanvasElement::setHeight(int value, ExceptionState& exceptionState)
|
| -{
|
| - if (surfaceLayerBridge()) {
|
| - // The existence of surfaceLayerBridge indicates that
|
| - // canvas.transferControlToOffscreen has been called.
|
| - exceptionState.throwDOMException(InvalidStateError, "Resizing is not allowed for a canvas that has transferred its control to offscreen.");
|
| - return;
|
| - }
|
| +void HTMLCanvasElement::setHeight(int value)
|
| +{
|
| setIntegralAttribute(heightAttr, value);
|
| }
|
|
|
| -void HTMLCanvasElement::setWidth(int value, ExceptionState& exceptionState)
|
| -{
|
| - if (surfaceLayerBridge()) {
|
| - // Same comment as above.
|
| - exceptionState.throwDOMException(InvalidStateError, "Resizing is not allowed for a canvas that has transferred its control to offscreen.");
|
| - return;
|
| - }
|
| +void HTMLCanvasElement::setWidth(int value)
|
| +{
|
| setIntegralAttribute(widthAttr, value);
|
| -}
|
| -
|
| -void HTMLCanvasElement::setSize(const IntSize& newSize)
|
| -{
|
| - if (newSize == size())
|
| - return;
|
| - m_ignoreReset = true;
|
| - setIntegralAttribute(widthAttr, newSize.width());
|
| - setIntegralAttribute(heightAttr, newSize.height());
|
| - m_ignoreReset = false;
|
| - reset();
|
| }
|
|
|
| HTMLCanvasElement::ContextFactoryVector& HTMLCanvasElement::renderingContextFactories()
|
| @@ -662,9 +640,6 @@
|
|
|
| String HTMLCanvasElement::toDataURL(const String& mimeType, const ScriptValue& qualityArgument, ExceptionState& exceptionState) const
|
| {
|
| - if (surfaceLayerBridge()) {
|
| - exceptionState.throwDOMException(InvalidStateError, "canvas.toDataURL is not allowed for a canvas that has transferred its control to offscreen.");
|
| - }
|
| if (!originClean()) {
|
| exceptionState.throwSecurityError("Tainted canvases may not be exported.");
|
| return String();
|
| @@ -711,10 +686,6 @@
|
|
|
| void HTMLCanvasElement::toBlob(BlobCallback* callback, const String& mimeType, const ScriptValue& qualityArgument, ExceptionState& exceptionState)
|
| {
|
| - if (surfaceLayerBridge()) {
|
| - exceptionState.throwDOMException(InvalidStateError, "canvas.toBlob is not allowed for a canvas that has transferred its control to offscreen.");
|
| - }
|
| -
|
| if (!originClean()) {
|
| exceptionState.throwSecurityError("Tainted canvases may not be exported.");
|
| return;
|
| @@ -1049,8 +1020,8 @@
|
| void HTMLCanvasElement::createImageBufferUsingSurfaceForTesting(std::unique_ptr<ImageBufferSurface> surface)
|
| {
|
| discardImageBuffer();
|
| - setIntegralAttribute(widthAttr, surface->size().width());
|
| - setIntegralAttribute(heightAttr, surface->size().height());
|
| + setWidth(surface->size().width());
|
| + setHeight(surface->size().height());
|
| createImageBufferInternal(std::move(surface));
|
| }
|
|
|
|
|