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

Unified Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 257853002: Update the <canvas> IDLs wrt 'unrestricted' (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: And now with the right substitution... Created 6 years, 8 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
« no previous file with comments | « Source/core/html/canvas/CanvasPathMethods.idl ('k') | Source/core/html/canvas/CanvasRenderingContext2D.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/CanvasRenderingContext2D.cpp
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
index 8fb31fa2206334a4892cae55288da7a9b2a5c53e..0029572dd0df60700871b2959863b61540ae44e9 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -1648,6 +1648,7 @@ template<class T> void CanvasRenderingContext2D::fullCanvasCompositedStroke(cons
PassRefPtr<CanvasGradient> CanvasRenderingContext2D::createLinearGradient(float x0, float y0, float x1, float y1, ExceptionState& exceptionState)
{
+ // FIXME: These exceptions will be thrown by generated bindings code once crbug.com/354298 is fixed.
if (!std::isfinite(x0))
exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::notAFiniteNumber(x0, "x0"));
else if (!std::isfinite(y0))
@@ -1666,6 +1667,8 @@ PassRefPtr<CanvasGradient> CanvasRenderingContext2D::createLinearGradient(float
PassRefPtr<CanvasGradient> CanvasRenderingContext2D::createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, ExceptionState& exceptionState)
{
+ // FIXME: These exceptions (except the IndexSizeError) will be thrown by
+ // generated bindings code once crbug.com/354298 is fixed.
if (!std::isfinite(x0))
exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::notAFiniteNumber(x0, "x0"));
else if (!std::isfinite(y0))
@@ -1797,6 +1800,8 @@ PassRefPtrWillBeRawPtr<ImageData> CanvasRenderingContext2D::createImageData(floa
{
if (!sw || !sh)
exceptionState.throwDOMException(IndexSizeError, String::format("The source %s is 0.", sw ? "height" : "width"));
+ // FIXME: These exceptions will be thrown by generated bindings code once
+ // crbug.com/354298 is fixed.
else if (!std::isfinite(sw))
exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::notAFiniteNumber(sw, "source width"));
else if (!std::isfinite(sh))
@@ -1824,6 +1829,8 @@ PassRefPtrWillBeRawPtr<ImageData> CanvasRenderingContext2D::getImageData(float s
exceptionState.throwSecurityError("The canvas has been tainted by cross-origin data.");
else if (!sw || !sh)
exceptionState.throwDOMException(IndexSizeError, String::format("The source %s is 0.", sw ? "height" : "width"));
+ // FIXME: These exceptions will be thrown by generated bindings code once
+ // crbug.com/354298 is fixed.
else if (!std::isfinite(sx))
exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::notAFiniteNumber(sx, "source X"));
else if (!std::isfinite(sy))
@@ -1873,6 +1880,8 @@ void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy,
void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy, float dirtyX, float dirtyY,
float dirtyWidth, float dirtyHeight, ExceptionState& exceptionState)
{
+ // FIXME: These exceptions will be thrown by generated bindings code once
+ // crbug.com/354298 is fixed.
if (!std::isfinite(dx))
exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::notAFiniteNumber(dx, "dx"));
else if (!std::isfinite(dy))
« no previous file with comments | « Source/core/html/canvas/CanvasPathMethods.idl ('k') | Source/core/html/canvas/CanvasRenderingContext2D.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698