Bug 134168 - Make offset from ancestor computation explicit by moving it to the callers.
Summary: Make offset from ancestor computation explicit by moving it to the callers.
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: 134156
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-21 19:15 PDT by zalan
Modified: 2014-06-22 21:28 PDT (History)
5 users (show)

See Also:


Attachments
Patch (32.27 KB, patch)
2014-06-21 20:44 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (32.26 KB, patch)
2014-06-21 20:50 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (32.54 KB, patch)
2014-06-22 19:36 PDT, zalan
no flags 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-21 19:15:20 PDT
Instead of passing the offset by pointer and call compute when the offset is null.
Comment 1 zalan 2014-06-21 20:44:07 PDT
Created attachment 233555 [details]
Patch

It has source dependency on bug 134156, won't compile as it is.
Comment 2 zalan 2014-06-21 20:50:24 PDT
Created attachment 233556 [details]
Patch
Comment 3 Simon Fraser (smfr) 2014-06-22 11:18:53 PDT
Comment on attachment 233556 [details]
Patch

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

> Source/WebCore/rendering/RenderLayer.cpp:3581
> +    LayoutRect boundingBox = layer->boundingBox(rootLayer, layer->offsetFromAncestor(rootLayer));

I think it would be cleaner for boundingBox to always return a local box (so remove the parameter), and for the caller to offset the result.

> Source/WebCore/rendering/RenderLayer.cpp:5382
> +    calculateRects(clipRectsContext, renderer().view().documentRect(), layerBounds, backgroundRect, foregroundRect, outlineRect, offsetFromAncestor(clipRectsContext.rootLayer));

Should check to see if any callers have already computed offsetFromAncestor.
Comment 4 zalan 2014-06-22 19:36:44 PDT
Created attachment 233582 [details]
Patch
Comment 5 zalan 2014-06-22 19:36:59 PDT
Comment on attachment 233582 [details]
Patch

EWSing
Comment 6 WebKit Commit Bot 2014-06-22 21:28:43 PDT
Comment on attachment 233582 [details]
Patch

Clearing flags on attachment: 233582

Committed r170282: <http://trac.webkit.org/changeset/170282>
Comment 7 WebKit Commit Bot 2014-06-22 21:28:47 PDT
All reviewed patches have been landed.  Closing bug.