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

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

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.h
diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.h b/third_party/WebKit/Source/core/html/HTMLCanvasElement.h
index d7fab2e7e84c881d6c20604a522b12cfab10edc2..027358b215260695c801c97b43e4983ac943b0d2 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.h
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.h
@@ -88,10 +88,19 @@
const IntSize& size() const { return m_size; }
- void setWidth(int, ExceptionState&);
- void setHeight(int, ExceptionState&);
-
- void setSize(const IntSize& newSize);
+ void setWidth(int);
+ void setHeight(int);
+
+ void setSize(const IntSize& newSize)
+ {
+ if (newSize == size())
+ return;
+ m_ignoreReset = true;
+ setWidth(newSize.width());
+ setHeight(newSize.height());
+ m_ignoreReset = false;
+ reset();
+ }
// Called by Document::getCSSCanvasContext as well as above getContext().
CanvasRenderingContext* getCanvasRenderingContext(const String&, const CanvasContextCreationAttributes&);

Powered by Google App Engine
This is Rietveld 408576698