2010-09-27 James Robinson <jamesr@chromium.org>
authorjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Sep 2010 23:38:13 +0000 (23:38 +0000)
committerjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Sep 2010 23:38:13 +0000 (23:38 +0000)
        Reviewed by Simon Fraser.

        Repaint test for dynamically changing an SVG element's style attribute
        https://bugs.webkit.org/show_bug.cgi?id=46499

        * fast/repaint/repaint-svg-after-style-change-expected.checksum: Added.
        * fast/repaint/repaint-svg-after-style-change-expected.png: Added.
        * fast/repaint/repaint-svg-after-style-change-expected.txt: Added.
        * fast/repaint/repaint-svg-after-style-change.html: Added.
2010-09-27  James Robinson  <jamesr@chromium.org>

        Reviewed by Simon Fraser.

        Revert r63307, it broke repainting dynamically changed SVG content
        https://bugs.webkit.org/show_bug.cgi?id=46499

        This patch reverts r63307 and adds a regression test for what broke.

        Test: fast/repaint/repaint-svg-after-style-change.html

        * rendering/RenderForeignObject.cpp:
        (WebCore::RenderForeignObject::layout):
        * rendering/RenderPath.cpp:
        (WebCore::RenderPath::layout):
        * rendering/RenderSVGContainer.cpp:
        (WebCore::RenderSVGContainer::layout):
        * rendering/RenderSVGImage.cpp:
        (WebCore::RenderSVGImage::layout):
        * rendering/RenderSVGRoot.cpp:
        (WebCore::RenderSVGRoot::layout):
        * rendering/RenderSVGText.cpp:
        (WebCore::RenderSVGText::layout):

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

12 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/repaint/repaint-svg-after-style-change-expected.checksum [new file with mode: 0644]
LayoutTests/fast/repaint/repaint-svg-after-style-change-expected.png [new file with mode: 0644]
LayoutTests/fast/repaint/repaint-svg-after-style-change-expected.txt [new file with mode: 0644]
LayoutTests/fast/repaint/repaint-svg-after-style-change.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderForeignObject.cpp
WebCore/rendering/RenderPath.cpp
WebCore/rendering/RenderSVGContainer.cpp
WebCore/rendering/RenderSVGImage.cpp
WebCore/rendering/RenderSVGRoot.cpp
WebCore/rendering/RenderSVGText.cpp

index 015e13c..4da2ac9 100644 (file)
@@ -1,3 +1,15 @@
+2010-09-27  James Robinson  <jamesr@chromium.org>
+
+        Reviewed by Simon Fraser.
+
+        Repaint test for dynamically changing an SVG element's style attribute
+        https://bugs.webkit.org/show_bug.cgi?id=46499
+
+        * fast/repaint/repaint-svg-after-style-change-expected.checksum: Added.
+        * fast/repaint/repaint-svg-after-style-change-expected.png: Added.
+        * fast/repaint/repaint-svg-after-style-change-expected.txt: Added.
+        * fast/repaint/repaint-svg-after-style-change.html: Added.
+
 2010-09-27  Martin Robinson  <mrobinson@igalia.com>
 
         Unskip a test that just needed a platform-specific baseline and add a baseline for it.
