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

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

Issue 14654002: Make optional arguments in CanvasRenderingContext2D match the spec [1]. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Amend inspector/profiler/canvas2d/canvas2d-profiler-capturing-basics.html Created 7 years, 7 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 | « LayoutTests/inspector/profiler/canvas2d/canvas2d-profiler-capturing-basics.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/CanvasRenderingContext2D.idl
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.idl b/Source/core/html/canvas/CanvasRenderingContext2D.idl
index 98df7fa36f873714c8b33d980eb4a632c0070ded..4d9e14779c8c9cf50a60bf389bb837fb0800956a 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.idl
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.idl
@@ -30,37 +30,17 @@ interface CanvasRenderingContext2D : CanvasRenderingContext {
void save();
void restore();
- void scale([Default=Undefined] optional float sx,
- [Default=Undefined] optional float sy);
- void rotate([Default=Undefined] optional float angle);
- void translate([Default=Undefined] optional float tx,
- [Default=Undefined] optional float ty);
- void transform([Default=Undefined] optional float m11,
- [Default=Undefined] optional float m12,
- [Default=Undefined] optional float m21,
- [Default=Undefined] optional float m22,
- [Default=Undefined] optional float dx,
- [Default=Undefined] optional float dy);
- void setTransform([Default=Undefined] optional float m11,
- [Default=Undefined] optional float m12,
- [Default=Undefined] optional float m21,
- [Default=Undefined] optional float m22,
- [Default=Undefined] optional float dx,
- [Default=Undefined] optional float dy);
+ void scale(float sx, float sy);
+ void rotate(float angle);
+ void translate(float tx, float ty);
+ void transform(float m11, float m12, float m21, float m22, float dx, float dy);
+ void setTransform(float m11, float m12, float m21, float m22, float dx, float dy);
attribute float globalAlpha;
[TreatNullAs=NullString] attribute DOMString globalCompositeOperation;
- [RaisesException] CanvasGradient createLinearGradient([Default=Undefined] optional float x0,
- [Default=Undefined] optional float y0,
- [Default=Undefined] optional float x1,
- [Default=Undefined] optional float y1);
- [RaisesException] CanvasGradient createRadialGradient([Default=Undefined] optional float x0,
- [Default=Undefined] optional float y0,
- [Default=Undefined] optional float r0,
- [Default=Undefined] optional float x1,
- [Default=Undefined] optional float y1,
- [Default=Undefined] optional float r1);
+ [RaisesException] CanvasGradient createLinearGradient(float x0, float y0, float x1, float y1);
+ [RaisesException] CanvasGradient createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1);
attribute float lineWidth;
[TreatNullAs=NullString] attribute DOMString lineCap;
@@ -80,14 +60,8 @@ interface CanvasRenderingContext2D : CanvasRenderingContext {
// [Custom] attribute Array webkitLineDash;
// attribute float webkitLineDashOffset;
- void clearRect([Default=Undefined] optional float x,
- [Default=Undefined] optional float y,
- [Default=Undefined] optional float width,
- [Default=Undefined] optional float height);
- void fillRect([Default=Undefined] optional float x,
- [Default=Undefined] optional float y,
- [Default=Undefined] optional float width,
- [Default=Undefined] optional float height);
+ void clearRect(float x, float y, float width, float height);
+ void fillRect(float x, float y, float width, float height);
void beginPath();
@@ -95,61 +69,36 @@ interface CanvasRenderingContext2D : CanvasRenderingContext {
// FIXME: These methods should be shared with CanvasRenderingContext2D in the CanvasPathMethods interface.
void closePath();
- void moveTo([Default=Undefined] optional float x,
- [Default=Undefined] optional float y);
- void lineTo([Default=Undefined] optional float x,
- [Default=Undefined] optional float y);
- void quadraticCurveTo([Default=Undefined] optional float cpx,
- [Default=Undefined] optional float cpy,
- [Default=Undefined] optional float x,
- [Default=Undefined] optional float y);
- void bezierCurveTo([Default=Undefined] optional float cp1x,
- [Default=Undefined] optional float cp1y,
- [Default=Undefined] optional float cp2x,
- [Default=Undefined] optional float cp2y,
- [Default=Undefined] optional float x,
- [Default=Undefined] optional float y);
- [RaisesException] void arcTo([Default=Undefined] optional float x1,
- [Default=Undefined] optional float y1,
- [Default=Undefined] optional float x2,
- [Default=Undefined] optional float y2,
- [Default=Undefined] optional float radius);
- void rect([Default=Undefined] optional float x,
- [Default=Undefined] optional float y,
- [Default=Undefined] optional float width,
- [Default=Undefined] optional float height);
- [RaisesException] void arc([Default=Undefined] optional float x,
- [Default=Undefined] optional float y,
- [Default=Undefined] optional float radius,
- [Default=Undefined] optional float startAngle,
- [Default=Undefined] optional float endAngle,
- [Default=Undefined] optional boolean anticlockwise);
+ void moveTo(float x, float y);
+ void lineTo(float x, float y);
+ void quadraticCurveTo(float cpx, float cpy, float x, float y);
+ void bezierCurveTo(float cp1x, float cp1y, float cp2x, float cp2y, float x, float y);
+ [RaisesException] void arcTo(float x1, float y1, float x2, float y2, float radius);
+ void rect(float x, float y, float width, float height);
+ [RaisesException] void arc(float x, float y, float radius, float startAngle, float endAngle, [Default=Undefined] optional boolean anticlockwise);
void fill(optional CanvasWindingRule winding);
void stroke();
void clip(optional CanvasWindingRule winding);
- boolean isPointInPath([Default=Undefined] optional float x,
- [Default=Undefined] optional float y,
- optional CanvasWindingRule winding);
- boolean isPointInStroke([Default=Undefined] optional float x,
- [Default=Undefined] optional float y);
+ boolean isPointInPath(float x, float y, optional CanvasWindingRule winding);
+ boolean isPointInStroke(float x, float y);
// text
attribute DOMString font;
attribute DOMString textAlign;
attribute DOMString textBaseline;
- TextMetrics measureText([Default=Undefined] optional DOMString text);
+ TextMetrics measureText(DOMString text);
// other
- void setAlpha([Default=Undefined] optional float alpha);
- void setCompositeOperation([Default=Undefined] optional DOMString compositeOperation);
+ void setAlpha(float alpha);
+ void setCompositeOperation(DOMString compositeOperation);
- void setLineWidth([Default=Undefined] optional float width);
- void setLineCap([Default=Undefined] optional DOMString cap);
- void setLineJoin([Default=Undefined] optional DOMString join);
- void setMiterLimit([Default=Undefined] optional float limit);
+ void setLineWidth(float width);
+ void setLineCap(DOMString cap);
+ void setLineJoin(DOMString join);
+ void setMiterLimit(float limit);
void clearShadow();
@@ -166,11 +115,7 @@ interface CanvasRenderingContext2D : CanvasRenderingContext {
void setFillColor(float r, float g, float b, float a);
void setFillColor(float c, float m, float y, float k, float a);
- void strokeRect([Default=Undefined] optional float x,
- [Default=Undefined] optional float y,
- [Default=Undefined] optional float width,
- [Default=Undefined] optional float height,
- optional float lineWidth);
+ void strokeRect(float x, float y, float width, float height, optional float lineWidth);
[RaisesException] void drawImage(HTMLImageElement? image, float x, float y);
[RaisesException] void drawImage(HTMLImageElement? image, float x, float y, float width, float height);
@@ -207,11 +152,9 @@ interface CanvasRenderingContext2D : CanvasRenderingContext {
[Custom] attribute custom fillStyle;
// pixel manipulation
- [RaisesException] ImageData getImageData([Default=Undefined] optional float sx, [Default=Undefined] optional float sy,
- [Default=Undefined] optional float sw, [Default=Undefined] optional float sh);
+ [RaisesException] ImageData getImageData(float sx, float sy, float sw, float sh);
- [RaisesException] ImageData webkitGetImageDataHD([Default=Undefined] optional float sx, [Default=Undefined] optional float sy,
- [Default=Undefined] optional float sw, [Default=Undefined] optional float sh);
+ [RaisesException] ImageData webkitGetImageDataHD(float sx, float sy, float sw, float sh);
readonly attribute float webkitBackingStorePixelRatio;
« no previous file with comments | « LayoutTests/inspector/profiler/canvas2d/canvas2d-profiler-capturing-basics.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698