Closed
Bug 411146
Opened 17 years ago
Closed 17 years ago
Percentage dimensions on SVG in a foreignObject are broken
Categories
(Core :: SVG, defect)
Core
SVG
Tracking
()
RESOLVED
FIXED
People
(Reporter: jwatt, Assigned: jwatt)
Details
Attachments
(2 files)
1003 bytes,
application/xhtml+xml
|
Details | |
7.47 KB,
patch
|
longsonr
:
review+
tor
:
superreview+
mtschrep
:
approval1.9+
|
Details | Diff | Splinter Review |
Percentage dimensions on SVG descendants of a foreignObject do not work correctly when the descendant <svg> has a percentage width/height. This is because we end up going one coordinate context too high. More specifically, when resolving the percentage dimensions for the ellipse inside the foreignObject in the testcase attached, we end up with a stack like this:
nsSVGElement::GetOwnerSVGElement()
nsSVGSVGElement::GetOwnerSVGElement()
nsSVGElement::GetCtx()
nsSVGSVGElement::GetLength()
nsSVGLength2::GetAxisLength()
nsSVGLength2::GetUnitScaleFactor()
nsSVGLength2::GetAnimValue()
nsSVGElement::GetAnimatedLengthValues()
nsSVGEllipseElement::ConstructPath()
When nsSVGSVGElement::GetLength() is called on the <svg> descendant of the <foreignObject>, it calls GetCtx() to resolve its own percentage width/height. At this point we want GetCtx to return null so that we use mViewportWidth and mViewportHeight as set by nsSVGOuterSVGFrame. Unfortunately it returns the <svg> parent of the <foreignObject> and we end up resolving percentages against it.
![]() |
Assignee | |
Updated•17 years ago
|
Status: NEW → ASSIGNED
![]() |
Assignee | |
Comment 1•17 years ago
|
||
Attachment #295918 -
Flags: superreview?(tor)
Attachment #295918 -
Flags: review?(longsonr)
Comment 2•17 years ago
|
||
Comment on attachment 295918 [details] [diff] [review]
patch
> // are _we_ the outermost SVG element? If yes, return nsnull, but don't fail
>- nsCOMPtr<nsIDOMSVGSVGElement> SVGSVGElement = do_QueryInterface((nsIDOMSVGElement*)this);
>- if (SVGSVGElement) return NS_OK;
>+ if (this->Tag() == nsGkAtoms::svg) {
remove this-> there is a prior comment which makes it clear enough what is going on.
r=longsonr with that.
Attachment #295918 -
Flags: review?(longsonr) → review+
![]() |
Assignee | |
Comment 3•17 years ago
|
||
Oops, yeah. Thanks.
Attachment #295918 -
Flags: superreview?(tor) → superreview+
![]() |
Assignee | |
Comment 4•17 years ago
|
||
Comment on attachment 295918 [details] [diff] [review]
patch
Requesting approval1.9. Low risk change to fix percentage dimensions on SVG in a foreignObject.
Attachment #295918 -
Flags: approval1.9?
Comment 5•17 years ago
|
||
Comment on attachment 295918 [details] [diff] [review]
patch
a1.9+ Awesome - and thanks for the reftests
Attachment #295918 -
Flags: approval1.9? → approval1.9+
![]() |
Assignee | |
Comment 6•17 years ago
|
||
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•