Title: [87933] trunk
Revision
87933
Author
[email protected]
Date
2011-06-02 11:27:27 -0700 (Thu, 02 Jun 2011)

Log Message

2011-06-02  Andreas Kling  <[email protected]>

        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  <[email protected]>

        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):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (87932 => 87933)


--- trunk/LayoutTests/ChangeLog	2011-06-02 18:08:02 UTC (rev 87932)
+++ trunk/LayoutTests/ChangeLog	2011-06-02 18:27:27 UTC (rev 87933)
@@ -1,3 +1,12 @@
+2011-06-02  Andreas Kling  <[email protected]>
+
+        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  Dimitri Glazkov  <[email protected]>
 
         Unreviewed, rolling out r87926.

Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (87932 => 87933)


--- trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-06-02 18:08:02 UTC (rev 87932)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-06-02 18:27:27 UTC (rev 87933)
@@ -2008,7 +2008,6 @@
 BUGWK39177 : canvas/philip/tests/2d.composite.uncovered.pattern.copy.html = TEXT
 BUGWK39177 : canvas/philip/tests/2d.composite.uncovered.pattern.destination-atop.html = TEXT
 BUGWK39177 : canvas/philip/tests/2d.composite.uncovered.pattern.destination-in.html = TEXT
-BUGWK39168 : canvas/philip/tests/2d.fillStyle.parse.system.html = TEXT
 BUGWK45991 : canvas/philip/tests/2d.pattern.image.undefined.html = TEXT
 BUGWK45991 : canvas/philip/tests/2d.text.draw.baseline.bottom.html = TEXT
 BUGWK45991 : canvas/philip/tests/2d.text.draw.baseline.hanging.html = TEXT

Modified: trunk/Source/WebCore/ChangeLog (87932 => 87933)


--- trunk/Source/WebCore/ChangeLog	2011-06-02 18:08:02 UTC (rev 87932)
+++ trunk/Source/WebCore/ChangeLog	2011-06-02 18:27:27 UTC (rev 87933)
@@ -1,3 +1,21 @@
+2011-06-02  Andreas Kling  <[email protected]>
+
+        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):
+
 2011-06-02  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r87920.

Modified: trunk/Source/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp (87932 => 87933)


--- trunk/Source/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp	2011-06-02 18:08:02 UTC (rev 87932)
+++ trunk/Source/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp	2011-06-02 18:27:27 UTC (rev 87933)
@@ -62,9 +62,6 @@
 
 static PassRefPtr<CanvasStyle> toCanvasStyle(v8::Handle<v8::Value> value)
 {
-    if (value->IsString())
-        return CanvasStyle::createFromString(toWebCoreString(value));
-
     if (V8CanvasGradient::HasInstance(value))
         return CanvasStyle::createFromGradient(V8CanvasGradient::toNative(v8::Handle<v8::Object>::Cast(value)));
 
@@ -83,7 +80,10 @@
 void V8CanvasRenderingContext2D::strokeStyleAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
 {
     CanvasRenderingContext2D* impl = V8CanvasRenderingContext2D::toNative(info.Holder());
-    impl->setStrokeStyle(toCanvasStyle(value));
+    if (value->IsString())
+        impl->setStrokeColor(toWebCoreString(value));
+    else
+        impl->setStrokeStyle(toCanvasStyle(value));
 }
 
 v8::Handle<v8::Value> V8CanvasRenderingContext2D::fillStyleAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
@@ -95,7 +95,10 @@
 void V8CanvasRenderingContext2D::fillStyleAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
 {
     CanvasRenderingContext2D* impl = V8CanvasRenderingContext2D::toNative(info.Holder());
-    impl->setFillStyle(toCanvasStyle(value));
+    if (value->IsString())
+        impl->setFillColor(toWebCoreString(value));
+    else
+        impl->setFillStyle(toCanvasStyle(value));
 }
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to