OLD | NEW |
---|---|
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 Loading... | |
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 // This offset cannot use convertToLayerCoords, because sometimes our ro otLayer may be across | 271 PaintLayer* layer = m_layoutObject.layer(); |
272 // some transformed layer boundary, for example, in the PaintLayerCompos itor overlapMap, where | 272 LayoutPoint offset; |
273 // clipRects are needed in view space. | 273 if (!layer->enclosingPaginationLayer()) { |
274 applyClipRects(context, m_layoutObject, roundedLayoutPoint(m_layoutObjec t.localToContainerPoint(FloatPoint(), context.rootLayer->layoutObject())), clipR ects); | 274 // This offset cannot use convertToLayerCoords, because sometimes ou r rootLayer may be across |
275 // some transformed layer boundary, for example, in the PaintLayerCo mpositor overlapMap, where | |
276 // clipRects are needed in view space. | |
277 | |
278 // TODO(mstensho): Switch to always using convertToLayerCoords() (se e code further | |
chrishtr
2015/11/19 23:31:41
localToContainerPoint is actually incorrect here,
mstensho (USE GERRIT)
2015/11/20 10:37:15
Makes sense.
chrishtr
2015/12/08 22:56:07
The point I was getting at with asking what the ro
| |
279 // below). Using localToContainerPoint() unfortunately seems necessa ry in some rare | |
280 // cases, but isn't it bad that we need to cross transformed layer b oundaries here? | |
281 // localToContainerPoint() is multicol-aware (as well as being trans forms-aware, which | |
282 // is the reason why it's called here in the first place, in favor o f | |
283 // convertToLayerCoords()), in that it converts from flowthread coor dinates to visual | |
284 // coordinates. That won't work, because clip rectangles are... well ... rectangles, so | |
285 // they are calculated before everything is sliced and translated in to columns (at | |
286 // which point each column will get its own slice of the clip rectan gle). | |
287 offset = roundedLayoutPoint(m_layoutObject.localToContainerPoint(Flo atPoint(), context.rootLayer->layoutObject())); | |
288 } else { | |
289 m_layoutObject.layer()->convertToLayerCoords(context.rootLayer, offs et); | |
290 } | |
291 applyClipRects(context, m_layoutObject, offset, clipRects); | |
275 } | 292 } |
276 } | 293 } |
277 | 294 |
278 static ClipRect backgroundClipRectForPosition(const ClipRects& parentRects, EPos ition position) | 295 static ClipRect backgroundClipRectForPosition(const ClipRects& parentRects, EPos ition position) |
279 { | 296 { |
280 if (position == FixedPosition) | 297 if (position == FixedPosition) |
281 return parentRects.fixedClipRect(); | 298 return parentRects.fixedClipRect(); |
282 | 299 |
283 if (position == AbsolutePosition) | 300 if (position == AbsolutePosition) |
284 return parentRects.posClipRect(); | 301 return parentRects.posClipRect(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
323 if (context.respectOverflowClip == IgnoreOverflowClip) | 340 if (context.respectOverflowClip == IgnoreOverflowClip) |
324 return false; | 341 return false; |
325 | 342 |
326 if (layer->isRootLayer() && context.respectOverflowClipForViewport == Ignore OverflowClip) | 343 if (layer->isRootLayer() && context.respectOverflowClipForViewport == Ignore OverflowClip) |
327 return false; | 344 return false; |
328 | 345 |
329 return true; | 346 return true; |
330 } | 347 } |
331 | 348 |
332 } // namespace blink | 349 } // namespace blink |
OLD | NEW |