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

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

Issue 2335903003: Revert of Disallow users modify canvas after it transfers control to offscreen (Closed)
Patch Set: Created 4 years, 3 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/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));
}
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLCanvasElement.h ('k') | third_party/WebKit/Source/core/html/HTMLCanvasElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698