Bug 78165

Summary: Calling RenderBox::absoluteQuads on RenderSVGRoot returns incorrect values when zoom or viewbox is involved
Product: WebKit Reporter: Max Vujovic <mvujovic>
Component: SVGAssignee: Max Vujovic <mvujovic>
Status: RESOLVED FIXED    
Severity: Normal CC: krit, zimmermann
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 78037    
Bug Blocks:    

Description Max Vujovic 2012-02-08 15:33:35 PST
RenderSVGRoot applies its local transform on itself when calling RenderBox::absoluteQuads. This happens in RenderSVGRoot::mapLocalToContainer.

The call hierarchy is:

RenderBox::absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const;
RenderObject::localToAbsoluteQuad(const FloatQuad& quad, bool fixed = false, bool* wasFixed = 0) const
RenderObject::localToContainerQuad(const FloatQuad&, RenderBoxModelObject* repaintContainer, bool fixed = false, bool* wasFixed = 0) const;
RenderSVGRoot::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, bool* wasFixed = 0) const;

absoluteQuads takes in a quad with the size of the SVG root element in screen space, after page zoom.
mapLocalToContainer then transforms the quad by RenderSVGRoot's m_localToBorderBoxTransform, which contains the zoom transform and the viewbox transform. See RenderSVGRoot::buildLocalToBorderBoxTransform.

Note that both getBoundingClientRect and the inspector highlight on SVG root elements rely on absoluteQuads to do their job. Links to related bugs are under the "Blocks:" field.
Comment 1 Nikolas Zimmermann 2012-03-19 08:29:05 PDT
Is this bug fixed as well, now?
Comment 2 Max Vujovic 2012-03-19 08:33:23 PDT
(In reply to comment #1)
> Is this bug fixed as well, now?

Yes, after bug 78037, this bug should be fixed.