Closed
Bug 498275
Opened 15 years ago
Closed 15 years ago
Stop using nsIDOMSVGMatrix in nsSVGForeignObjectFrame + fixes
Categories
(Core :: SVG, defect)
Core
SVG
Tracking
()
RESOLVED
FIXED
People
(Reporter: jwatt, Assigned: jwatt)
References
Details
Attachments
(1 file, 4 obsolete files)
33.54 KB,
patch
|
longsonr
:
review+
|
Details | Diff | Splinter Review |
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.
Assignee | ||
Comment 1•15 years ago
|
||
Assignee | ||
Comment 2•15 years ago
|
||
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.
Assignee | ||
Comment 3•15 years ago
|
||
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)
Assignee | ||
Comment 4•15 years ago
|
||
(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.
Assignee | ||
Comment 5•15 years ago
|
||
Attachment #383297 -
Attachment is obsolete: true
Attachment #383350 -
Flags: review?(longsonr)
Attachment #383297 -
Flags: review?(longsonr)
Comment 6•15 years ago
|
||
Can you attach an updated patch please now that my clip property fix is in?
Assignee | ||
Comment 7•15 years ago
|
||
Ouch, that really conflicted. :-)
Attachment #383350 -
Attachment is obsolete: true
Attachment #383812 -
Flags: review?(longsonr)
Attachment #383350 -
Flags: review?(longsonr)
Assignee | ||
Comment 8•15 years ago
|
||
Correction for slight mismerge.
Attachment #383812 -
Attachment is obsolete: true
Attachment #383821 -
Flags: review?(longsonr)
Attachment #383812 -
Flags: review?(longsonr)
Comment 9•15 years ago
|
||
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+
Assignee | ||
Comment 10•15 years ago
|
||
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. :-)
Comment 11•15 years ago
|
||
You can't invert a singular matrix.
Assignee | ||
Comment 12•15 years ago
|
||
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.
Assignee | ||
Comment 13•15 years ago
|
||
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.
Assignee | ||
Updated•15 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•