Without this patch, when changing the x/y attributes of svg:use, innerSVG and foreignObject, we were relying on the transform changes of the children to trigger the right invalidations. However, changes to those attributes can also change the filter region. And there's a difference between moving children in a fixed filter region and moving the filter region along with the children: In the first case, we wouldn't need to invalidate anything outside the old filter region, because those parts of the children would be clipped away anyway. But when the filter region changes, we need to invalidate both the old and the new filter region. Also, when the filter has primitives without inputs, e.g. flood or turbulence, the filtered frame needs to be invalidate even if it has no children.
This function calculates the offset between "bounding box frame space" and "user space" for SVG frames. For non-SVG frames it returns no offset.
It's crucial that this is consistent with what nsSVGUtils::GetBBox does.
nsFilterInstance has several methods that are called by consumers before the actual painting, e.g. to calculate post filter extents or invalidation regions. Those nsFilterInstance APIs have their input and output values in "bounding box frame space" coordinates, but if the filter units are "objectBoundingBox", then those methods also do calculations involving the result of nsSVGUtils::GetBBox. So a consistent conversion is very important.
There are three spaces that nsSVGIntegrationUtils needs to convert between. I'll call them "frame space", "bounding box frame space" and "user space".
"Bounding box frame space" has its origin at the top left of the union of a frame's border boxes over all continuations.
For SVG frames, "frame space" and "bounding box frame space" are the same because SVG frames don't have multiple continuations.
For non-SVG frames, "bounding box frame space" and "user space" are the same.
However, for SVG frames, "bounding box frame space" and "user space" are different! For example, for a <rect x="100" y="100">, the point 0,0 in frame space is at the rect's top left corner, but the point 0,0 in user space is 100,100 pixels away from the rect's corner.
nsSVGIntegrationUtils::GetOffsetToUserSpace took the non-SVG viewpoint, but it's misleading for SVG frames.
- The condition described in the FIXME comment is already handled by
GetNearestBlockContainer in nsFrame.cpp (helper for
nsIFrame::GetContainingBlock).
The HTC version of OMXCodec has extra fields in its ReadOptions class over the
AOSP version. We added padding in bug 932820, but it was apparently not enough.
This patch simply adds more padding to our version of the class.