Closed Bug 1066270 Opened 10 years ago Closed 10 years ago

Prepare nsFilterInstance for nsIFrame-less filtering

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla35

People

(Reporter: mstange, Assigned: mstange)

References

(Blocks 1 open bug)

Details

Attachments

(9 files, 1 obsolete file)

8.27 KB, patch
roc
: review+
Details | Diff | Splinter Review
17.76 KB, patch
roc
: review+
Details | Diff | Splinter Review
18.95 KB, patch
roc
: review+
Details | Diff | Splinter Review
8.86 KB, patch
roc
: review+
Details | Diff | Splinter Review
5.40 KB, patch
roc
: review+
Details | Diff | Splinter Review
5.74 KB, patch
roc
: review+
Details | Diff | Splinter Review
4.21 KB, patch
roc
: review+
Details | Diff | Splinter Review
1.18 KB, patch
roc
: review+
Details | Diff | Splinter Review
2.95 KB, patch
roc
: review+
Details | Diff | Splinter Review
No description provided.
In nsSVGFilterInstance I need to call nsSVGUtils::GetRelativeRect and nsSVGUtils::UserSpace with something that resolves the lengths relative to the canvas space, and in cases where there's no nsIFrame for the canvas. At the moment you need to supply an nsIFrame to the length resolution functions, and many of them have two special cases: one for SVG frames (which end up calling methods of the frame's SVG element), and one for non-SVG frames. I didn't want to add a third overload for canvas all over the place, so I decided to introduce an interface called UserSpaceMetrics which has two implementations for the existing users but can be subclassed for the canvas case. I'm not too happy with the name "UserSpaceMetrics"... maybe "SVGLengthContext" would be better? I'm pretty sure this patch keeps the behavior of all existing methods unchanged.
Attachment #8488178 - Flags: review?(roc)
I'm going to clean up the nsFilterInstance constructor in a new bug, after this one has landed.
Comment on attachment 8488184 [details] [diff] [review] part 6: Allow aTargetFrame to be null in nsFilterInstance. Review of attachment 8488184 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/svg/nsFilterInstance.cpp @@ +203,2 @@ > nsRect preFilterVOR = mTargetFrame->GetPreEffectsVisualOverflowRect(); > mTargetBounds = FrameSpaceToFilterSpace(&preFilterVOR); Shouldn't something set mTargetBounds when mTargetFrame is null? What is going to do that?
Attachment #8488184 - Flags: review?(roc) → review-
mTargetBounds looks like a leftover. Every time its value is used, it's union'ed with mTargetBBoxInFilterSpace, but as far as I can tell mTargetBBoxInFilterSpace always contains mTargetBounds. I've tested with SVG frames, non-SVG frames, and non-SVG frames with continuations. In the continuation case mTargetBBoxInFilterSpace is the bounding box over all continuations and mTargetBounds is just the first frame.
Attachment #8488617 - Flags: review?(roc)
Attachment #8488184 - Flags: review- → review?(roc)
We do need mTargetBounds after all because for SVG elements with a stroke, the BBox doesn't include the stroke. This patch at least puts the unioning into one place and makes sure that mTargetBounds has a useful value even if mTargetFrame is null.
Attachment #8488617 - Attachment is obsolete: true
Attachment #8489168 - Flags: review?(roc)
Blocks: 1152918
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: