Title: [92152] trunk
Revision
92152
Author
timothy_hor...@apple.com
Date
2011-08-01 16:49:54 -0700 (Mon, 01 Aug 2011)

Log Message

Severe shadow repaint issues with SVGText elements
https://bugs.webkit.org/show_bug.cgi?id=63648
<rdar://problem/7632269>

Reviewed by Darin Adler.

Make SVG elements which inherit from RenderSVGBlock take text-shadow
overflow into account when determining whether or not they should draw

Test: svg/custom/repaint-shadow.svg

* rendering/RenderBox.h:
(WebCore::RenderBox::visualOverflowRect):
* rendering/svg/RenderSVGBlock.cpp:
(WebCore::RenderSVGBlock::visualOverflowRect):
* rendering/svg/RenderSVGBlock.h:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (92151 => 92152)


--- trunk/LayoutTests/ChangeLog	2011-08-01 23:25:59 UTC (rev 92151)
+++ trunk/LayoutTests/ChangeLog	2011-08-01 23:49:54 UTC (rev 92152)
@@ -1,3 +1,18 @@
+2011-08-01  Tim Horton  <timothy_hor...@apple.com>
+
+        Severe shadow repaint issues with SVGText elements
+        https://bugs.webkit.org/show_bug.cgi?id=63648
+        <rdar://problem/7632269>
+
+        Reviewed by Darin Adler.
+
+        Make SVG elements which inherit from RenderSVGBlock take text-shadow
+        overflow into account when determining whether or not they should draw
+
+        * platform/mac/svg/custom/repaint-shadow-expected.png: Added.
+        * platform/mac/svg/custom/repaint-shadow-expected.txt: Added.
+        * svg/custom/repaint-shadow.svg: Added.
+
 2011-08-01  Chris Rogers  <crog...@google.com>
 
         One more test_expectations.txt fix for windows web audio

Added: trunk/LayoutTests/platform/mac/svg/custom/repaint-shadow-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/svg/custom/repaint-shadow-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/svg/custom/repaint-shadow-expected.txt (0 => 92152)


