Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp

Issue 1459943002: Clip abspos descendants correctly in all columns (not just the first). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review - possible alternative Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 } else { 261 } else {
262 parentLayer->clipper().calculateClipRects(context, clipRects); 262 parentLayer->clipper().calculateClipRects(context, clipRects);
263 } 263 }
264 } else { 264 } else {
265 clipRects.reset(LayoutRect(LayoutRect::infiniteIntRect())); 265 clipRects.reset(LayoutRect(LayoutRect::infiniteIntRect()));
266 } 266 }
267 267
268 adjustClipRectsForChildren(m_layoutObject, clipRects); 268 adjustClipRectsForChildren(m_layoutObject, clipRects);
269 269
270 if ((m_layoutObject.hasOverflowClip() && shouldRespectOverflowClip(context)) || m_layoutObject.hasClip()) { 270 if ((m_layoutObject.hasOverflowClip() && shouldRespectOverflowClip(context)) || m_layoutObject.hasClip()) {
271 const PaintLayer* layer = m_layoutObject.layer();
272 const PaintLayer* layerToStopAt = context.rootLayer;
273 if (const PaintLayer* paginationLayer = layer->enclosingPaginationLayer( )) {
274 // Stop at the multicol container, unless the root layer is also ins ide it.
275 if (layerToStopAt->enclosingPaginationLayer() != paginationLayer)
276 layerToStopAt = paginationLayer;
chrishtr 2015/12/14 21:39:51 Why not just require users of PaintLayerClipper to
277 }
271 // This offset cannot use convertToLayerCoords, because sometimes our ro otLayer may be across 278 // This offset cannot use convertToLayerCoords, because sometimes our ro otLayer may be across
272 // some transformed layer boundary, for example, in the PaintLayerCompos itor overlapMap, where 279 // some transformed layer boundary, for example, in the PaintLayerCompos itor overlapMap, where
273 // clipRects are needed in view space. 280 // clipRects are needed in view space.
274 applyClipRects(context, m_layoutObject, roundedLayoutPoint(m_layoutObjec t.localToContainerPoint(FloatPoint(), context.rootLayer->layoutObject())), clipR ects); 281 applyClipRects(context, m_layoutObject, roundedLayoutPoint(m_layoutObjec t.localToContainerPoint(FloatPoint(), layerToStopAt->layoutObject())), clipRects );
275 } 282 }
276 } 283 }
277 284
278 static ClipRect backgroundClipRectForPosition(const ClipRects& parentRects, EPos ition position) 285 static ClipRect backgroundClipRectForPosition(const ClipRects& parentRects, EPos ition position)
279 { 286 {
280 if (position == FixedPosition) 287 if (position == FixedPosition)
281 return parentRects.fixedClipRect(); 288 return parentRects.fixedClipRect();
282 289
283 if (position == AbsolutePosition) 290 if (position == AbsolutePosition)
284 return parentRects.posClipRect(); 291 return parentRects.posClipRect();
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 338
332 ClipRects* PaintLayerClipper::paintingClipRects(const PaintLayer* rootLayer, Sho uldRespectOverflowClip respectOverflowClip, const LayoutSize& subpixelAccumulati on) const 339 ClipRects* PaintLayerClipper::paintingClipRects(const PaintLayer* rootLayer, Sho uldRespectOverflowClip respectOverflowClip, const LayoutSize& subpixelAccumulati on) const
333 { 340 {
334 ClipRectsContext context(rootLayer, PaintingClipRects, IgnoreOverlayScrollba rSize, subpixelAccumulation); 341 ClipRectsContext context(rootLayer, PaintingClipRects, IgnoreOverlayScrollba rSize, subpixelAccumulation);
335 if (respectOverflowClip == IgnoreOverflowClip) 342 if (respectOverflowClip == IgnoreOverflowClip)
336 context.setIgnoreOverflowClip(); 343 context.setIgnoreOverflowClip();
337 return getClipRects(context); 344 return getClipRects(context);
338 } 345 }
339 346
340 } // namespace blink 347 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698