Title: [90862] branches/chromium/782
- Revision
- 90862
- Author
- [email protected]
- Date
- 2011-07-12 15:30:53 -0700 (Tue, 12 Jul 2011)
Log Message
Merge 90166
BUG=87862
Review URL: http://codereview.chromium.org/7350005
Modified Paths
Added Paths
Diff
Copied: branches/chromium/782/LayoutTests/svg/custom/crash-textPath-attributes-expected.txt (from rev 90166, trunk/LayoutTests/svg/custom/crash-textPath-attributes-expected.txt) (0 => 90862)
--- branches/chromium/782/LayoutTests/svg/custom/crash-textPath-attributes-expected.txt (rev 0)
+++ branches/chromium/782/LayoutTests/svg/custom/crash-textPath-attributes-expected.txt 2011-07-12 22:30:53 UTC (rev 90862)
@@ -0,0 +1,4 @@
+
+Test for Update SVG position values on SVG DOM updates
+
+This test PASSES if he does not crash
Copied: branches/chromium/782/LayoutTests/svg/custom/crash-textPath-attributes.html (from rev 90166, trunk/LayoutTests/svg/custom/crash-textPath-attributes.html) (0 => 90862)
--- branches/chromium/782/LayoutTests/svg/custom/crash-textPath-attributes.html (rev 0)
+++ branches/chromium/782/LayoutTests/svg/custom/crash-textPath-attributes.html 2011-07-12 22:30:53 UTC (rev 90862)
@@ -0,0 +1,13 @@
+<iframe src="" _onload_="go(this)"></iframe>
+<script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ function go(oIframe) {
+ var oSelection = oIframe.contentWindow.getSelection();
+ oSelection.selectAllChildren(oIframe.contentDocument);
+ oSelection.deleteFromDocument();
+ }
+</script>
+<p>Test for <a href="" SVG position values on SVG DOM updates</a></p>
+<p>This test PASSES if he does not crash</p>
Copied: branches/chromium/782/LayoutTests/svg/custom/resources/crash-textPath-attributes-iframe.svg (from rev 90166, trunk/LayoutTests/svg/custom/resources/crash-textPath-attributes-iframe.svg) (0 => 90862)
--- branches/chromium/782/LayoutTests/svg/custom/resources/crash-textPath-attributes-iframe.svg (rev 0)
+++ branches/chromium/782/LayoutTests/svg/custom/resources/crash-textPath-attributes-iframe.svg 2011-07-12 22:30:53 UTC (rev 90862)
@@ -0,0 +1,3 @@
+<!DOCTYPE svg>
+<?xml-stylesheet href=""
+<svg xmlns="http://www.w3.org/2000/svg"><text>x<tspan> <tspan
Modified: branches/chromium/782/Source/WebCore/rendering/svg/RenderSVGInline.cpp (90861 => 90862)
--- branches/chromium/782/Source/WebCore/rendering/svg/RenderSVGInline.cpp 2011-07-12 22:29:39 UTC (rev 90861)
+++ branches/chromium/782/Source/WebCore/rendering/svg/RenderSVGInline.cpp 2011-07-12 22:30:53 UTC (rev 90862)
@@ -95,6 +95,9 @@
void RenderSVGInline::destroy()
{
+ if (RenderSVGText* textRenderer = RenderSVGText::locateRenderSVGTextAncestor(this))
+ textRenderer->setNeedsPositioningValuesUpdate();
+
SVGResourcesCache::clientDestroyed(this);
RenderInline::destroy();
}
Modified: branches/chromium/782/Source/WebCore/rendering/svg/SVGInlineFlowBox.cpp (90861 => 90862)
--- branches/chromium/782/Source/WebCore/rendering/svg/SVGInlineFlowBox.cpp 2011-07-12 22:29:39 UTC (rev 90861)
+++ branches/chromium/782/Source/WebCore/rendering/svg/SVGInlineFlowBox.cpp 2011-07-12 22:30:53 UTC (rev 90862)
@@ -75,8 +75,11 @@
IntRect SVGInlineFlowBox::calculateBoundaries() const
{
IntRect childRect;
- for (InlineBox* child = firstChild(); child; child = child->nextOnLine())
+ for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) {
+ if (!child->isSVGInlineTextBox() && !child->isSVGInlineFlowBox())
+ continue;
childRect.unite(child->calculateBoundaries());
+ }
return childRect;
}
Modified: branches/chromium/782/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp (90861 => 90862)
--- branches/chromium/782/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp 2011-07-12 22:29:39 UTC (rev 90861)
+++ branches/chromium/782/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp 2011-07-12 22:30:53 UTC (rev 90862)
@@ -39,7 +39,11 @@
{
ASSERT(textRoot);
- // Build list of x/y/dx/dy/rotate values for each subtree element that may define these values (tspan/textPath etc).
+ // We always clear our current attribute as we don't want to keep any stale ones that could survive DOM modification.
+ Vector<SVGTextLayoutAttributes>& allAttributes = textRoot->layoutAttributes();
+ allAttributes.clear();
+
+ // Build list of x/y/dx/dy/rotate values for each subtree element that may define these values (tspan/textPath etc).
unsigned atCharacter = 0;
UChar lastCharacter = '\0';
collectTextPositioningElements(textRoot, atCharacter, lastCharacter);
@@ -51,8 +55,6 @@
buildLayoutAttributesForAllCharacters(textRoot, atCharacter);
// Propagate layout attributes to each RenderSVGInlineText object, and the whole list to the RenderSVGText root.
- Vector<SVGTextLayoutAttributes>& allAttributes = textRoot->layoutAttributes();
- allAttributes.clear();
atCharacter = 0;
lastCharacter = '\0';
propagateLayoutAttributes(textRoot, allAttributes, atCharacter, lastCharacter);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes