Bug 134092

Summary: Introduce RenderLayer::offsetFromAncestorLayer() to make convertToLayerCoords() calls with LayoutPoint(0, 0) as parameter more explicit.
Product: WebKit Reporter: zalan <zalan>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, esprehn+autocc, glenn, kondapallykalyan, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch simon.fraser: review+

Description zalan 2014-06-19 22:59:08 PDT
Most of the RenderLayer::convertToLayerCoords() callers are just interested in getting the offset from the ancestor layer. Introducing offsetFromAncestorLayer() makes those calls more explicit/self-explanatory -> callsite's code can be simplified.
Comment 1 zalan 2014-06-19 23:04:36 PDT
Created attachment 233407 [details]
Patch
Comment 2 Simon Fraser (smfr) 2014-06-20 08:34:18 PDT
Comment on attachment 233407 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=233407&action=review

> Source/WebCore/rendering/RenderGeometryMap.cpp:-190
> -//    fprintf(stderr, "RenderGeometryMap::pushMappingsToAncestor from layer %p to layer %p, canConvertInLayerTree=%d\n", layer, ancestorLayer, canConvertInLayerTree);

Lots of commented printfs in this patch.

> Source/WebCore/rendering/RenderLayer.cpp:2026
> +LayoutPoint RenderLayer::offsetFromAncestorLayer(const RenderLayer* ancestorLayer) const

I think you could call this offsetFromAncestor. Would it make sense to return a LayoutSize?
Comment 3 zalan 2014-06-20 08:36:41 PDT
(In reply to comment #2)
> (From update of attachment 233407 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=233407&action=review
> 
> > Source/WebCore/rendering/RenderGeometryMap.cpp:-190
> > -//    fprintf(stderr, "RenderGeometryMap::pushMappingsToAncestor from layer %p to layer %p, canConvertInLayerTree=%d\n", layer, ancestorLayer, canConvertInLayerTree);
> 
> Lots of commented printfs in this patch.
You want me to keep them in? :)

> 
> > Source/WebCore/rendering/RenderLayer.cpp:2026
> > +LayoutPoint RenderLayer::offsetFromAncestorLayer(const RenderLayer* ancestorLayer) const
> 
> I think you could call this offsetFromAncestor. Would it make sense to return a LayoutSize?
Indeed!
Comment 4 zalan 2014-06-20 15:58:06 PDT
Committed r170220: <http://trac.webkit.org/changeset/170220>