BUILD: Current trunk with SVG STEPS TO REPRODUCE: 1) Open URL 2) Click "svg" checkbox a few times EXPECTED RESULTS: no assertions ACTUAL RESULTS: ###!!! ASSERTION: zero axis length: 'd!=0.0f', file /home/bzbarsky/mozilla/xlib/mozilla/content/svg/content/src/nsSVGLength.cpp, line 550 This was making it very difficult to debug bug 280214... I don't know whether the assertion is correct (in which code that gets us into this state should be fixed) or whether this is a normal occurrence (in which case the assertion should be removed).
There are a number of problems with nsSVGLength and some of the code that currently uses it, including the fact that we create certain objects that (by default) have percentage based length members, which during creation have no context. We need to fix up this class to deal with the "no context" and "zero axis length" problems. I was planning to sort this out after bug 274698.
One source of this assertion is the nsSVGViewBox ctor which calls nsSVGLength::GetValue(). The ctor is called in nsSVGSVGElement::Init() and nsSVGMarkerElement::Init() by the call to NS_NewSVGViewBox(). During this construction stage the elements haven't been inserted into a document, and as a result the width and height that get passed to the nsSVGViewBox ctor don't have a context. Unless the lengths happen to have a unitType of SVG_LENGTHTYPE_NUMBER or SVG_LENGTHTYPE_PX, GetValue can't return a valid user unit value. Hence the assertion.
This really should be addressed by the SVG WG. I reported the issue as I see it to www-svg a couple of months ago. http://lists.w3.org/Archives/Public/www-svg/2005Apr/0006
Bug 274698 changed the NS_ASSERTION to an NS_WARNING.