Changeset 87733 in webkit


Ignore:
Timestamp:
May 31, 2011 9:20:32 AM (13 years ago)
Author:
andreas.kling@nokia.com
Message:

2011-05-31 Andreas Kling <kling@webkit.org>

Reviewed by Antti Koivisto.

Canvas/JSC: Auto-generate overloads for strokeRect()
https://bugs.webkit.org/show_bug.cgi?id=61641

Add a test to verify the behavior of strokeRect() when called with
different numbers of arguments.

  • fast/canvas/canvas-overloads-strokeRect-expected.txt: Added.
  • fast/canvas/canvas-overloads-strokeRect.html: Added.
  • fast/canvas/script-tests/canvas-overloads-strokeRect.js: Added.

2011-05-31 Andreas Kling <kling@webkit.org>

Reviewed by Antti Koivisto.

Canvas/JSC: Auto-generate overloads for strokeRect()
https://bugs.webkit.org/show_bug.cgi?id=61641

Move CanvasRenderingContext2D.setStrokeColor() to auto-generated JSC bindings.

No behavioral change.

Test: fast/canvas/canvas-overloads-strokeRect.html

  • bindings/js/JSCanvasRenderingContext2DCustom.cpp:
  • html/canvas/CanvasRenderingContext2D.idl:
Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r87732 r87733  
     12011-05-31  Andreas Kling  <kling@webkit.org>
     2
     3        Reviewed by Antti Koivisto.
     4
     5        Canvas/JSC: Auto-generate overloads for strokeRect()
     6        https://bugs.webkit.org/show_bug.cgi?id=61641
     7
     8        Add a test to verify the behavior of strokeRect() when called with
     9        different numbers of arguments.
     10
     11        * fast/canvas/canvas-overloads-strokeRect-expected.txt: Added.
     12        * fast/canvas/canvas-overloads-strokeRect.html: Added.
     13        * fast/canvas/script-tests/canvas-overloads-strokeRect.js: Added.
     14
    1152011-05-31  Andreas Kling  <kling@webkit.org>
    216
  • trunk/Source/WebCore/ChangeLog

    r87732 r87733  
     12011-05-31  Andreas Kling  <kling@webkit.org>
     2
     3        Reviewed by Antti Koivisto.
     4
     5        Canvas/JSC: Auto-generate overloads for strokeRect()
     6        https://bugs.webkit.org/show_bug.cgi?id=61641
     7
     8        Move CanvasRenderingContext2D.setStrokeColor() to auto-generated JSC bindings.
     9
     10        No behavioral change.
     11
     12        Test: fast/canvas/canvas-overloads-strokeRect.html
     13
     14        * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
     15        * html/canvas/CanvasRenderingContext2D.idl:
     16
    1172011-05-31  Andreas Kling  <kling@webkit.org>
    218
  • trunk/Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp

    r87732 r87733  
    9494    }
    9595    context->setFillStyle(toHTMLCanvasStyle(exec, value));
    96 }
    97 
    98 JSValue JSCanvasRenderingContext2D::strokeRect(ExecState* exec)
    99 {
    100     CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl());
    101    
    102     if (exec->argumentCount() <= 4)
    103         context->strokeRect(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec),
    104                             exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec));
    105     else
    106         context->strokeRect(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec),
    107                             exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec), exec->argument(4).toFloat(exec));
    108 
    109     return jsUndefined();   
    11096}
    11197
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl

    r87732 r87733  
    113113        void setFillColor(in float c, in float m, in float y, in float k, in float a);
    114114
    115 #if defined(V8_BINDING) && V8_BINDING
    116115        void strokeRect(in float x, in float y, in float width, in float height, in [Optional] float lineWidth);
    117116
     117#if defined(V8_BINDING) && V8_BINDING
    118118        void drawImage(in HTMLImageElement image, in float x, in float y)
    119119            raises (DOMException);
     
    157157#else
    158158        // FIXME: Remove 'else' once JSC supports overloads too.
    159         [Custom] void strokeRect(/* 4 */);
    160159        [Custom] void drawImage(/* 3 */);
    161160        [Custom] void drawImageFromRect(/* 10 */);
Note: See TracChangeset for help on using the changeset viewer.