diff --git a/LayoutTests/fast/repaint/repaint-svg-after-style-change-expected.checksum b/LayoutTests/fast/repaint/repaint-svg-after-style-change-expected.checksum
new file mode 100644 (file)
index 0000000..69b7a22
--- /dev/null
@@ -0,0 +1 @@
+f7be8f474521ba628de605e9b4c40def
\ No newline at end of file
diff --git a/LayoutTests/fast/repaint/repaint-svg-after-style-change-expected.png b/LayoutTests/fast/repaint/repaint-svg-after-style-change-expected.png
new file mode 100644 (file)
index 0000000..76ae82e
Binary files /dev/null and b/LayoutTests/fast/repaint/repaint-svg-after-style-change-expected.png differ
diff --git a/LayoutTests/fast/repaint/repaint-svg-after-style-change-expected.txt b/LayoutTests/fast/repaint/repaint-svg-after-style-change-expected.txt
new file mode 100644 (file)
index 0000000..10e4487
--- /dev/null
@@ -0,0 +1,11 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x222
+  RenderBlock {HTML} at (0,0) size 800x222
+    RenderBody {BODY} at (8,8) size 784x206
+      RenderSVGRoot {svg} at (8,8) size 200x200
+        RenderSVGContainer {g} at (8,8) size 200x200
+          RenderPath {path} at (8,8) size 200x200 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00 L0.00,200.00 L200.00,200.00 L200.00,0.00 Z"]
+          RenderPath {path} at (8,8) size 200x200 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00 L0.00,200.00 L200.00,200.00 L200.00,0.00 Z"]
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/fast/repaint/repaint-svg-after-style-change.html b/LayoutTests/fast/repaint/repaint-svg-after-style-change.html
new file mode 100644 (file)
index 0000000..61fff0f
--- /dev/null
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>SVG failing to repaint</title>
+</head>
+<body>
+<svg width="201px" height="201px">
+    <g>
+        <path fill="red" fill-opacity="1" d="M 0 0 L 0 200 200 200 200 0 Z"></path>
+        <path id="blinker" fill="green" fill-opacity="1" d="M 00 00 L 00 200 200 200 200 00 Z" style=""></path>
+    </g>
+</svg>
+</div>
+
+<script type='text/javascript'>
+var blinker = document.getElementById('blinker');
+
+if (window.layoutTestController)
+    window.layoutTestController.waitUntilDone();
+
+window.setTimeout(function () {
+    blinker.style.display = 'none';
+    window.setTimeout(function () {
+        blinker.style.display = '';
+        if (window.layoutTestController)
+            window.layoutTestController.notifyDone();
+    }, 50);
+}, 50);
+
+
+
+</script>
+</body>
+</html>
+
index 28b7ea6..640a185 100644 (file)
@@ -1,3 +1,27 @@
+2010-09-27  James Robinson  <jamesr@chromium.org>
+
+        Reviewed by Simon Fraser.
+
+        Revert r63307, it broke repainting dynamically changed SVG content
+        https://bugs.webkit.org/show_bug.cgi?id=46499
+
+        This patch reverts r63307 and adds a regression test for what broke.
+
+        Test: fast/repaint/repaint-svg-after-style-change.html
+
+        * rendering/RenderForeignObject.cpp:
+        (WebCore::RenderForeignObject::layout):
+        * rendering/RenderPath.cpp:
+        (WebCore::RenderPath::layout):
+        * rendering/RenderSVGContainer.cpp:
+        (WebCore::RenderSVGContainer::layout):
+        * rendering/RenderSVGImage.cpp:
+        (WebCore::RenderSVGImage::layout):
+        * rendering/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::layout):
+        * rendering/RenderSVGText.cpp:
+        (WebCore::RenderSVGText::layout):
+
 2010-09-27  Vangelis Kokkevis  <vangelis@chromium.org>
 
         Reviewed by James Robinson.
index 47c0334..839e963 100644 (file)
@@ -99,7 +99,7 @@ void RenderForeignObject::layout()
     ASSERT(needsLayout());
     ASSERT(!view()->layoutStateEnabled()); // RenderSVGRoot disables layoutState for the SVG rendering tree.
 
-    LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
+    LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
     SVGForeignObjectElement* foreign = static_cast<SVGForeignObjectElement*>(node());
 
     bool updateCachedBoundariesInParents = false;
index 0f31df1..cbe1900 100644 (file)
@@ -98,7 +98,7 @@ bool RenderPath::strokeContains(const FloatPoint& point, bool requiresStroke)
 
 void RenderPath::layout()
 {
-    LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
+    LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && selfNeedsLayout());
     SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node());
 
     bool updateCachedBoundariesInParents = false;
index 8c99270..b5974ca 100644 (file)
@@ -53,7 +53,7 @@ void RenderSVGContainer::layout()
     // Allow RenderSVGViewportContainer to update its viewport.
     calcViewport();
 
-    LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
+    LayoutRepainter repainter(*this, checkForRepaintDuringLayout() || selfWillPaint());
 
     // Allow RenderSVGTransformableContainer to update its transform.
     bool updatedTransform = calculateLocalTransform();
index 0056fa3..a89a738 100644 (file)
@@ -62,7 +62,7 @@ void RenderSVGImage::layout()
 {
     ASSERT(needsLayout());
 
-    LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
+    LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
     SVGImageElement* image = static_cast<SVGImageElement*>(node());
 
     bool updateCachedBoundariesInParents = false;
index 9c52d8c..82b10d5 100644 (file)
@@ -112,7 +112,7 @@ void RenderSVGRoot::layout()
     view()->disableLayoutState();
 
     bool needsLayout = selfNeedsLayout();
-    LayoutRepainter repainter(*this, needsLayout && m_everHadLayout && checkForRepaintDuringLayout());
+    LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && needsLayout);
 
     IntSize oldSize(width(), height());
     computeLogicalWidth();
index 804bc98..92091af 100644 (file)
@@ -74,7 +74,7 @@ void RenderSVGText::mapLocalToContainer(RenderBoxModelObject* repaintContainer,
 void RenderSVGText::layout()
 {
     ASSERT(needsLayout());
-    LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
+    LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
 
     bool updateCachedBoundariesInParents = false;
     if (m_needsTransformUpdate) {