Bug 979407 - Fix ASSERTION: viewport height must be nonnegative, with negative markerHeight or markerWidth attribute. r=dholbert

This commit is contained in:
Robert Longson 2014-03-05 21:28:12 +00:00
parent 3b37f2da27
commit d40d374851
4 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg">
<marker id="marker" viewBox="0 0 10 10" markerHeight="-1px"/>
<path d="M0,0 h10" marker-start="url(#marker)"/>
</svg>

After

Width:  |  Height:  |  Size: 163 B

View File

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg">
<marker id="marker" viewBox="0 0 10 10" markerWidth="-1px"/>
<path d="M0,0 h10" marker-start="url(#marker)"/>
</svg>

After

Width:  |  Height:  |  Size: 162 B

View File

@ -181,3 +181,5 @@ load 952270-1.svg
load 963086-1.svg
load 975773-1.svg
load 974746-1.svg
load 979407-1.svg
load 979407-2.svg

View File

@ -116,6 +116,9 @@ nsSVGMarkerFrame::PaintMark(nsRenderingContext *aContext,
AutoMarkerReferencer markerRef(this, aMarkedFrame);
SVGMarkerElement *marker = static_cast<SVGMarkerElement*>(mContent);
if (!marker->HasValidDimensions()) {
return NS_OK;
}
const nsSVGViewBoxRect viewBox = marker->GetViewBoxRect();
@ -171,6 +174,9 @@ nsSVGMarkerFrame::GetMarkBBoxContribution(const Matrix &aToBBoxUserspace,
AutoMarkerReferencer markerRef(this, aMarkedFrame);
SVGMarkerElement *content = static_cast<SVGMarkerElement*>(mContent);
if (!content->HasValidDimensions()) {
return bbox;
}
const nsSVGViewBoxRect viewBox = content->GetViewBoxRect();