Bug 134092 - Introduce RenderLayer::offsetFromAncestorLayer() to make convertToLayerCoords() calls with LayoutPoint(0, 0) as parameter more explicit.
Summary: Introduce RenderLayer::offsetFromAncestorLayer() to make convertToLayerCoords...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-19 22:59 PDT by zalan
Modified: 2014-06-20 15:58 PDT (History)
5 users (show)

See Also:


Attachments
Patch (32.07 KB, patch)
2014-06-19 23:04 PDT, zalan
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>