http://shinydemos.com/clock/ doesn't seem to work
authorfmalita@chromium.org <fmalita@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Jun 2012 16:03:33 +0000 (16:03 +0000)
committerfmalita@chromium.org <fmalita@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Jun 2012 16:03:33 +0000 (16:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=79682

Reviewed by Nikolas Zimmermann.

Source/WebCore:

Test: svg/repaint/text-mask-update.svg

Currently, parent resources are not invalidated when SVGInlineText nodes
are added or removed. Adjusting SVGResourcesCache::clientWasAddedToTree()
and SVGResourcesCache::clientWillBeRemovedFromTree() to cover this case.

* rendering/svg/SVGResourcesCache.cpp:
(WebCore::SVGResourcesCache::clientWasAddedToTree):
(WebCore::SVGResourcesCache::clientWillBeRemovedFromTree):

LayoutTests:

* platform/chromium-linux/svg/repaint/text-mask-update-expected.png: Added.
* platform/chromium-linux/svg/repaint/text-mask-update-expected.txt: Added.
* platform/chromium/test_expectations.txt:
* platform/mac/test_expectations.txt:
* svg/repaint/text-mask-update.svg: Added.

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

LayoutTests/ChangeLog
LayoutTests/platform/chromium-linux/svg/repaint/text-mask-update-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium-linux/svg/repaint/text-mask-update-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/test_expectations.txt
LayoutTests/platform/mac/test_expectations.txt
LayoutTests/svg/repaint/text-mask-update.svg [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/svg/SVGResourcesCache.cpp

index de4113e..453a1a0 100644 (file)
@@ -1,3 +1,16 @@
+2012-06-01  Florin Malita  <fmalita@chromium.org>
+
+        http://shinydemos.com/clock/ doesn't seem to work
+        https://bugs.webkit.org/show_bug.cgi?id=79682
+
+        Reviewed by Nikolas Zimmermann.
+
+        * platform/chromium-linux/svg/repaint/text-mask-update-expected.png: Added.
+        * platform/chromium-linux/svg/repaint/text-mask-update-expected.txt: Added.
+        * platform/chromium/test_expectations.txt:
+        * platform/mac/test_expectations.txt:
+        * svg/repaint/text-mask-update.svg: Added.
+
 2012-06-01  Christophe Dumez  <christophe.dumez@intel.com>
 
         [EFL] EFL's LayoutTestController needs to implement deliverWebIntent
diff --git a/LayoutTests/platform/chromium-linux/svg/repaint/text-mask-update-expected.png b/LayoutTests/platform/chromium-linux/svg/repaint/text-mask-update-expected.png
new file mode 100644 (file)
index 0000000..fc8e9af
Binary files /dev/null and b/LayoutTests/platform/chromium-linux/svg/repaint/text-mask-update-expected.png differ
diff --git a/LayoutTests/platform/chromium-linux/svg/repaint/text-mask-update-expected.txt b/LayoutTests/platform/chromium-linux/svg/repaint/text-mask-update-expected.txt
new file mode 100644 (file)
index 0000000..b909532
--- /dev/null
@@ -0,0 +1,15 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderSVGRoot {svg} at (10,3) size 47x22
+    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+      RenderSVGResourceMasker {mask} [id="mask1"] [maskUnits=objectBoundingBox] [maskContentUnits=userSpaceOnUse]
+        RenderSVGText {text} at (10,3) size 47x22 contains 1 chunk(s)
+          RenderSVGInlineText {#text} at (0,0) size 47x22
+            chunk 1 text run 1 at (10.00,20.00) startOffset 0 endOffset 4 width 47.00: "PASS"
+      RenderSVGResourceMasker {mask} [id="mask2"] [maskUnits=objectBoundingBox] [maskContentUnits=userSpaceOnUse]
+        RenderSVGText {text}
+    RenderSVGRect {rect} at (10,3) size 47x22 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=50.00]
+      [masker="mask1"] RenderSVGResourceMasker {mask} at (10,3) size 47x22
+    RenderSVGRect {rect} at (0,0) size 0x0 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=100.00] [height=50.00]
+      [masker="mask2"] RenderSVGResourceMasker {mask} at (0,0) size 0x0
index b6d5d76..e41d590 100644 (file)
@@ -1223,6 +1223,9 @@ BUGWK81217 : svg/custom/use-detach.svg = PASS FAIL
 BUGWK81217 : svg/carto.net/tabgroup.svg = PASS FAIL
 BUGWK81217 : svg/hixie/perf/003.xml = PASS FAIL
 
+// Needs rebaseline after https://bugs.webkit.org/show_bug.cgi?id=79682
+BUGWK79682 WIN MAC : svg/repaint/text-mask-update.svg = MISSING IMAGE+TEXT IMAGE TEXT PASS
+
 BUGWK81240 MAC : svg/text/bidi-reorder-value-lists.svg = PASS IMAGE+TEXT
 
 BUGWK81243 : svg/repaint/repainting-after-animation-element-removal.svg = PASS IMAGE
index f5b96aa..39bddb1 100644 (file)
@@ -203,6 +203,9 @@ BUGWK85404 : fast/loader/javascript-url-in-embed.html = TEXT PASS
 
 BUGWK85408 : svg/batik/text/longTextOnPath.svg = TEXT PASS
 
+// Needs rebaseline after https://bugs.webkit.org/show_bug.cgi?id=79682
+BUGWK79682 : svg/repaint/text-mask-update.svg = MISSING IMAGE+TEXT IMAGE TEXT PASS
+
 // IETC flexbox failures
 BUGWK85211 : ietestcenter/css3/flexbox/flexbox-align-stretch-001.htm = IMAGE
 BUGWK85212 : ietestcenter/css3/flexbox/flexbox-layout-002.htm = IMAGE
diff --git a/LayoutTests/svg/repaint/text-mask-update.svg b/LayoutTests/svg/repaint/text-mask-update.svg
new file mode 100644 (file)
index 0000000..1bdc7d3
--- /dev/null
@@ -0,0 +1,28 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest();">
+  <!--
+    Test for https://bugs.webkit.org/show_bug.cgi?id=79682.
+  -->
+  <script xlink:href="../../fast/repaint/resources/repaint.js" type="text/javascript"></script>
+  <defs>
+    <mask id="mask1">
+      <text id="text1" x="10" y="20" fill="#fff" font-size="20px"></text>
+    </mask>
+    <mask id="mask2">
+      <text id="text2" x="10" y="50" fill="#fff" font-size="20px">FAIL</text>
+    </mask>
+  </defs>
+
+  <!-- the updated mask should be "PASS" -->
+  <rect width="100" height="50" fill="green" mask="url(#mask1)"/>
+  <!-- the updated mask should be empty -->
+  <rect width="100" height="50" fill="red" mask="url(#mask2)"/>
+
+  <script>
+    function repaintTest() {
+      var txt = document.createTextNode('PASS');
+      document.getElementById('text1').appendChild(txt);
+      var node = document.getElementById('text2');
+      node.removeChild(node.firstChild);
+    }
+  </script>
+</svg>
index cc9c0ad..48256cb 100644 (file)
@@ -1,3 +1,20 @@
+2012-06-01  Florin Malita  <fmalita@chromium.org>
+
+        http://shinydemos.com/clock/ doesn't seem to work
+        https://bugs.webkit.org/show_bug.cgi?id=79682
+
+        Reviewed by Nikolas Zimmermann.
+
+        Test: svg/repaint/text-mask-update.svg
+
+        Currently, parent resources are not invalidated when SVGInlineText nodes
+        are added or removed. Adjusting SVGResourcesCache::clientWasAddedToTree()
+        and SVGResourcesCache::clientWillBeRemovedFromTree() to cover this case.
+
+        * rendering/svg/SVGResourcesCache.cpp:
+        (WebCore::SVGResourcesCache::clientWasAddedToTree):
+        (WebCore::SVGResourcesCache::clientWillBeRemovedFromTree):
+
 2012-06-01  John Mellor  <johnme@chromium.org>
 
         Don't set scroll position twice in HistoryController::restoreScrollPositionAndViewState
index 87531ed..297c07b 100644 (file)
@@ -154,6 +154,10 @@ static inline bool rendererCanHaveResources(RenderObject* renderer)
 
 void SVGResourcesCache::clientWasAddedToTree(RenderObject* renderer, const RenderStyle* newStyle)
 {
+    if (!renderer->node())
+        return;
+    RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer, false);
+
     if (!rendererCanHaveResources(renderer))
         return;
     SVGResourcesCache* cache = resourcesCacheFromRenderObject(renderer);
@@ -162,12 +166,14 @@ void SVGResourcesCache::clientWasAddedToTree(RenderObject* renderer, const Rende
 
 void SVGResourcesCache::clientWillBeRemovedFromTree(RenderObject* renderer)
 {
+    if (!renderer->node())
+        return;
+    RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer, false);
+
     if (!rendererCanHaveResources(renderer))
         return;
     SVGResourcesCache* cache = resourcesCacheFromRenderObject(renderer);
     cache->removeResourcesFromRenderObject(renderer);
-
-    RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer, false);
 }
 
 void SVGResourcesCache::clientDestroyed(RenderObject* renderer)