| 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 | 301 |
| 302 if (position == AbsolutePosition) | 302 if (position == AbsolutePosition) |
| 303 return parentRects.posClipRect(); | 303 return parentRects.posClipRect(); |
| 304 | 304 |
| 305 return parentRects.overflowClipRect(); | 305 return parentRects.overflowClipRect(); |
| 306 } | 306 } |
| 307 | 307 |
| 308 ClipRect RenderLayerClipper::backgroundClipRect(const ClipRectsContext& context)
const | 308 ClipRect RenderLayerClipper::backgroundClipRect(const ClipRectsContext& context)
const |
| 309 { | 309 { |
| 310 ASSERT(m_renderer.layer()->parent()); | 310 ASSERT(m_renderer.layer()->parent()); |
| 311 ASSERT(m_renderer.view()); |
| 311 | 312 |
| 312 ClipRects parentRects; | 313 ClipRects parentRects; |
| 313 | 314 parentClipRects(context, parentRects); |
| 314 // If we cross into a different pagination context, then we can't rely on th
e cache. | |
| 315 // Just switch over to using UncachedClipRects. | |
| 316 if (context.usesCache() && m_renderer.layer()->parent()->enclosingPagination
Layer() != m_renderer.layer()->enclosingPaginationLayer()) { | |
| 317 ClipRectsContext tempContext(context); | |
| 318 tempContext.cacheSlot = UncachedClipRects; | |
| 319 parentClipRects(tempContext, parentRects); | |
| 320 } else { | |
| 321 parentClipRects(context, parentRects); | |
| 322 } | |
| 323 | 315 |
| 324 ClipRect backgroundClipRect = backgroundClipRectForPosition(parentRects, m_r
enderer.style()->position()); | 316 ClipRect backgroundClipRect = backgroundClipRectForPosition(parentRects, m_r
enderer.style()->position()); |
| 325 RenderView* view = m_renderer.view(); | |
| 326 ASSERT(view); | |
| 327 | 317 |
| 328 // Note: infinite clipRects should not be scrolled here, otherwise they will
accidentally no longer be considered infinite. | 318 // Note: infinite clipRects should not be scrolled here, otherwise they will
accidentally no longer be considered infinite. |
| 329 if (parentRects.fixed() && context.rootLayer->renderer() == view && backgrou
ndClipRect != PaintInfo::infiniteRect()) | 319 if (parentRects.fixed() && context.rootLayer->renderer() == m_renderer.view(
) && backgroundClipRect != PaintInfo::infiniteRect()) |
| 330 backgroundClipRect.move(view->frameView()->scrollOffsetForFixedPosition(
)); | 320 backgroundClipRect.move(m_renderer.view()->frameView()->scrollOffsetForF
ixedPosition()); |
| 331 | 321 |
| 332 return backgroundClipRect; | 322 return backgroundClipRect; |
| 333 } | 323 } |
| 334 | 324 |
| 335 void RenderLayerClipper::parentClipRects(const ClipRectsContext& context, ClipRe
cts& clipRects) const | 325 void RenderLayerClipper::parentClipRects(const ClipRectsContext& context, ClipRe
cts& clipRects) const |
| 336 { | 326 { |
| 337 // The root is not clipped. | 327 // The root is not clipped. |
| 338 if (m_renderer.layer() == context.rootLayer) { | 328 if (m_renderer.layer() == context.rootLayer) { |
| 339 clipRects.reset(PaintInfo::infiniteRect()); | 329 clipRects.reset(PaintInfo::infiniteRect()); |
| 340 return; | 330 return; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 369 ASSERT(current); | 359 ASSERT(current); |
| 370 if (current->transform() || current->isPaintInvalidationContainer()) | 360 if (current->transform() || current->isPaintInvalidationContainer()) |
| 371 return const_cast<RenderLayer*>(current); | 361 return const_cast<RenderLayer*>(current); |
| 372 } | 362 } |
| 373 | 363 |
| 374 ASSERT_NOT_REACHED(); | 364 ASSERT_NOT_REACHED(); |
| 375 return 0; | 365 return 0; |
| 376 } | 366 } |
| 377 | 367 |
| 378 } // namespace WebCore | 368 } // namespace WebCore |
| OLD | NEW |