SVG clips to original dimensions after resizing root <svg> width and height

RESOLVED FIXED

Status

()

defect
RESOLVED FIXED
13 years ago
12 years ago

People

(Reporter: jwatt, Unassigned)

Tracking

({regression, testcase})

Trunk
x86
Windows XP
Points:
---
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

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.
Posted patch patchSplinter Review
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.
Attachment #253331 - Flags: superreview?(dbaron)
Attachment #253331 - Flags: review?(tor)
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).
Attachment #253331 - Flags: superreview?(dbaron)
Attachment #253331 - Flags: review?(tor)
Depends on: 280923
No longer depends on: 280923
Depends on: 294086
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
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.