2010-07-12 François Sausset <sausset@gmail.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Jul 2010 12:31:36 +0000 (12:31 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Jul 2010 12:31:36 +0000 (12:31 +0000)
        Reviewed by Kenneth Rohde Christiansen.

        Update tests to check that msqrt and mfrac use style color to draw themselves
        https://bugs.webkit.org/show_bug.cgi?id=41889

        * mathml/presentation/fractions.xhtml:
        * mathml/presentation/roots.xhtml:
        * platform/mac/mathml/presentation/fractions-expected.checksum:
        * platform/mac/mathml/presentation/fractions-expected.png:
        * platform/mac/mathml/presentation/fractions-expected.txt:
        * platform/mac/mathml/presentation/roots-expected.checksum:
        * platform/mac/mathml/presentation/roots-expected.png:
        * platform/mac/mathml/presentation/roots-expected.txt:
2010-07-12  François Sausset  <sausset@gmail.com>

        Reviewed by Kenneth Rohde Christiansen.

        Fix a bug preventing msqrt and mfrac to use style color to draw themselves.
        In mfrac, the fraction bar is now using the color defined by the element style instead of black.
        In msqrt, the radical was always drawn in black due to a colorSpace problem.
        https://bugs.webkit.org/show_bug.cgi?id=41889

        Test: mathml/presentation/roots.xhtml
        Test: mathml/presentation/fractions.xhtml

        * mathml/RenderMathMLFraction.cpp:
        (WebCore::RenderMathMLFraction::paint):
        * mathml/RenderMathMLSquareRoot.cpp:
        (WebCore::RenderMathMLSquareRoot::paint):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@63074 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
LayoutTests/ChangeLog
LayoutTests/mathml/presentation/fractions.xhtml
LayoutTests/mathml/presentation/roots.xhtml
LayoutTests/platform/mac/mathml/presentation/fractions-expected.checksum
LayoutTests/platform/mac/mathml/presentation/fractions-expected.png
LayoutTests/platform/mac/mathml/presentation/fractions-expected.txt
LayoutTests/platform/mac/mathml/presentation/roots-expected.checksum
LayoutTests/platform/mac/mathml/presentation/roots-expected.png
LayoutTests/platform/mac/mathml/presentation/roots-expected.txt
WebCore/ChangeLog
WebCore/mathml/RenderMathMLFraction.cpp
WebCore/mathml/RenderMathMLSquareRoot.cpp

index 1dc13e0..a206295 100644 (file)
@@ -1,3 +1,19 @@
+2010-07-12  François Sausset  <sausset@gmail.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Update tests to check that msqrt and mfrac use style color to draw themselves
+        https://bugs.webkit.org/show_bug.cgi?id=41889
+
+        * mathml/presentation/fractions.xhtml:
+        * mathml/presentation/roots.xhtml:
+        * platform/mac/mathml/presentation/fractions-expected.checksum:
+        * platform/mac/mathml/presentation/fractions-expected.png:
+        * platform/mac/mathml/presentation/fractions-expected.txt:
+        * platform/mac/mathml/presentation/roots-expected.checksum:
+        * platform/mac/mathml/presentation/roots-expected.png:
+        * platform/mac/mathml/presentation/roots-expected.txt:
+
 2010-07-12  Andreas Kling  <andreas.kling@nokia.com>
 
         Reviewed by Antti Koivisto.
index d25997a..7b5729b 100644 (file)
@@ -4,9 +4,9 @@
 </head>
 <body>
 <p id='t1'>simple: <math xmlns='http://www.w3.org/1998/Math/MathML'><mfrac><mn>1</mn>bad<mn>2</mn></mfrac></math></p>
-<p id='t2'>more complex: 
+<p id='t2'>more complex (should be red)
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
-<mfrac>
+<mfrac style="color: red;">
 <mrow><mi>x</mi><mo>+</mo>bad<mn>1</mn></mrow>
 <mrow><mi>x</mi><mo>+</mo><mn>2</mn></mrow>
 </mfrac>
index 09a5a45..fa16584 100644 (file)
@@ -5,9 +5,9 @@
 </style>
 </head>
 <body>
-<p id='t1'>square root: 
+<p id='t1'>square root (should be red)
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
-<msqrt><mn>2</mn></msqrt>
+<msqrt style="color: red;"><mn>2</mn></msqrt>
 </math></p>
 <p id='t2'>long square root: 
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
index a67c5e5..c1a49fb 100644 (file)
Binary files a/LayoutTests/platform/mac/mathml/presentation/fractions-expected.png and b/LayoutTests/platform/mac/mathml/presentation/fractions-expected.png differ
index d7f40e4..bf3e8c9 100644 (file)
@@ -17,10 +17,10 @@ layer at (0,0) size 800x338
                 RenderText {#text} at (3,2) size 8x16
                   text run at (3,2) width 8: "2"
       RenderBlock {p} at (0,50) size 784x40
-        RenderText {#text} at (0,10) size 98x18
-          text run at (0,10) width 98: "more complex: "
-        RenderBlock {math} at (98,0) size 34x40
-          RenderBlock {mfrac} at (1,0) size 32x40
+        RenderText {#text} at (0,10) size 197x18
+          text run at (0,10) width 197: "more complex (should be red): "
+        RenderBlock {math} at (197,0) size 34x40
+          RenderBlock {mfrac} at (1,0) size 32x40 [color=#FF0000]
             RenderBlock {mfrac} at (0,0) size 32x19
               RenderBlock {mrow} at (3,0) size 26x19
                 RenderInline {mi} at (0,0) size 7x16
index 1ea4c95..6d296ad 100644 (file)
Binary files a/LayoutTests/platform/mac/mathml/presentation/roots-expected.png and b/LayoutTests/platform/mac/mathml/presentation/roots-expected.png differ
index a7291e9..b33bff3 100644 (file)
@@ -4,10 +4,10 @@ layer at (0,0) size 800x594
   RenderBlock {html} at (0,0) size 800x594
     RenderBody {body} at (8,16) size 784x562
       RenderBlock {p} at (0,0) size 784x19
-        RenderText {#text} at (0,0) size 78x18
-          text run at (0,0) width 78: "square root: "
-        RenderBlock {math} at (78,0) size 22x19
-          RenderBlock {msqrt} at (1,0) size 20x19
+        RenderText {#text} at (0,0) size 177x18
+          text run at (0,0) width 177: "square root (should be red): "
+        RenderBlock {math} at (177,0) size 22x19
+          RenderBlock {msqrt} at (1,0) size 20x19 [color=#FF0000]
             RenderInline {mn} at (0,0) size 8x16
               RenderText {#text} at (12,3) size 8x16
                 text run at (12,3) width 8: "2"
index 027d7be..d8685ff 100644 (file)
@@ -1,3 +1,20 @@
+2010-07-12  François Sausset  <sausset@gmail.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Fix a bug preventing msqrt and mfrac to use style color to draw themselves.
+        In mfrac, the fraction bar is now using the color defined by the element style instead of black.
+        In msqrt, the radical was always drawn in black due to a colorSpace problem.
+        https://bugs.webkit.org/show_bug.cgi?id=41889
+
+        Test: mathml/presentation/roots.xhtml
+        Test: mathml/presentation/fractions.xhtml
+
+        * mathml/RenderMathMLFraction.cpp:
+        (WebCore::RenderMathMLFraction::paint):
+        * mathml/RenderMathMLSquareRoot.cpp:
+        (WebCore::RenderMathMLSquareRoot::paint):
+
 2010-07-12  Andreas Kling  <andreas.kling@nokia.com>
 
         Reviewed by Antti Koivisto.
index 811c230..cd0681d 100644 (file)
@@ -168,7 +168,7 @@ void RenderMathMLFraction::paint(PaintInfo& info, int tx, int ty)
     
     info.context->setStrokeThickness(static_cast<float>(m_lineThickness));
     info.context->setStrokeStyle(SolidStroke);
-    info.context->setStrokeColor(Color(0, 0, 0), sRGBColorSpace);
+    info.context->setStrokeColor(style()->visitedDependentColor(CSSPropertyColor), sRGBColorSpace);
     
     info.context->drawLine(IntPoint(tx, ty), IntPoint(tx + offsetWidth(), ty));
     
index 6802176..be62f57 100644 (file)
@@ -117,7 +117,7 @@ void RenderMathMLSquareRoot::paint(PaintInfo& info, int tx, int ty)
     
     info.context->setStrokeThickness(gRadicalLineThickness * style()->fontSize());
     info.context->setStrokeStyle(SolidStroke);
-    info.context->setStrokeColor(style()->visitedDependentColor(CSSPropertyColor), sRGBColorSpace);
+    info.context->setStrokeColor(style()->visitedDependentColor(CSSPropertyColor), DeviceColorSpace);
     info.context->setLineJoin(MiterJoin);
     info.context->setMiterLimit(style()->fontSize());