Changeset 149723 in webkit
- Timestamp:
- May 8, 2013 1:55:25 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r149715 r149723 1 2013-05-08 Dongseong Hwang <dongseong.hwang@intel.com> 2 3 Make optional arguments in CanvasRenderingContext2D match the spec. 4 https://bugs.webkit.org/show_bug.cgi?id=115723 5 6 Reviewed by Dean Jackson. 7 8 When tests use <canvas> API with not enough arguments, TypeError 9 exception is fired now. So three tests are changed to match the canvas 10 spec. 11 12 * fast/canvas/canvas-overloads-strokeRect-expected.txt: 13 * fast/canvas/script-tests/canvas-overloads-strokeRect.js: 14 * platform/mac/canvas/philip/tests/2d.missingargs-expected.txt: 15 1 16 2013-05-08 Ryosuke Niwa <rniwa@webkit.org> 2 17 -
trunk/LayoutTests/fast/canvas/canvas-overloads-strokeRect-expected.txt
r87733 r149723 4 4 5 5 6 PASS ctx.strokeRect() is undefined7 PASS ctx.strokeRect(0) is undefined8 PASS ctx.strokeRect(0, 0) is undefined9 PASS ctx.strokeRect(0, 0, 0) is undefined6 PASS ctx.strokeRect() threw exception TypeError: Not enough arguments. 7 PASS ctx.strokeRect(0) threw exception TypeError: Not enough arguments. 8 PASS ctx.strokeRect(0, 0) threw exception TypeError: Not enough arguments. 9 PASS ctx.strokeRect(0, 0, 0) threw exception TypeError: Not enough arguments. 10 10 PASS ctx.strokeRect(0, 0, 0, 0) is undefined 11 11 PASS ctx.strokeRect(0, 0, 0, 0, 0) is undefined -
trunk/LayoutTests/fast/canvas/script-tests/canvas-overloads-strokeRect.js
r98407 r149723 3 3 var ctx = document.createElement('canvas').getContext('2d'); 4 4 5 var SyntaxError = "SyntaxError: Syntax error"; 6 var TypeError = "TypeError: Type error"; 5 var TypeErrorNotEnoughArguments = "TypeError: Not enough arguments"; 7 6 8 should Be("ctx.strokeRect()", "undefined");9 should Be("ctx.strokeRect(0)", "undefined");10 should Be("ctx.strokeRect(0, 0)", "undefined");11 should Be("ctx.strokeRect(0, 0, 0)", "undefined");7 shouldThrow("ctx.strokeRect()", "TypeErrorNotEnoughArguments"); 8 shouldThrow("ctx.strokeRect(0)", "TypeErrorNotEnoughArguments"); 9 shouldThrow("ctx.strokeRect(0, 0)", "TypeErrorNotEnoughArguments"); 10 shouldThrow("ctx.strokeRect(0, 0, 0)", "TypeErrorNotEnoughArguments"); 12 11 shouldBe("ctx.strokeRect(0, 0, 0, 0)", "undefined"); 13 12 shouldBe("ctx.strokeRect(0, 0, 0, 0, 0)", "undefined"); -
trunk/LayoutTests/inspector/profiler/canvas2d/canvas2d-profiler-capturing-basics.html
r133438 r149723 231 231 for (var i = 0; i < 10; ++i) { 232 232 ctx.rotate(1); 233 ctx.scale(2 );233 ctx.scale(2, 2); 234 234 ctx.clip(); 235 ctx.transform(3 );235 ctx.transform(3, 3, 3, 3, 3, 3); 236 236 ctx.restore(); 237 237 assertNumberOfCallsInLog(24 + i); -
trunk/LayoutTests/platform/mac/canvas/philip/tests/2d.missingargs-expected.txt
r134859 r149723 1 Failed assertion: should throw exception of type TypeError: ctx.scale()2 Failed assertion: should throw exception of type TypeError: ctx.scale(1)3 Failed assertion: should throw exception of type TypeError: ctx.rotate()4 Failed assertion: should throw exception of type TypeError: ctx.translate()5 Failed assertion: should throw exception of type TypeError: ctx.translate(0)6 Failed assertion: should throw exception of type TypeError: ctx.transform()7 Failed assertion: should throw exception of type TypeError: ctx.transform(1)8 Failed assertion: should throw exception of type TypeError: ctx.transform(1, 0)9 Failed assertion: should throw exception of type TypeError: ctx.transform(1, 0, 0)10 Failed assertion: should throw exception of type TypeError: ctx.transform(1, 0, 0, 1)11 Failed assertion: should throw exception of type TypeError: ctx.transform(1, 0, 0, 1, 0)12 Failed assertion: should throw exception of type TypeError: ctx.setTransform()13 Failed assertion: should throw exception of type TypeError: ctx.setTransform(1)14 Failed assertion: should throw exception of type TypeError: ctx.setTransform(1, 0)15 Failed assertion: should throw exception of type TypeError: ctx.setTransform(1, 0, 0)16 Failed assertion: should throw exception of type TypeError: ctx.setTransform(1, 0, 0, 1)17 Failed assertion: should throw exception of type TypeError: ctx.setTransform(1, 0, 0, 1, 0)18 Failed assertion: expected exception of type TypeError, got: Error: NotSupportedError: DOM Exception 919 Failed assertion: expected exception of type TypeError, got: Error: NotSupportedError: DOM Exception 920 Failed assertion: expected exception of type TypeError, got: Error: NotSupportedError: DOM Exception 921 Failed assertion: expected exception of type TypeError, got: Error: NotSupportedError: DOM Exception 922 Failed assertion: expected exception of type TypeError, got: Error: NotSupportedError: DOM Exception 923 Failed assertion: expected exception of type TypeError, got: Error: NotSupportedError: DOM Exception 924 Failed assertion: expected exception of type TypeError, got: Error: NotSupportedError: DOM Exception 925 Failed assertion: expected exception of type TypeError, got: Error: NotSupportedError: DOM Exception 926 Failed assertion: expected exception of type TypeError, got: Error: NotSupportedError: DOM Exception 927 Failed assertion: expected exception of type TypeError, got: Error: NotSupportedError: DOM Exception 928 Failed assertion: should throw exception of type TypeError: ctx.clearRect()29 Failed assertion: should throw exception of type TypeError: ctx.clearRect(0)30 Failed assertion: should throw exception of type TypeError: ctx.clearRect(0, 0)31 Failed assertion: should throw exception of type TypeError: ctx.clearRect(0, 0, 0)32 Failed assertion: should throw exception of type TypeError: ctx.fillRect()33 Failed assertion: should throw exception of type TypeError: ctx.fillRect(0)34 Failed assertion: should throw exception of type TypeError: ctx.fillRect(0, 0)35 Failed assertion: should throw exception of type TypeError: ctx.fillRect(0, 0, 0)36 Failed assertion: should throw exception of type TypeError: ctx.strokeRect()37 Failed assertion: should throw exception of type TypeError: ctx.strokeRect(0)38 Failed assertion: should throw exception of type TypeError: ctx.strokeRect(0, 0)39 Failed assertion: should throw exception of type TypeError: ctx.strokeRect(0, 0, 0)40 Failed assertion: should throw exception of type TypeError: ctx.moveTo()41 Failed assertion: should throw exception of type TypeError: ctx.moveTo(0)42 Failed assertion: should throw exception of type TypeError: ctx.lineTo()43 Failed assertion: should throw exception of type TypeError: ctx.lineTo(0)44 Failed assertion: should throw exception of type TypeError: ctx.quadraticCurveTo()45 Failed assertion: should throw exception of type TypeError: ctx.quadraticCurveTo(0)46 Failed assertion: should throw exception of type TypeError: ctx.quadraticCurveTo(0, 0)47 Failed assertion: should throw exception of type TypeError: ctx.quadraticCurveTo(0, 0, 0)48 Failed assertion: should throw exception of type TypeError: ctx.bezierCurveTo()49 Failed assertion: should throw exception of type TypeError: ctx.bezierCurveTo(0)50 Failed assertion: should throw exception of type TypeError: ctx.bezierCurveTo(0, 0)51 Failed assertion: should throw exception of type TypeError: ctx.bezierCurveTo(0, 0, 0)52 Failed assertion: should throw exception of type TypeError: ctx.bezierCurveTo(0, 0, 0, 0)53 Failed assertion: should throw exception of type TypeError: ctx.bezierCurveTo(0, 0, 0, 0, 0)54 Failed assertion: should throw exception of type TypeError: ctx.arcTo()55 Failed assertion: should throw exception of type TypeError: ctx.arcTo(0)56 Failed assertion: should throw exception of type TypeError: ctx.arcTo(0, 0)57 Failed assertion: should throw exception of type TypeError: ctx.arcTo(0, 0, 0)58 Failed assertion: should throw exception of type TypeError: ctx.arcTo(0, 0, 0, 0)59 Failed assertion: should throw exception of type TypeError: ctx.rect()60 Failed assertion: should throw exception of type TypeError: ctx.rect(0)61 Failed assertion: should throw exception of type TypeError: ctx.rect(0, 0)62 Failed assertion: should throw exception of type TypeError: ctx.rect(0, 0, 0)63 Failed assertion: should throw exception of type TypeError: ctx.arc()64 Failed assertion: should throw exception of type TypeError: ctx.arc(0)65 Failed assertion: should throw exception of type TypeError: ctx.arc(0, 0)66 Failed assertion: should throw exception of type TypeError: ctx.arc(0, 0, 1)67 Failed assertion: should throw exception of type TypeError: ctx.arc(0, 0, 1, 0)68 Failed assertion: should throw exception of type TypeError: ctx.isPointInPath()69 Failed assertion: should throw exception of type TypeError: ctx.isPointInPath(0)70 Failed assertion: should throw exception of type TypeError: ctx.measureText()71 Failed assertion: expected exception of type TypeError, got: Error: NotSupportedError: DOM Exception 972 Failed assertion: expected exception of type TypeError, got: Error: NotSupportedError: DOM Exception 973 Failed assertion: expected exception of type TypeError, got: Error: NotSupportedError: DOM Exception 974 Failed assertion: expected exception of type TypeError, got: Error: NotSupportedError: DOM Exception 975 1 Failed assertion: expected exception of type TypeError, got: Error: IndexSizeError: DOM Exception 1 76 2 Failed assertion: expected exception of type TypeError, got: Error: SyntaxError: DOM Exception 12 -
trunk/Source/WebCore/ChangeLog
r149718 r149723 1 2013-05-08 Dongseong Hwang <dongseong.hwang@intel.com> 2 3 Make optional arguments in CanvasRenderingContext2D match the spec. 4 https://bugs.webkit.org/show_bug.cgi?id=115723 5 6 Reviewed by Dean Jackson. 7 8 WebKit r98985 set many arguments optional although the canvas spec[1] does not 9 indicate. So this patch corrects CanvasRenderingContext2D.idl to match the spec. 10 11 [1] http://www.w3.org/html/wg/drafts/2dcontext/html5_canvas/ 12 13 Covered by existing tests: 14 canvas/philip/tests/2d.missingargs.html 15 fast/canvas/canvas-overloads-strokeRect.html 16 inspector/profiler/canvas2d/canvas2d-profiler-capturing-basics.html 17 18 * html/canvas/CanvasRenderingContext2D.idl: 19 1 20 2013-05-08 Ryosuke Niwa <rniwa@webkit.org> 2 21 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl
r149368 r149723 31 31 void restore(); 32 32 33 void scale([Default=Undefined] optional float sx, 34 [Default=Undefined] optional float sy); 35 void rotate([Default=Undefined] optional float angle); 36 void translate([Default=Undefined] optional float tx, 37 [Default=Undefined] optional float ty); 38 void transform([Default=Undefined] optional float m11, 39 [Default=Undefined] optional float m12, 40 [Default=Undefined] optional float m21, 41 [Default=Undefined] optional float m22, 42 [Default=Undefined] optional float dx, 43 [Default=Undefined] optional float dy); 44 void setTransform([Default=Undefined] optional float m11, 45 [Default=Undefined] optional float m12, 46 [Default=Undefined] optional float m21, 47 [Default=Undefined] optional float m22, 48 [Default=Undefined] optional float dx, 49 [Default=Undefined] optional float dy); 33 void scale(float sx, float sy); 34 void rotate(float angle); 35 void translate(float tx, float ty); 36 void transform(float m11, float m12, float m21, float m22, float dx, float dy); 37 void setTransform(float m11, float m12, float m21, float m22, float dx, float dy); 50 38 51 39 attribute float globalAlpha; 52 40 [TreatNullAs=NullString] attribute DOMString globalCompositeOperation; 53 41 54 CanvasGradient createLinearGradient([Default=Undefined] optional float x0, 55 [Default=Undefined] optional float y0, 56 [Default=Undefined] optional float x1, 57 [Default=Undefined] optional float y1) 42 CanvasGradient createLinearGradient(float x0, float y0, float x1, float y1) 58 43 raises (DOMException); 59 CanvasGradient createRadialGradient([Default=Undefined] optional float x0, 60 [Default=Undefined] optional float y0, 61 [Default=Undefined] optional float r0, 62 [Default=Undefined] optional float x1, 63 [Default=Undefined] optional float y1, 64 [Default=Undefined] optional float r1) 44 CanvasGradient createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1) 65 45 raises (DOMException); 66 46 … … 82 62 attribute float webkitLineDashOffset; 83 63 84 void clearRect([Default=Undefined] optional float x, 85 [Default=Undefined] optional float y, 86 [Default=Undefined] optional float width, 87 [Default=Undefined] optional float height); 88 void fillRect([Default=Undefined] optional float x, 89 [Default=Undefined] optional float y, 90 [Default=Undefined] optional float width, 91 [Default=Undefined] optional float height); 64 void clearRect(float x, float y, float width, float height); 65 void fillRect(float x, float y, float width, float height); 92 66 93 67 void beginPath(); … … 99 73 // FIXME: These methods should be shared with CanvasRenderingContext2D in the CanvasPathMethods interface. 100 74 void closePath(); 101 void moveTo([Default=Undefined] optional float x, 102 [Default=Undefined] optional float y); 103 void lineTo([Default=Undefined] optional float x, 104 [Default=Undefined] optional float y); 105 void quadraticCurveTo([Default=Undefined] optional float cpx, 106 [Default=Undefined] optional float cpy, 107 [Default=Undefined] optional float x, 108 [Default=Undefined] optional float y); 109 void bezierCurveTo([Default=Undefined] optional float cp1x, 110 [Default=Undefined] optional float cp1y, 111 [Default=Undefined] optional float cp2x, 112 [Default=Undefined] optional float cp2y, 113 [Default=Undefined] optional float x, 114 [Default=Undefined] optional float y); 115 void arcTo([Default=Undefined] optional float x1, 116 [Default=Undefined] optional float y1, 117 [Default=Undefined] optional float x2, 118 [Default=Undefined] optional float y2, 119 [Default=Undefined] optional float radius) 75 void moveTo(float x, float y); 76 void lineTo(float x, float y); 77 void quadraticCurveTo(float cpx, float cpy, float x, float y); 78 void bezierCurveTo(float cp1x, float cp1y, float cp2x, float cp2y, float x, float y); 79 void arcTo(float x1, float y1, float x2, float y2, float radius) 120 80 raises (DOMException); 121 void rect([Default=Undefined] optional float x, 122 [Default=Undefined] optional float y, 123 [Default=Undefined] optional float width, 124 [Default=Undefined] optional float height); 125 void arc([Default=Undefined] optional float x, 126 [Default=Undefined] optional float y, 127 [Default=Undefined] optional float radius, 128 [Default=Undefined] optional float startAngle, 129 [Default=Undefined] optional float endAngle, 130 [Default=Undefined] optional boolean anticlockwise) 81 void rect(float x, float y, float width, float height); 82 void arc(float x, float y, float radius, float startAngle, float endAngle, [Default=Undefined] optional boolean anticlockwise) 131 83 raises (DOMException); 132 84 … … 134 86 void stroke(); 135 87 void clip(optional CanvasWindingRule winding); 136 boolean isPointInPath([Default=Undefined] optional float x, 137 [Default=Undefined] optional float y, 138 optional CanvasWindingRule winding); 139 boolean isPointInStroke([Default=Undefined] optional float x, 140 [Default=Undefined] optional float y); 88 boolean isPointInPath(float x, float y, optional CanvasWindingRule winding); 89 boolean isPointInStroke(float x, float y); 141 90 142 91 // text … … 145 94 attribute DOMString textBaseline; 146 95 147 TextMetrics measureText( [Default=Undefined] optionalDOMString text);96 TextMetrics measureText(DOMString text); 148 97 149 98 // other … … 174 123 void setFillColor(float c, float m, float y, float k, float a); 175 124 176 void strokeRect([Default=Undefined] optional float x, 177 [Default=Undefined] optional float y, 178 [Default=Undefined] optional float width, 179 [Default=Undefined] optional float height, 180 optional float lineWidth); 125 void strokeRect(float x, float y, float width, float height, optional float lineWidth); 181 126 182 127 void drawImage(HTMLImageElement? image, float x, float y) … … 234 179 235 180 // pixel manipulation 236 ImageData getImageData([Default=Undefined] optional float sx, [Default=Undefined] optional float sy, 237 [Default=Undefined] optional float sw, [Default=Undefined] optional float sh) 181 ImageData getImageData(float sx, float sy, float sw, float sh) 238 182 raises(DOMException); 239 183 240 ImageData webkitGetImageDataHD([Default=Undefined] optional float sx, [Default=Undefined] optional float sy, 241 [Default=Undefined] optional float sw, [Default=Undefined] optional float sh) 184 ImageData webkitGetImageDataHD(float sx, float sy, float sw, float sh) 242 185 raises(DOMException); 243 186
Note: See TracChangeset
for help on using the changeset viewer.