Title: [90200] trunk
Revision
90200
Author
[email protected]
Date
2011-06-30 20:28:38 -0700 (Thu, 30 Jun 2011)

Log Message

2011-06-30  Kenichi Ishibashi  <[email protected]>

        Reviewed by Simon Fraser.

        [Chromium] -webkit-text-stroke doesn't affect with non-zero width border property
        https://bugs.webkit.org/show_bug.cgi?id=63698

        Added a test which ensures text stroke is rendered with non-zero width border.

        * platform/chromium-linux/platform/chromium/fast/text/text-stroke-with-border-expected.png: Added.
        * platform/chromium-linux/platform/chromium/fast/text/text-stroke-with-border-expected.txt: Added.
        * platform/chromium-mac/platform/chromium/fast/text/text-stroke-with-border-expected.png: Added.
        * platform/chromium-mac/platform/chromium/fast/text/text-stroke-with-border-expected.txt: Added.
        * platform/chromium-win/platform/chromium/fast/text/text-stroke-with-border-expected.png: Added.
        * platform/chromium-win/platform/chromium/fast/text/text-stroke-with-border-expected.txt: Added.
        * platform/chromium/fast/text/text-stroke-with-border.html: Added.
2011-06-30  Kenichi Ishibashi  <[email protected]>

        Reviewed by Simon Fraser.

        [Chromium] -webkit-text-stroke doesn't affect with non-zero width border property
        https://bugs.webkit.org/show_bug.cgi?id=63698

        Restore the stroke style when it is modified in RenderObject::drawLineForBoxSide() to show text stroke correctly.

        Test: platform/chromium/fast/text/text-stroke-with-border.html

        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::drawLineForBoxSide): Save/restore the stroke style.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (90199 => 90200)


--- trunk/LayoutTests/ChangeLog	2011-07-01 03:06:48 UTC (rev 90199)
+++ trunk/LayoutTests/ChangeLog	2011-07-01 03:28:38 UTC (rev 90200)
@@ -1,3 +1,20 @@
+2011-06-30  Kenichi Ishibashi  <[email protected]>
+
+        Reviewed by Simon Fraser.
+
+        [Chromium] -webkit-text-stroke doesn't affect with non-zero width border property
+        https://bugs.webkit.org/show_bug.cgi?id=63698
+
+        Added a test which ensures text stroke is rendered with non-zero width border.
+
+        * platform/chromium-linux/platform/chromium/fast/text/text-stroke-with-border-expected.png: Added.
+        * platform/chromium-linux/platform/chromium/fast/text/text-stroke-with-border-expected.txt: Added.
+        * platform/chromium-mac/platform/chromium/fast/text/text-stroke-with-border-expected.png: Added.
+        * platform/chromium-mac/platform/chromium/fast/text/text-stroke-with-border-expected.txt: Added.
+        * platform/chromium-win/platform/chromium/fast/text/text-stroke-with-border-expected.png: Added.
+        * platform/chromium-win/platform/chromium/fast/text/text-stroke-with-border-expected.txt: Added.
+        * platform/chromium/fast/text/text-stroke-with-border.html: Added.
+
 2011-06-30  Andrew Scherkus  <[email protected]>
 
         Unreviewed.

Added: trunk/LayoutTests/platform/chromium/fast/text/text-stroke-with-border.html (0 => 90200)


--- trunk/LayoutTests/platform/chromium/fast/text/text-stroke-with-border.html	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/fast/text/text-stroke-with-border.html	2011-07-01 03:28:38 UTC (rev 90200)
@@ -0,0 +1,3 @@
+<div style="-webkit-text-stroke: 1px red; border: 1px dashed;">
+This text should have a red 1px red stroke.
+</div>
Property changes on: trunk/LayoutTests/platform/chromium/fast/text/text-stroke-with-border.html
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/platform/chromium-linux/platform/chromium/fast/text/text-stroke-with-border-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/chromium-linux/platform/chromium/fast/text/text-stroke-with-border-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/chromium-linux/platform/chromium/fast/text/text-stroke-with-border-expected.txt (0 => 90200)


