Changeset 87736 in webkit
- Timestamp:
- May 31, 2011 9:28:33 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r87735 r87736 1 2011-05-31 Andreas Kling <kling@webkit.org> 2 3 Reviewed by Antti Koivisto. 4 5 Canvas/JSC: Auto-generate overloads for setShadow() 6 https://bugs.webkit.org/show_bug.cgi?id=61786 7 8 Add a test to verify the behavior of setShadow() when called 9 with different numbers of arguments. 10 11 * fast/canvas/canvas-overloads-setShadow-expected.txt: Added. 12 * fast/canvas/canvas-overloads-setShadow.html: Added. 13 * fast/canvas/script-tests/canvas-overloads-setShadow.js: Added. 14 1 15 2011-05-31 Andreas Kling <kling@webkit.org> 2 16 -
trunk/Source/WebCore/ChangeLog
r87735 r87736 1 2011-05-31 Andreas Kling <kling@webkit.org> 2 3 Reviewed by Antti Koivisto. 4 5 Canvas/JSC: Auto-generate overloads for setShadow() 6 https://bugs.webkit.org/show_bug.cgi?id=61786 7 8 Move CanvasRenderingContext2D.setShadow() to auto-generated JSC bindings. 9 10 There is a subtle difference to the previous behavior: invalid numbers of 11 arguments now raise TypeError instead of SyntaxError. This is in accordance 12 with Web IDL, and matches the existing V8 bindings. 13 14 Test: fast/canvas/canvas-overloads-setShadow.html 15 16 * bindings/js/JSCanvasRenderingContext2DCustom.cpp: 17 * html/canvas/CanvasRenderingContext2D.idl: 18 1 19 2011-05-31 Andreas Kling <kling@webkit.org> 2 20 -
trunk/Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
r87735 r87736 96 96 } 97 97 98 JSValue JSCanvasRenderingContext2D::setShadow(ExecState* exec)99 {100 CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl());101 102 switch (exec->argumentCount()) {103 case 3:104 context->setShadow(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec),105 exec->argument(2).toFloat(exec));106 break;107 case 4:108 if (exec->argument(3).isString())109 context->setShadow(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec),110 exec->argument(2).toFloat(exec), ustringToString(asString(exec->argument(3))->value(exec)));111 else112 context->setShadow(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec),113 exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec));114 break;115 case 5:116 if (exec->argument(3).isString())117 context->setShadow(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec),118 exec->argument(2).toFloat(exec), ustringToString(asString(exec->argument(3))->value(exec)),119 exec->argument(4).toFloat(exec));120 else121 context->setShadow(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec),122 exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec),123 exec->argument(4).toFloat(exec));124 break;125 case 7:126 context->setShadow(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec),127 exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec),128 exec->argument(4).toFloat(exec), exec->argument(5).toFloat(exec),129 exec->argument(6).toFloat(exec));130 break;131 case 8:132 context->setShadow(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec),133 exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec),134 exec->argument(4).toFloat(exec), exec->argument(5).toFloat(exec),135 exec->argument(6).toFloat(exec), exec->argument(7).toFloat(exec));136 break;137 default:138 return throwSyntaxError(exec);139 }140 141 return jsUndefined();142 }143 144 98 JSValue JSCanvasRenderingContext2D::createPattern(ExecState* exec) 145 99 { -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl
r87735 r87736 141 141 in [Optional] DOMString compositeOperation); 142 142 143 #if defined(V8_BINDING) && V8_BINDING144 145 143 void setShadow(in float width, in float height, in float blur, in [Optional] DOMString color, in [Optional] float alpha); 146 144 void setShadow(in float width, in float height, in float blur, in float grayLevel, in [Optional] float alpha); … … 148 146 void setShadow(in float width, in float height, in float blur, in float c, in float m, in float y, in float k, in float a); 149 147 148 #if defined(V8_BINDING) && V8_BINDING 150 149 CanvasPattern createPattern(in HTMLCanvasElement canvas, in [ConvertNullToNullString] DOMString repetitionType) 151 150 raises (DOMException); … … 160 159 #else 161 160 // FIXME: Remove 'else' once JSC supports overloads too. 162 [Custom] void setShadow(/* 3 */);163 161 [Custom] void createPattern(/* 2 */); 164 162 [Custom] void putImageData(/* in ImageData imagedata, in float dx, in float dy [, in float dirtyX, in float dirtyY, in float dirtyWidth, in float dirtyHeight] */);
Note: See TracChangeset
for help on using the changeset viewer.