Changeset 87933 in webkit


Ignore:
Timestamp:
Jun 2, 2011 11:27:27 AM (13 years ago)
Author:
andreas.kling@nokia.com
Message:

2011-06-02 Andreas Kling <kling@webkit.org>

Reviewed by James Robinson.

Canvas/V8: Fix setting strokeStyle or fillStyle to a CSS system color.
https://bugs.webkit.org/show_bug.cgi?id=61944

  • platform/chromium/test_expectations.txt: Unskip canvas/philip/tests/2d.fillStyle.parse.system.html.

2011-06-02 Andreas Kling <kling@webkit.org>

Reviewed by James Robinson.

Canvas/V8: Fix setting strokeStyle or fillStyle to a CSS system color.
https://bugs.webkit.org/show_bug.cgi?id=61944

Call setFillColor/setStrokeColor (instead of setFillStyle/setStrokeStyle)
for string styles. This ensures that system color resolution is performed,
and matches what the JSC bindings do.

Test: canvas/philip/tests/2d.fillStyle.parse.system.html

  • bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp: (WebCore::toCanvasStyle): (WebCore::V8CanvasRenderingContext2D::strokeStyleAccessorSetter): (WebCore::V8CanvasRenderingContext2D::fillStyleAccessorSetter):
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r87931 r87933  
     12011-06-02  Andreas Kling  <kling@webkit.org>
     2
     3        Reviewed by James Robinson.
     4
     5        Canvas/V8: Fix setting strokeStyle or fillStyle to a CSS system color.
     6        https://bugs.webkit.org/show_bug.cgi?id=61944
     7
     8        * platform/chromium/test_expectations.txt: Unskip canvas/philip/tests/2d.fillStyle.parse.system.html.
     9
    1102011-06-02  Dimitri Glazkov  <dglazkov@chromium.org>
    211
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r87929 r87933  
    20092009BUGWK39177 : canvas/philip/tests/2d.composite.uncovered.pattern.destination-atop.html = TEXT
    20102010BUGWK39177 : canvas/philip/tests/2d.composite.uncovered.pattern.destination-in.html = TEXT
    2011 BUGWK39168 : canvas/philip/tests/2d.fillStyle.parse.system.html = TEXT
    20122011BUGWK45991 : canvas/philip/tests/2d.pattern.image.undefined.html = TEXT
    20132012BUGWK45991 : canvas/philip/tests/2d.text.draw.baseline.bottom.html = TEXT
  • trunk/Source/WebCore/ChangeLog

    r87932 r87933  
     12011-06-02  Andreas Kling  <kling@webkit.org>
     2
     3        Reviewed by James Robinson.
     4
     5        Canvas/V8: Fix setting strokeStyle or fillStyle to a CSS system color.
     6        https://bugs.webkit.org/show_bug.cgi?id=61944
     7
     8        Call setFillColor/setStrokeColor (instead of setFillStyle/setStrokeStyle)
     9        for string styles. This ensures that system color resolution is performed,
     10        and matches what the JSC bindings do.
     11
     12        Test: canvas/philip/tests/2d.fillStyle.parse.system.html
     13
     14        * bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp:
     15        (WebCore::toCanvasStyle):
     16        (WebCore::V8CanvasRenderingContext2D::strokeStyleAccessorSetter):
     17        (WebCore::V8CanvasRenderingContext2D::fillStyleAccessorSetter):
     18
    1192011-06-02  Sheriff Bot  <webkit.review.bot@gmail.com>
    220
  • trunk/Source/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp

    r65613 r87933  
    6363static PassRefPtr<CanvasStyle> toCanvasStyle(v8::Handle<v8::Value> value)
    6464{
    65     if (value->IsString())
    66         return CanvasStyle::createFromString(toWebCoreString(value));
    67 
    6865    if (V8CanvasGradient::HasInstance(value))
    6966        return CanvasStyle::createFromGradient(V8CanvasGradient::toNative(v8::Handle<v8::Object>::Cast(value)));
     
    8481{
    8582    CanvasRenderingContext2D* impl = V8CanvasRenderingContext2D::toNative(info.Holder());
    86     impl->setStrokeStyle(toCanvasStyle(value));
     83    if (value->IsString())
     84        impl->setStrokeColor(toWebCoreString(value));
     85    else
     86        impl->setStrokeStyle(toCanvasStyle(value));
    8787}
    8888
     
    9696{
    9797    CanvasRenderingContext2D* impl = V8CanvasRenderingContext2D::toNative(info.Holder());
    98     impl->setFillStyle(toCanvasStyle(value));
     98    if (value->IsString())
     99        impl->setFillColor(toWebCoreString(value));
     100    else
     101        impl->setFillStyle(toCanvasStyle(value));
    99102}
    100103
Note: See TracChangeset for help on using the changeset viewer.