Changeset 87730 in webkit
- Timestamp:
- May 31, 2011 9:10:39 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r87729 r87730 1 2011-05-31 Andreas Kling <kling@webkit.org> 2 3 Reviewed by Antti Koivisto. 4 5 Canvas/JSC: Auto-generate overloads for strokeText() 6 https://bugs.webkit.org/show_bug.cgi?id=61626 7 8 Add a test to verify the behavior of strokeText() when called with different 9 numbers of arguments. There are two differences to the previous behavior: 10 11 - SyntaxError exceptions are now raised with the message "Not enough arguments." 12 - Calling strokeText() with superfluous arguments now lets the call through 13 instead of raising a SyntaxError. This matches both Gecko and Presto. 14 15 * fast/canvas/canvas-overloads-strokeText-expected.txt: Added. 16 * fast/canvas/canvas-overloads-strokeText.html: Added. 17 * fast/canvas/script-tests/canvas-overloads-strokeText.js: Added. 18 1 19 2011-05-31 Andreas Kling <kling@webkit.org> 2 20 -
trunk/Source/WebCore/ChangeLog
r87729 r87730 1 2011-05-31 Andreas Kling <kling@webkit.org> 2 3 Reviewed by Antti Koivisto. 4 5 Canvas/JSC: Auto-generate overloads for strokeText() 6 https://bugs.webkit.org/show_bug.cgi?id=61626 7 8 Move CanvasRenderingContext2D.strokeText() to auto-generated JSC bindings. 9 Make it [RequiresAllArguments=Raise] to match the old behavior. 10 This has the side-effect of aligning the behaviors of JSC and V8. 11 12 Test: fast/canvas/canvas-overloads-strokeText.html 13 14 * bindings/js/JSCanvasRenderingContext2DCustom.cpp: 15 * html/canvas/CanvasRenderingContext2D.idl: 16 1 17 2011-05-31 Andreas Kling <kling@webkit.org> 2 18 -
trunk/Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
r87729 r87730 410 410 } 411 411 412 JSValue JSCanvasRenderingContext2D::strokeText(ExecState* exec)413 {414 CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl());415 416 // string arg = text to draw417 // number arg = x418 // number arg = y419 // optional number arg = maxWidth420 if (exec->argumentCount() < 3 || exec->argumentCount() > 4)421 return throwSyntaxError(exec);422 423 if (exec->argumentCount() == 4)424 context->strokeText(ustringToString(exec->argument(0).toString(exec)), exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec));425 else426 context->strokeText(ustringToString(exec->argument(0).toString(exec)), exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec));427 return jsUndefined();428 }429 430 412 } // namespace WebCore -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl
r87729 r87730 101 101 102 102 [RequiresAllArguments=Raise] void fillText(in DOMString text, in float x, in float y, in [Optional] float maxWidth); 103 [RequiresAllArguments=Raise] void strokeText(in DOMString text, in float x, in float y, in [Optional] float maxWidth); 103 104 104 105 #if defined(V8_BINDING) && V8_BINDING 105 void strokeText(in DOMString text, in float x, in float y, in [Optional] float maxWidth);106 107 106 void setStrokeColor(in DOMString color, in [Optional] float alpha); 108 107 void setStrokeColor(in float grayLevel, in [Optional] float alpha); … … 158 157 #else 159 158 // FIXME: Remove 'else' once JSC supports overloads too. 160 [Custom] void strokeText(/* 4 */);161 159 [Custom] void setStrokeColor(/* 1 */); 162 160 [Custom] void setFillColor(/* 1 */);
Note: See TracChangeset
for help on using the changeset viewer.