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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 static void applyClipRects(const ClipRectsContext& context, RenderObject& render
er, LayoutPoint offset, ClipRects& clipRects) | 69 static void applyClipRects(const ClipRectsContext& context, RenderObject& render
er, LayoutPoint offset, ClipRects& clipRects) |
70 { | 70 { |
71 ASSERT(renderer.hasOverflowClip() || renderer.hasClip()); | 71 ASSERT(renderer.hasOverflowClip() || renderer.hasClip()); |
72 | 72 |
73 RenderView* view = renderer.view(); | 73 RenderView* view = renderer.view(); |
74 ASSERT(view); | 74 ASSERT(view); |
75 if (clipRects.fixed() && context.rootLayer->renderer() == view) | 75 if (clipRects.fixed() && context.rootLayer->renderer() == view) |
76 offset -= view->frameView()->scrollOffsetForFixedPosition(); | 76 offset -= view->frameView()->scrollOffsetForViewportConstrainedObjects()
; |
77 | 77 |
78 if (renderer.hasOverflowClip()) { | 78 if (renderer.hasOverflowClip()) { |
79 ClipRect newOverflowClip = toRenderBox(renderer).overflowClipRect(offset
, context.scrollbarRelevancy); | 79 ClipRect newOverflowClip = toRenderBox(renderer).overflowClipRect(offset
, context.scrollbarRelevancy); |
80 newOverflowClip.setHasRadius(renderer.style()->hasBorderRadius()); | 80 newOverflowClip.setHasRadius(renderer.style()->hasBorderRadius()); |
81 clipRects.setOverflowClipRect(intersection(newOverflowClip, clipRects.ov
erflowClipRect())); | 81 clipRects.setOverflowClipRect(intersection(newOverflowClip, clipRects.ov
erflowClipRect())); |
82 if (renderer.isPositioned()) | 82 if (renderer.isPositioned()) |
83 clipRects.setPosClipRect(intersection(newOverflowClip, clipRects.pos
ClipRect())); | 83 clipRects.setPosClipRect(intersection(newOverflowClip, clipRects.pos
ClipRect())); |
84 } | 84 } |
85 | 85 |
86 if (renderer.hasClip()) { | 86 if (renderer.hasClip()) { |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 RefPtr<ClipRects> parentClipRects = ClipRects::create(); | 327 RefPtr<ClipRects> parentClipRects = ClipRects::create(); |
328 if (m_renderer.layer() == context.rootLayer) | 328 if (m_renderer.layer() == context.rootLayer) |
329 parentClipRects->reset(LayoutRect::infiniteIntRect()); | 329 parentClipRects->reset(LayoutRect::infiniteIntRect()); |
330 else | 330 else |
331 m_renderer.layer()->parent()->clipper().getOrCalculateClipRects(context,
*parentClipRects); | 331 m_renderer.layer()->parent()->clipper().getOrCalculateClipRects(context,
*parentClipRects); |
332 | 332 |
333 ClipRect result = backgroundClipRectForPosition(*parentClipRects, m_renderer
.style()->position()); | 333 ClipRect result = backgroundClipRectForPosition(*parentClipRects, m_renderer
.style()->position()); |
334 | 334 |
335 // Note: infinite clipRects should not be scrolled here, otherwise they will
accidentally no longer be considered infinite. | 335 // Note: infinite clipRects should not be scrolled here, otherwise they will
accidentally no longer be considered infinite. |
336 if (parentClipRects->fixed() && context.rootLayer->renderer() == m_renderer.
view() && result != LayoutRect::infiniteIntRect()) | 336 if (parentClipRects->fixed() && context.rootLayer->renderer() == m_renderer.
view() && result != LayoutRect::infiniteIntRect()) |
337 result.move(m_renderer.view()->frameView()->scrollOffsetForFixedPosition
()); | 337 result.move(m_renderer.view()->frameView()->scrollOffsetForViewportConst
rainedObjects()); |
338 | 338 |
339 return result; | 339 return result; |
340 } | 340 } |
341 | 341 |
342 void RenderLayerClipper::getOrCalculateClipRects(const ClipRectsContext& context
, ClipRects& clipRects) const | 342 void RenderLayerClipper::getOrCalculateClipRects(const ClipRectsContext& context
, ClipRects& clipRects) const |
343 { | 343 { |
344 if (context.usesCache()) | 344 if (context.usesCache()) |
345 clipRects = *getClipRects(context); | 345 clipRects = *getClipRects(context); |
346 else | 346 else |
347 calculateClipRects(context, clipRects); | 347 calculateClipRects(context, clipRects); |
(...skipping 17 matching lines...) Expand all Loading... |
365 ASSERT(current); | 365 ASSERT(current); |
366 if (current->transform() || current->isPaintInvalidationContainer()) | 366 if (current->transform() || current->isPaintInvalidationContainer()) |
367 return const_cast<RenderLayer*>(current); | 367 return const_cast<RenderLayer*>(current); |
368 } | 368 } |
369 | 369 |
370 ASSERT_NOT_REACHED(); | 370 ASSERT_NOT_REACHED(); |
371 return 0; | 371 return 0; |
372 } | 372 } |
373 | 373 |
374 } // namespace blink | 374 } // namespace blink |
OLD | NEW |