| 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, LayoutObject& layout
Object, LayoutPoint offset, ClipRects& clipRects) | 69 static void applyClipRects(const ClipRectsContext& context, LayoutObject& layout
Object, LayoutPoint offset, ClipRects& clipRects) |
| 70 { | 70 { |
| 71 ASSERT(layoutObject.hasOverflowClip() || layoutObject.hasClip()); | 71 ASSERT(layoutObject.hasOverflowClip() || layoutObject.hasClip()); |
| 72 | 72 |
| 73 LayoutView* view = layoutObject.view(); | 73 LayoutView* view = layoutObject.view(); |
| 74 ASSERT(view); | 74 ASSERT(view); |
| 75 if (clipRects.fixed() && context.rootLayer->layoutObject() == view) | 75 if (clipRects.fixed() && context.rootLayer->layoutObject() == view) |
| 76 offset -= view->frameView()->scrollOffsetForViewportConstrainedObjects()
; | 76 offset -= toIntSize(view->frameView()->scrollPosition()); |
| 77 | 77 |
| 78 if (layoutObject.hasOverflowClip()) { | 78 if (layoutObject.hasOverflowClip()) { |
| 79 ClipRect newOverflowClip = toLayoutBox(layoutObject).overflowClipRect(of
fset, context.scrollbarRelevancy); | 79 ClipRect newOverflowClip = toLayoutBox(layoutObject).overflowClipRect(of
fset, context.scrollbarRelevancy); |
| 80 newOverflowClip.setHasRadius(layoutObject.style()->hasBorderRadius()); | 80 newOverflowClip.setHasRadius(layoutObject.style()->hasBorderRadius()); |
| 81 clipRects.setOverflowClipRect(intersection(newOverflowClip, clipRects.ov
erflowClipRect())); | 81 clipRects.setOverflowClipRect(intersection(newOverflowClip, clipRects.ov
erflowClipRect())); |
| 82 if (layoutObject.isPositioned()) | 82 if (layoutObject.isPositioned()) |
| 83 clipRects.setPosClipRect(intersection(newOverflowClip, clipRects.pos
ClipRect())); | 83 clipRects.setPosClipRect(intersection(newOverflowClip, clipRects.pos
ClipRect())); |
| 84 } | 84 } |
| 85 | 85 |
| 86 if (layoutObject.hasClip()) { | 86 if (layoutObject.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_layoutObject.layer() == context.rootLayer) | 328 if (m_layoutObject.layer() == context.rootLayer) |
| 329 parentClipRects->reset(LayoutRect(LayoutRect::infiniteIntRect())); | 329 parentClipRects->reset(LayoutRect(LayoutRect::infiniteIntRect())); |
| 330 else | 330 else |
| 331 m_layoutObject.layer()->parent()->clipper().getOrCalculateClipRects(cont
ext, *parentClipRects); | 331 m_layoutObject.layer()->parent()->clipper().getOrCalculateClipRects(cont
ext, *parentClipRects); |
| 332 | 332 |
| 333 ClipRect result = backgroundClipRectForPosition(*parentClipRects, m_layoutOb
ject.style()->position()); | 333 ClipRect result = backgroundClipRectForPosition(*parentClipRects, m_layoutOb
ject.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->layoutObject() == m_layou
tObject.view() && result != LayoutRect(LayoutRect::infiniteIntRect())) | 336 if (parentClipRects->fixed() && context.rootLayer->layoutObject() == m_layou
tObject.view() && result != LayoutRect(LayoutRect::infiniteIntRect())) |
| 337 result.move(m_layoutObject.view()->frameView()->scrollOffsetForViewportC
onstrainedObjects()); | 337 result.move(toIntSize(m_layoutObject.view()->frameView()->scrollPosition
())); |
| 338 | 338 |
| 339 return result; | 339 return result; |
| 340 } | 340 } |
| 341 | 341 |
| 342 void DeprecatedPaintLayerClipper::getOrCalculateClipRects(const ClipRectsContext
& context, ClipRects& clipRects) const | 342 void DeprecatedPaintLayerClipper::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<DeprecatedPaintLayer*>(current); | 367 return const_cast<DeprecatedPaintLayer*>(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 |