Commit 427fe5f2 authored by abarth@chromium.org's avatar abarth@chromium.org

Remove pagination hacks in RenderLayerClipper::backgroundClipRect

There's no reason we can't use the clip cache when there's an enclosing
pagination layer. None of the rest of the code in RenderLayerClipper cares
about paginations layers.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/355293002

git-svn-id: svn://svn.chromium.org/blink/trunk@177155 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent d25d7ac8
......@@ -310,26 +310,16 @@ static inline ClipRect backgroundClipRectForPosition(const ClipRects& parentRect
ClipRect RenderLayerClipper::backgroundClipRect(const ClipRectsContext& context) const
{
ASSERT(m_renderer.layer()->parent());
ASSERT(m_renderer.view());
ClipRects parentRects;
// If we cross into a different pagination context, then we can't rely on the cache.
// Just switch over to using UncachedClipRects.
if (context.usesCache() && m_renderer.layer()->parent()->enclosingPaginationLayer() != m_renderer.layer()->enclosingPaginationLayer()) {
ClipRectsContext tempContext(context);
tempContext.cacheSlot = UncachedClipRects;
parentClipRects(tempContext, parentRects);
} else {
parentClipRects(context, parentRects);
}
parentClipRects(context, parentRects);
ClipRect backgroundClipRect = backgroundClipRectForPosition(parentRects, m_renderer.style()->position());
RenderView* view = m_renderer.view();
ASSERT(view);
// Note: infinite clipRects should not be scrolled here, otherwise they will accidentally no longer be considered infinite.
if (parentRects.fixed() && context.rootLayer->renderer() == view && backgroundClipRect != PaintInfo::infiniteRect())
backgroundClipRect.move(view->frameView()->scrollOffsetForFixedPosition());
if (parentRects.fixed() && context.rootLayer->renderer() == m_renderer.view() && backgroundClipRect != PaintInfo::infiniteRect())
backgroundClipRect.move(m_renderer.view()->frameView()->scrollOffsetForFixedPosition());
return backgroundClipRect;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment