Title: [108519] branches/chromium/1025
Revision
108519
Author
[email protected]
Date
2012-02-22 10:38:12 -0800 (Wed, 22 Feb 2012)

Log Message

Merge 107862 - REGRESSION(r105057): Dynamically changing <tspan> offsets is broken
https://bugs.webkit.org/show_bug.cgi?id=78385
<rdar://problem/10832932>

Reviewed by Simon Fraser.

Don't short-circuit buildLayoutAttributesIfNeeded if m_textPositions is already full;
we can't skip rebuilding the layout attributes, just walking the tree to acquire the
positioning lists (invalidation of positioning lists is already covered by textDOMChanged).

Test: svg/text/tspan-dynamic-positioning.svg

* rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
(WebCore::SVGTextLayoutAttributesBuilder::buildLayoutAttributesIfNeeded):

Add a test ensuring that changing the offset of a <tspan> post-load results in correct layout.

* platform/chromium/test_expectations.txt:
* platform/mac/svg/text/tspan-dynamic-positioning-expected.png: Added.
* platform/mac/svg/text/tspan-dynamic-positioning-expected.txt: Added.
* svg/text/tspan-dynamic-positioning.svg: Added.



[email protected]
Review URL: https://chromiumcodereview.appspot.com/9429058

Modified Paths

Added Paths

Diff

Modified: branches/chromium/1025/LayoutTests/platform/chromium/test_expectations.txt (108518 => 108519)


--- branches/chromium/1025/LayoutTests/platform/chromium/test_expectations.txt	2012-02-22 18:35:46 UTC (rev 108518)
+++ branches/chromium/1025/LayoutTests/platform/chromium/test_expectations.txt	2012-02-22 18:38:12 UTC (rev 108519)
@@ -100,6 +100,9 @@
 // Unskip after changes on both sides have landed and rolled together.
 BUGCR103939 SKIP : http/tests/appcache/wrong-content-type.html = TEXT
 
+// New test, needs baselines.
+
+
 // -----------------------------------------------------------------
 // WONTFIX TESTS
 // -----------------------------------------------------------------
@@ -2384,6 +2387,9 @@
 BUG_YUTAK LINUX WIN : fast/images/imagemap-polygon-focus-ring.html = IMAGE+TEXT
 BUG_YUTAK LEOPARD : fast/images/imagemap-polygon-focus-ring.html = IMAGE
 
+// New test added from https://bugs.webkit.org/show_bug.cgi?id=78385, needs baselines.
+BUGWK78385 : svg/text/tspan-dynamic-positioning.svg = IMAGE+TEXT
+
 ///////////////////////////////////////////////////////////////////////////
 // Regressions caused by switching to DRT.
 ///////////////////////////////////////////////////////////////////////////

Copied: branches/chromium/1025/LayoutTests/platform/mac/svg/text/tspan-dynamic-positioning-expected.png (from rev 107862, trunk/LayoutTests/platform/mac/svg/text/tspan-dynamic-positioning-expected.png)


(Binary files differ)

Copied: branches/chromium/1025/LayoutTests/platform/mac/svg/text/tspan-dynamic-positioning-expected.txt (from rev 107862, trunk/LayoutTests/platform/mac/svg/text/tspan-dynamic-positioning-expected.txt) (0 => 108519)


--- branches/chromium/1025/LayoutTests/platform/mac/svg/text/tspan-dynamic-positioning-expected.txt	                        (rev 0)
+++ branches/chromium/1025/LayoutTests/platform/mac/svg/text/tspan-dynamic-positioning-expected.txt	2012-02-22 18:38:12 UTC (rev 108519)
@@ -0,0 +1,8 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 600x500
+  RenderSVGRoot {svg} at (200,186) size 251x18
+    RenderSVGText {text} at (200,186) size 251x18 contains 1 chunk(s)
+      RenderSVGTSpan {tspan} at (0,0) size 251x18
+        RenderSVGInlineText {#text} at (0,0) size 251x18
+          chunk 1 text run 1 at (200.00,200.00) startOffset 0 endOffset 41 width 251.00: "This text should be at visible at 200,200"

Copied: branches/chromium/1025/LayoutTests/svg/text/tspan-dynamic-positioning.svg (from rev 107862, trunk/LayoutTests/svg/text/tspan-dynamic-positioning.svg) (0 => 108519)


--- branches/chromium/1025/LayoutTests/svg/text/tspan-dynamic-positioning.svg	                        (rev 0)
+++ branches/chromium/1025/LayoutTests/svg/text/tspan-dynamic-positioning.svg	2012-02-22 18:38:12 UTC (rev 108519)
@@ -0,0 +1,12 @@
+<svg _onload_="runRepaintTest()" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="600" height="500">
+    <script xlink:href=""
+    <title>There should be a sentence of text visible at 200,200.</title>
+    <text y="100"><tspan id="ts" x="20" y="20">This text should be at visible at 200,200</tspan></text>
+    <script>
+        function repaintTest()
+        {
+            document.getElementById("ts").setAttribute("x", 200);
+            document.getElementById("ts").setAttribute("y", 200);
+        }
+    </script>
+</svg>

Modified: branches/chromium/1025/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp (108518 => 108519)


--- branches/chromium/1025/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp	2012-02-22 18:35:46 UTC (rev 108518)
+++ branches/chromium/1025/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp	2012-02-22 18:38:12 UTC (rev 108519)
@@ -79,12 +79,12 @@
 bool SVGTextLayoutAttributesBuilder::buildLayoutAttributesIfNeeded(RenderSVGText* textRoot)
 {
     ASSERT(textRoot);
-    if (!m_textPositions.isEmpty())
-        return m_textLength;
 
-    m_textLength = 0;
-    const UChar* lastCharacter = 0;
-    collectTextPositioningElements(textRoot, lastCharacter);
+    if (m_textPositions.isEmpty()) {
+        m_textLength = 0;
+        const UChar* lastCharacter = 0;
+        collectTextPositioningElements(textRoot, lastCharacter);
+    }
 
     m_characterDataMap.clear();
     if (!m_textLength)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to