Bug 25226

Summary: Add a RenderObject::localToParentTransform method which includes the full transform between local and parent local
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Bug Depends on: 25224    
Bug Blocks:    
Attachments:
Description Flags
First stab at localToParentTransform simon.fraser: review+

Description Eric Seidel (no email) 2009-04-15 17:40:38 PDT
Add a RenderObject::localToParentTransform method which includes the full transform between local and parent local

The current localTransform() method is just the transform="" animated transform value from the SVGStyledTransformable element.  Commonly we need the full transform from local coordinates to parent local coordinates (as in computeRepaintRect() or even in the current absoluteTransform() implementation).  Add a localToParentTransform() to cover this case (and possibly remove localTransform()... although the layout test results currently depend on localTransform()).

This will make it very easy to add functioning computeRepaintRect() methods, and will clean up lots of places where we have to be sure to add all the transforms in the right order.  Now we'll just add one single transform (or its inverse) which will be easy to tell if we have it in the right order or not. :)
Comment 1 Eric Seidel (no email) 2009-04-16 15:36:07 PDT
Created attachment 29558 [details]
First stab at localToParentTransform

 14 files changed, 142 insertions(+), 49 deletions(-)
Comment 2 Simon Fraser (smfr) 2009-04-16 16:21:46 PDT
Comment on attachment 29558 [details]
First stab at localToParentTransform

r=me, but the localToParentTransform() terminology is a bit of a mismatch with RenderObjects 'getTransformFromContainer', which includes the offset the containing blocks renderer, and the transform of the renderer.

Eventually it would be good to have the point/quad mapping methods that are exposed on RenderObject just work for SVG, so we should look at mapLocalToContainer/mapAbsoluteToLocalPoint at some point too.
Comment 3 Eric Seidel (no email) 2009-04-16 16:24:16 PDT
(In reply to comment #2)
> (From update of attachment 29558 [details] [review])
> r=me, but the localToParentTransform() terminology is a bit of a mismatch with
> RenderObjects 'getTransformFromContainer', which includes the offset the
> containing blocks renderer, and the transform of the renderer.
> 
> Eventually it would be good to have the point/quad mapping methods that are
> exposed on RenderObject just work for SVG, so we should look at
> mapLocalToContainer/mapAbsoluteToLocalPoint at some point too.

Agreed.  I'm still not a fan of the getTransformFromContainer terminology (or I don't really understand it) after you description over IRC.  But I would like to unify the two transform models (or at least make them interoperable) sooner rather than later!

Comment 4 Eric Seidel (no email) 2009-04-16 16:27:56 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	WebCore/ChangeLog
	M	WebCore/rendering/RenderObject.cpp
	M	WebCore/rendering/RenderObject.h
	M	WebCore/rendering/RenderSVGContainer.cpp
	M	WebCore/rendering/RenderSVGContainer.h
	M	WebCore/rendering/RenderSVGHiddenContainer.cpp
	M	WebCore/rendering/RenderSVGHiddenContainer.h
	M	WebCore/rendering/RenderSVGRoot.cpp
	M	WebCore/rendering/RenderSVGRoot.h
	M	WebCore/rendering/RenderSVGTransformableContainer.cpp
	M	WebCore/rendering/RenderSVGTransformableContainer.h
	M	WebCore/rendering/RenderSVGViewportContainer.cpp
	M	WebCore/rendering/RenderSVGViewportContainer.h
	M	WebCore/rendering/SVGRenderSupport.cpp
Committed r42598