- Revision
- 107862
- Author
- [email protected]
- Date
- 2012-02-15 17:50:51 -0800 (Wed, 15 Feb 2012)
Log Message
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.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (107861 => 107862)
--- trunk/LayoutTests/ChangeLog 2012-02-16 01:35:00 UTC (rev 107861)
+++ trunk/LayoutTests/ChangeLog 2012-02-16 01:50:51 UTC (rev 107862)
@@ -1,3 +1,18 @@
+2012-02-15 Tim Horton <[email protected]>
+
+ REGRESSION(r105057): Dynamically changing <tspan> offsets is broken
+ https://bugs.webkit.org/show_bug.cgi?id=78385
+ <rdar://problem/10832932>
+
+ Reviewed by Simon Fraser.
+
+ 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.
+
2012-02-15 Nate Chapin <[email protected]>
Remove Skipped tests that were broken by r107672.
Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (107861 => 107862)
--- trunk/LayoutTests/platform/chromium/test_expectations.txt 2012-02-16 01:35:00 UTC (rev 107861)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt 2012-02-16 01:50:51 UTC (rev 107862)
@@ -156,6 +156,9 @@
BUGNOEL : tables/mozilla_expected_failures/bugs/bug85016.html = IMAGE
BUGNOEL : tables/mozilla_expected_failures/other/test4.html = IMAGE
+// New test, needs baselines.
+
+
// -----------------------------------------------------------------
// WONTFIX TESTS
// -----------------------------------------------------------------
@@ -2362,6 +2365,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.
///////////////////////////////////////////////////////////////////////////
Added: trunk/LayoutTests/platform/mac/svg/text/tspan-dynamic-positioning-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/svg/text/tspan-dynamic-positioning-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/platform/mac/svg/text/tspan-dynamic-positioning-expected.txt (0 => 107862)
--- trunk/LayoutTests/platform/mac/svg/text/tspan-dynamic-positioning-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac/svg/text/tspan-dynamic-positioning-expected.txt 2012-02-16 01:50:51 UTC (rev 107862)
@@ -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"
Added: trunk/LayoutTests/svg/text/tspan-dynamic-positioning.svg (0 => 107862)
--- trunk/LayoutTests/svg/text/tspan-dynamic-positioning.svg (rev 0)
+++ trunk/LayoutTests/svg/text/tspan-dynamic-positioning.svg 2012-02-16 01:50:51 UTC (rev 107862)
@@ -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: trunk/Source/WebCore/ChangeLog (107861 => 107862)
--- trunk/Source/WebCore/ChangeLog 2012-02-16 01:35:00 UTC (rev 107861)
+++ trunk/Source/WebCore/ChangeLog 2012-02-16 01:50:51 UTC (rev 107862)
@@ -1,3 +1,20 @@
+2012-02-15 Tim Horton <[email protected]>
+
+ 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):
+
2012-02-15 Tommy Widenflycht <[email protected]>
MediaStream API: Removing SecurityContext from the embedder API
Modified: trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp (107861 => 107862)
--- trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp 2012-02-16 01:35:00 UTC (rev 107861)
+++ trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp 2012-02-16 01:50:51 UTC (rev 107862)
@@ -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)