Closed Bug 413975 Opened 12 years ago Closed 10 years ago

GetCtx returning null does not mean we are an outer SVG

Categories

(Core :: SVG, defect)

defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: jwatt, Assigned: longsonr)

Details

Attachments

(1 file, 1 obsolete file)

In nsSVGSVGElement.cpp we assume that if GetCtx() returns null then we are an outer SVG with an nsSVGOuterSVGFrame that has set our mViewportWidth and mViewportHeight. This is not the case of invalid SVG like:

<g id="docRoot">
  <svg>
    <stuff/>
  </svg>
</g>
Fix included in patch for bug 361920
Fixed by check in for bug 361920
Status: NEW → RESOLVED
Closed: 11 years ago
Depends on: 361920
Resolution: --- → FIXED
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee: nobody → longsonr
Attached file Test case (obsolete) —
I'm running into this problem too in some of our mochitests. If we have a percentage length inside an SVG fragment whose parent is display:none we arrive at the same problem.

When we call nsSVGSVGElement::GetLength(), GetCtx() returns NULL and mViewportWidth and mViewportHeight are set to 0. So GetLength() returns 0 and nsSVGLength2::FixAxisLength returns 1e-20f. Hence the bogus result for this test.
Attached patch patchSplinter Review
This fixes the bug as originally described but the testcase is a different issue I think.
Attachment #397722 - Flags: review?(jwatt)
Attachment #397722 - Flags: review?(jwatt) → review+
pushed http://hg.mozilla.org/mozilla-central/rev/de9d574b1a41
Status: REOPENED → RESOLVED
Closed: 11 years ago10 years ago
Resolution: --- → FIXED
No longer depends on: 361920
(In reply to comment #4)
> This fixes the bug as originally described but the testcase is a different
> issue I think.

Filed separate bug 628848 for that
Attachment #396545 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.