--- trunk/LayoutTests/platform/chromium-linux/platform/chromium/fast/text/text-stroke-with-border-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-linux/platform/chromium/fast/text/text-stroke-with-border-expected.txt	2011-07-01 03:28:38 UTC (rev 90200)
@@ -0,0 +1,8 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {DIV} at (0,0) size 784x22 [textStrokeColor=#FF0000] [textStrokeWidth=1.00] [border: (1px dashed #000000)]
+        RenderText {#text} at (1,1) size 258x19
+          text run at (1,1) width 258: "This text should have a red 1px red stroke."
Property changes on: trunk/LayoutTests/platform/chromium-linux/platform/chromium/fast/text/text-stroke-with-border-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/platform/chromium-mac/platform/chromium/fast/text/text-stroke-with-border-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/chromium-mac/platform/chromium/fast/text/text-stroke-with-border-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/chromium-mac/platform/chromium/fast/text/text-stroke-with-border-expected.txt (0 => 90200)


--- trunk/LayoutTests/platform/chromium-mac/platform/chromium/fast/text/text-stroke-with-border-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-mac/platform/chromium/fast/text/text-stroke-with-border-expected.txt	2011-07-01 03:28:38 UTC (rev 90200)
@@ -0,0 +1,8 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {DIV} at (0,0) size 784x20 [textStrokeColor=#FF0000] [textStrokeWidth=1.00] [border: (1px dashed #000000)]
+        RenderText {#text} at (1,1) size 268x18
+          text run at (1,1) width 268: "This text should have a red 1px red stroke."
Property changes on: trunk/LayoutTests/platform/chromium-mac/platform/chromium/fast/text/text-stroke-with-border-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/platform/chromium-win/platform/chromium/fast/text/text-stroke-with-border-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/chromium-win/platform/chromium/fast/text/text-stroke-with-border-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/chromium-win/platform/chromium/fast/text/text-stroke-with-border-expected.txt (0 => 90200)


--- trunk/LayoutTests/platform/chromium-win/platform/chromium/fast/text/text-stroke-with-border-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-win/platform/chromium/fast/text/text-stroke-with-border-expected.txt	2011-07-01 03:28:38 UTC (rev 90200)
@@ -0,0 +1,8 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {DIV} at (0,0) size 784x22 [textStrokeColor=#FF0000] [textStrokeWidth=1.00] [border: (1px dashed #000000)]
+        RenderText {#text} at (1,1) size 258x19
+          text run at (1,1) width 258: "This text should have a red 1px red stroke."
Property changes on: trunk/LayoutTests/platform/chromium-win/platform/chromium/fast/text/text-stroke-with-border-expected.txt
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (90199 => 90200)


--- trunk/Source/WebCore/ChangeLog	2011-07-01 03:06:48 UTC (rev 90199)
+++ trunk/Source/WebCore/ChangeLog	2011-07-01 03:28:38 UTC (rev 90200)
@@ -1,3 +1,17 @@
+2011-06-30  Kenichi Ishibashi  <[email protected]>
+
+        Reviewed by Simon Fraser.
+
+        [Chromium] -webkit-text-stroke doesn't affect with non-zero width border property
+        https://bugs.webkit.org/show_bug.cgi?id=63698
+
+        Restore the stroke style when it is modified in RenderObject::drawLineForBoxSide() to show text stroke correctly.
+
+        Test: platform/chromium/fast/text/text-stroke-with-border.html
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::drawLineForBoxSide): Save/restore the stroke style.
+
 2011-06-30  Gwang Yoon Hwang  <[email protected]>
 
         Reviewed by Nate Chapin.

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (90199 => 90200)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2011-07-01 03:06:48 UTC (rev 90199)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2011-07-01 03:28:38 UTC (rev 90200)
@@ -710,9 +710,10 @@
         case BHIDDEN:
             return;
         case DOTTED:
-        case DASHED:
+        case DASHED: {
             graphicsContext->setStrokeColor(color, m_style->colorSpace());
             graphicsContext->setStrokeThickness(width);
+            StrokeStyle oldStrokeStyle = graphicsContext->strokeStyle();
             graphicsContext->setStrokeStyle(style == DASHED ? DashedStroke : DottedStroke);
 
             if (width > 0) {
@@ -730,12 +731,15 @@
                         break;
                 }
                 graphicsContext->setShouldAntialias(wasAntialiased);
+                graphicsContext->setStrokeStyle(oldStrokeStyle);
             }
             break;
+        }
         case DOUBLE: {
             int third = (width + 1) / 3;
 
             if (adjacentWidth1 == 0 && adjacentWidth2 == 0) {
+                StrokeStyle oldStrokeStyle = graphicsContext->strokeStyle();
                 graphicsContext->setStrokeStyle(NoStroke);
                 graphicsContext->setFillColor(color, m_style->colorSpace());
                 
@@ -759,6 +763,7 @@
                 }
 
                 graphicsContext->setShouldAntialias(wasAntialiased);
+                graphicsContext->setStrokeStyle(oldStrokeStyle);
             } else {
                 int adjacent1BigThird = ((adjacentWidth1 > 0) ? adjacentWidth1 + 1 : adjacentWidth1 - 1) / 3;
                 int adjacent2BigThird = ((adjacentWidth2 > 0) ? adjacentWidth2 + 1 : adjacentWidth2 - 1) / 3;
@@ -856,6 +861,7 @@
                 color = color.dark();
             // fall through
         case SOLID: {
+            StrokeStyle oldStrokeStyle = graphicsContext->strokeStyle();
             graphicsContext->setStrokeStyle(NoStroke);
             graphicsContext->setFillColor(color, m_style->colorSpace());
             ASSERT(x2 >= x1);
@@ -867,6 +873,7 @@
                 graphicsContext->setShouldAntialias(antialias);
                 graphicsContext->drawRect(IntRect(x1, y1, x2 - x1, y2 - y1));
                 graphicsContext->setShouldAntialias(wasAntialiased);
+                graphicsContext->setStrokeStyle(oldStrokeStyle);
                 return;
             }
             FloatPoint quad[4];
@@ -898,6 +905,7 @@
             }
 
             graphicsContext->drawConvexPolygon(4, quad, antialias);
+            graphicsContext->setStrokeStyle(oldStrokeStyle);
             break;
         }
     }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to