Closed Bug 280364 Opened 20 years ago Closed 14 years ago

SVG asserts when running this testcase

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: jwatt)

References

()

Details

(Keywords: assertion, testcase)

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.
Assignee: general → jonathan.watt
Depends on: 274698
OS: Linux → All
Hardware: PC → All
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
Keywords: assertion, testcase
QA Contact: ian → general
Bug 274698 changed the NS_ASSERTION to an NS_WARNING.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.