--- trunk/LayoutTests/platform/mac/svg/custom/repaint-shadow-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/svg/custom/repaint-shadow-expected.txt	2011-08-01 23:49:54 UTC (rev 92152)
@@ -0,0 +1,10 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderSVGRoot {svg} at (20,20) size 406x255
+    RenderSVGText {text} at (20,20) size 50x50 contains 1 chunk(s)
+      RenderSVGInlineText {#text} at (0,0) size 50x50
+        chunk 1 text run 1 at (20.00,60.00) startOffset 0 endOffset 1 width 50.00: "X"
+    RenderSVGText {text} at (171,20) size 50x50 contains 1 chunk(s)
+      RenderSVGInlineText {#text} at (0,0) size 50x50
+        chunk 1 text run 1 at (171.00,60.00) startOffset 0 endOffset 1 width 50.00: "X"

Added: trunk/LayoutTests/svg/custom/repaint-shadow.svg (0 => 92152)


--- trunk/LayoutTests/svg/custom/repaint-shadow.svg	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/repaint-shadow.svg	2011-08-01 23:49:54 UTC (rev 92152)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewbox="0 0 480 360">
+    <text x="20" y="60" font-family="Ahem" font-size="50px" style="text-shadow: 200px 200px 5px red">X</text>
+    <text x="170" y="60" font-family="Ahem" font-size="50px" style="text-shadow: 200px 200px 5px red">X</text>
+
+    <script>
+        var text = document.getElementsByTagName('text')[1];
+
+        window.setTimeout(function() {
+            // Show differences, makes it easier to spot the repaint rect changes
+            if (window.layoutTestController)
+                layoutTestController.display();
+
+            text.setAttribute("x", 171);
+
+            if (window.layoutTestController)
+                layoutTestController.notifyDone();
+        }, 0);
+
+        if (window.layoutTestController)
+            layoutTestController.waitUntilDone();
+
+    </script>
+</svg>

Modified: trunk/Source/WebCore/ChangeLog (92151 => 92152)


--- trunk/Source/WebCore/ChangeLog	2011-08-01 23:25:59 UTC (rev 92151)
+++ trunk/Source/WebCore/ChangeLog	2011-08-01 23:49:54 UTC (rev 92152)
@@ -1,3 +1,22 @@
+2011-08-01  Tim Horton  <timothy_hor...@apple.com>
+
+        Severe shadow repaint issues with SVGText elements
+        https://bugs.webkit.org/show_bug.cgi?id=63648
+        <rdar://problem/7632269>
+
+        Reviewed by Darin Adler.
+
+        Make SVG elements which inherit from RenderSVGBlock take text-shadow
+        overflow into account when determining whether or not they should draw
+
+        Test: svg/custom/repaint-shadow.svg
+
+        * rendering/RenderBox.h:
+        (WebCore::RenderBox::visualOverflowRect):
+        * rendering/svg/RenderSVGBlock.cpp:
+        (WebCore::RenderSVGBlock::visualOverflowRect):
+        * rendering/svg/RenderSVGBlock.h:
+
 2011-08-01  Zhenyao Mo  <z...@google.com>
 
         Unreviewed, rolling out r92022.

Modified: trunk/Source/WebCore/rendering/RenderBox.h (92151 => 92152)


--- trunk/Source/WebCore/rendering/RenderBox.h	2011-08-01 23:25:59 UTC (rev 92151)
+++ trunk/Source/WebCore/rendering/RenderBox.h	2011-08-01 23:49:54 UTC (rev 92152)
@@ -148,7 +148,7 @@
     LayoutUnit logicalLeftLayoutOverflow() const { return style()->isHorizontalWritingMode() ? minXLayoutOverflow() : minYLayoutOverflow(); }
     LayoutUnit logicalRightLayoutOverflow() const { return style()->isHorizontalWritingMode() ? maxXLayoutOverflow() : maxYLayoutOverflow(); }
     
-    LayoutRect visualOverflowRect() const { return m_overflow ? m_overflow->visualOverflowRect() : borderBoxRect(); }
+    virtual LayoutRect visualOverflowRect() const { return m_overflow ? m_overflow->visualOverflowRect() : borderBoxRect(); }
     LayoutUnit minYVisualOverflow() const { return m_overflow? m_overflow->minYVisualOverflow() : 0; }
     LayoutUnit maxYVisualOverflow() const { return m_overflow ? m_overflow->maxYVisualOverflow() : height(); }
     LayoutUnit minXVisualOverflow() const { return m_overflow ? m_overflow->minXVisualOverflow() : 0; }

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGBlock.cpp (92151 => 92152)


--- trunk/Source/WebCore/rendering/svg/RenderSVGBlock.cpp	2011-08-01 23:25:59 UTC (rev 92151)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGBlock.cpp	2011-08-01 23:49:54 UTC (rev 92152)
@@ -34,6 +34,16 @@
 {
 }
 
+IntRect RenderSVGBlock::visualOverflowRect() const
+{
+    LayoutRect borderRect = borderBoxRect();
+
+    if (const ShadowData* textShadow = style()->textShadow())
+        textShadow->adjustRectForShadow(borderRect);
+
+    return borderRect;
+}
+
 void RenderSVGBlock::setStyle(PassRefPtr<RenderStyle> style) 
 {
     RefPtr<RenderStyle> useStyle = style;

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGBlock.h (92151 => 92152)


--- trunk/Source/WebCore/rendering/svg/RenderSVGBlock.h	2011-08-01 23:25:59 UTC (rev 92151)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGBlock.h	2011-08-01 23:49:54 UTC (rev 92152)
@@ -32,6 +32,8 @@
 public:
     explicit RenderSVGBlock(SVGElement*);
 
+    virtual IntRect visualOverflowRect() const;
+
 private:
     virtual void setStyle(PassRefPtr<RenderStyle>);
     virtual void updateBoxModelInfoFromStyle();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to