Bug 732819 - "ASSERTION: don't think me need this any more" with font-size: 0. r=roc.
authorJonathan Watt <jwatt@jwatt.org>
Sat, 30 Jun 2012 12:20:46 +0100
changeset 98046 fed6b276ad326fe2a4ae9f95c7ae144e3717d885
parent 98045 9feb8257666c2ae1c7dfe3f2379f379f3e608efa
child 98047 82a0b3fe9fa718804f0ee4f6eff9b16cca8468e9
push id23017
push userryanvm@gmail.com
push dateSat, 30 Jun 2012 19:29:24 +0000
treeherdermozilla-central@4c2ddc60f360 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs732819
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 732819 - "ASSERTION: don't think me need this any more" with font-size: 0. r=roc.
layout/reftests/svg/reftest.list
layout/reftests/svg/text-font-size-01.svg
layout/svg/base/src/nsSVGGlyphFrame.cpp
--- a/layout/reftests/svg/reftest.list
+++ b/layout/reftests/svg/reftest.list
@@ -237,16 +237,17 @@ random-if(gtk2Widget) == objectBoundingB
 == suspend-02.svg pass.svg
 == suspend-03.svg pass.svg
 == suspend-04.svg pass.svg
 == suspend-05.svg pass.svg
 == suspend-06.svg pass.svg
 == suspend-07.svg pass.svg
 == suspend-08.svg pass.svg
 == symbol-01.svg symbol-01-ref.svg
+== text-font-size-01.svg pass.svg
 random-if(gtk2Widget) == text-font-weight-01.svg text-font-weight-01-ref.svg # bug 386713
 == text-gradient-01.svg text-gradient-01-ref.svg
 random-if(winWidget) == text-gradient-02.svg text-gradient-02-ref.svg # see bug 590101
 == text-gradient-03.svg pass.svg
 == text-in-link-01.svg text-in-link-01-ref.svg
 == text-in-link-02.svg text-in-link-02-ref.svg
 == text-in-link-03.svg text-in-link-03-ref.svg
 # Tests for bug 546813: sanity-check using HTML text, then test SVG behavior.
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/text-font-size-01.svg
@@ -0,0 +1,17 @@
+<!--
+     Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
+
+  <title>Test text with zero font-size</title>
+
+  <!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=732819 -->
+
+  <text x="10" y="50" font-size="0">Some
+    <tspan dy="30">text</tspan>
+    that should not show.
+  </text>
+
+</svg>
+
--- a/layout/svg/base/src/nsSVGGlyphFrame.cpp
+++ b/layout/svg/base/src/nsSVGGlyphFrame.cpp
@@ -299,16 +299,21 @@ nsSVGGlyphFrame::GetType() const
 
 NS_IMETHODIMP
 nsSVGGlyphFrame::PaintSVG(nsRenderingContext *aContext,
                           const nsIntRect *aDirtyRect)
 {
   if (!GetStyleVisibility()->IsVisible())
     return NS_OK;
 
+  if (GetStyleFont()->mFont.size <= 0) {
+    // Don't even try to paint, or cairo will go into an error state.
+    return NS_OK;
+  }
+
   gfxContext *gfx = aContext->ThebesContext();
   PRUint16 renderMode = SVGAutoRenderState::GetRenderMode(aContext);
 
   switch (GetStyleSVG()->mTextRendering) {
   case NS_STYLE_TEXT_RENDERING_OPTIMIZESPEED:
     gfx->SetAntialiasMode(gfxContext::MODE_ALIASED);
     break;
   default: