Changeset 87729 in webkit
- Timestamp:
- May 31, 2011 9:08:49 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r87726 r87729 1 2011-05-31 Andreas Kling <kling@webkit.org> 2 3 Reviewed by Antti Koivisto. 4 5 Canvas/JSC: Auto-generate overloads for fillText() 6 https://bugs.webkit.org/show_bug.cgi?id=61623 7 8 Add a test to verify the behavior of fillText() 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 fillText() 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-fillText-expected.txt: Added. 16 * fast/canvas/canvas-overloads-fillText.html: Added. 17 * fast/canvas/script-tests/canvas-overloads-fillText.js: Added. 18 1 19 2011-05-31 Simon Fraser <simon.fraser@apple.com> 2 20 -
trunk/Source/WebCore/ChangeLog
r87726 r87729 1 2011-05-31 Andreas Kling <kling@webkit.org> 2 3 Reviewed by Antti Koivisto. 4 5 Canvas/JSC: Auto-generate overloads for fillText() 6 https://bugs.webkit.org/show_bug.cgi?id=61623 7 8 Move CanvasRenderingContext2D.fillText() 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-fillText.html 13 14 * bindings/js/JSCanvasRenderingContext2DCustom.cpp: 15 * html/canvas/CanvasRenderingContext2D.idl: 16 1 17 2011-05-31 Yael Aharon <yael.aharon@nokia.com> 2 18 -
trunk/Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
r84641 r87729 410 410 } 411 411 412 JSValue JSCanvasRenderingContext2D:: fillText(ExecState* exec)412 JSValue JSCanvasRenderingContext2D::strokeText(ExecState* exec) 413 413 { 414 414 CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl()); … … 422 422 423 423 if (exec->argumentCount() == 4) 424 context->fillText(ustringToString(exec->argument(0).toString(exec)), exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec));425 else426 context->fillText(ustringToString(exec->argument(0).toString(exec)), exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec));427 return jsUndefined();428 }429 430 JSValue JSCanvasRenderingContext2D::strokeText(ExecState* exec)431 {432 CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl());433 434 // string arg = text to draw435 // number arg = x436 // number arg = y437 // optional number arg = maxWidth438 if (exec->argumentCount() < 3 || exec->argumentCount() > 4)439 return throwSyntaxError(exec);440 441 if (exec->argumentCount() == 4)442 424 context->strokeText(ustringToString(exec->argument(0).toString(exec)), exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec)); 443 425 else -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl
r60784 r87729 100 100 void clearShadow(); 101 101 102 [RequiresAllArguments=Raise] void fillText(in DOMString text, in float x, in float y, in [Optional] float maxWidth); 103 102 104 #if defined(V8_BINDING) && V8_BINDING 103 void fillText(in DOMString text, in float x, in float y, in [Optional] float maxWidth);104 105 void strokeText(in DOMString text, in float x, in float y, in [Optional] float maxWidth); 105 106 … … 157 158 #else 158 159 // FIXME: Remove 'else' once JSC supports overloads too. 159 [Custom] void fillText(/* 4 */);160 160 [Custom] void strokeText(/* 4 */); 161 161 [Custom] void setStrokeColor(/* 1 */);
Note: See TracChangeset
for help on using the changeset viewer.