Closed Bug 498275 Opened 15 years ago Closed 15 years ago

Stop using nsIDOMSVGMatrix in nsSVGForeignObjectFrame + fixes

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jwatt, Assigned: jwatt)

References

Details

Attachments

(1 file, 4 obsolete files)

Splitting this off from bug 435356, since the nsSVGForeignObjectFrame stuff involves some subtle fixes and needs careful review. I just killed the GetMatrixPropagation check in nsSVGInnerSVGFrame.cpp since matrix propagation stuff is dead except for nsSVGGlyphFrame, and so there was no point rewriting it for gfxMatrix here.
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → jwatt
Status: NEW → ASSIGNED
Attachment #383217 - Flags: review?(longsonr)
Oh, and I had GetCanvasTM include the x/y values by defining a nsSVGForeignObjectElement::PrependLocalTransformTo, since that makes in consistent with nsSVGInnerSVGFrame and nsSVGMarkerFrame. It also makes GetCanvasTM convert from the userspace established *by* the elemnt to device space, and that seems better and more consistent with other transform functions we have, and enables less code duplication.
Attached patch patch (obsolete) — Splinter Review
Also fixes bug in nsSVGForeignObjectFrame::PaintSVG Also fixes bug in nsSVGForeignObjectFrame::GetFrameForPoint (the point is already in canvas space in app units)
Attachment #383217 - Attachment is obsolete: true
Attachment #383297 - Flags: review?(longsonr)
Attachment #383217 - Flags: review?(longsonr)
(In reply to comment #3) > Also fixes bug in nsSVGForeignObjectFrame::GetFrameForPoint (the point is > already in canvas space in app units) Oops. It needs to be in local space in app units, not canvas space in app units.
Attached patch patch (obsolete) — Splinter Review
Attachment #383297 - Attachment is obsolete: true
Attachment #383350 - Flags: review?(longsonr)
Attachment #383297 - Flags: review?(longsonr)
Can you attach an updated patch please now that my clip property fix is in?
Attached patch patch (obsolete) — Splinter Review
Ouch, that really conflicted. :-)
Attachment #383350 - Attachment is obsolete: true
Attachment #383812 - Flags: review?(longsonr)
Attachment #383350 - Flags: review?(longsonr)
Attached patch patchSplinter Review
Correction for slight mismerge.
Attachment #383812 - Attachment is obsolete: true
Attachment #383821 - Flags: review?(longsonr)
Attachment #383812 - Flags: review?(longsonr)
Comment on attachment 383821 [details] [diff] [review] patch > NS_IMETHODIMP_(nsIFrame*) > nsSVGForeignObjectFrame::GetFrameForPoint(const nsPoint &aPoint) > { ... >+ float x, y, width, height; >+ static_cast<nsSVGElement*>(mContent)-> >+ GetAnimatedLengthValues(&x, &y, &width, &height, nsnull); >+ >+ gfxMatrix tm = GetCanvasTM().Invert(); >+ if (tm.IsSingular()) > return nsnull; Shouldn't you test whether the matrix is singular before you invert it rather than after? >diff --git a/layout/svg/base/src/nsSVGOuterSVGFrame.cpp b/layout/svg/base/src/nsSVGOuterSVGFrame.cpp >--- a/layout/svg/base/src/nsSVGOuterSVGFrame.cpp >+++ b/layout/svg/base/src/nsSVGOuterSVGFrame.cpp >@@ -577,17 +577,16 @@ nsSVGOuterSVGFrame::Paint(nsIRenderingCo > // It's not really clear what area to invalidate here. We might have > // stuffed up rendering for the entire window in this paint pass, > // so we can't just invalidate our own rect. Invalidate everything > // in sight. > // This won't work for printing, by the way, but failure to print the > // odd document is probably no worse than printing horribly for all > // documents. Better to fix things so we don't need fallback. > nsIFrame* frame = this; >- nsPresContext* presContext = PresContext(); > PRUint32 flags = 0; > while (PR_TRUE) { > nsIFrame* next = nsLayoutUtils::GetCrossDocParentFrame(frame); > if (!next) > break; > if (frame->GetParent() != next) { > // We're crossing a document boundary. Logically, the invalidation is > // being triggered by a subdocument of the root document. This will This is part of the patch for bug 494690 that seems to have sneaked in. r=longsonr with comments addressed where necessary.
Attachment #383821 - Flags: review?(longsonr) → review+
I'm not sure why it would be better to test for singularity before inverting. Inverting can't make a singular matrix non-singular. For the presContext thing, I just happened to notice that when I was building. I didn't know it was in another bug, but in that case I'll remove it. :-)
You can't invert a singular matrix.
Sure. More specifically what I meant was that gfxMatrix.Invert() will not make a singular gfxMatrix non-singular, so I don't think anything bad can happen here.
I've gone ahead and pushed http://hg.mozilla.org/mozilla-central/rev/7a983cc4040f We can change the matrix thing if I'm wrong and something bad could feasibly happen.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Depends on: 578309
No longer depends on: 578309
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: