We seem to continue to clip to the original dimensions of SVG after resizing the root <svg> tag's width and height. In the attached testcase the green rect should fill the viewport. As can be seen from the stroke, that seems to happen, but the clip remains at the original 50x50 dimensions so most of the viewport remains white. Triggering the resize during onload works fine, but if triggered at some later stage using onclick say (or using setTimeout as in the testcase) it doesn't.
Resizing the window fixes the display.
Seems to be a regression from bug 301628.
So after bug 301628 we stopped calling nsSVGOuterSVGFrame::InitiateReflow() whenever the width/height of an outer <svg> changed. This patch makes sure we reflow, but perhaps there's a better way to do this.
Yeah, there is. The better way is to map these attributes into style, dammit! ;)
Comment on attachment 253331 [details] [diff] [review] patch Hmm. I won't bother asking if I should be creating a nsSVGSVGElement::GetAttributeChangeHint instead then. ;-) Thanks for pointing that out. Mapping width and height on outer <svg> into style is certainly on my to-do list, but I found it's not so simple (what with CSS 2.1 aspect ratio complications).
This bug disappeared in http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2007-03-09&maxdate=2007-03-10+04%3A00&cvsroot=%2Fcvsroot Perhaps the coordinate context rewrite (bug 353172)?
Yeah, the patch for bug 353172 added an nsSVGOuterSVGFrame::AttributeChanged that is pretty much exactly the same as the one in the patch on this bug. The SVG 'width' and 'height' attributes are actually not to be mapped into style, so this is probably the way to handle width/height changes, contrary to comment 4. Boris? Closing as fixed by bug 353172.
Status: NEW → RESOLVED
Closed: 12 years ago
No longer depends on: 294086
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.