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 3198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3209 } | 3209 } |
3210 | 3210 |
3211 if (hitLayer) | 3211 if (hitLayer) |
3212 return hitLayer; | 3212 return hitLayer; |
3213 } | 3213 } |
3214 } | 3214 } |
3215 | 3215 |
3216 return 0; | 3216 return 0; |
3217 } | 3217 } |
3218 | 3218 |
| 3219 RenderLayer::PresenceOfBlockSelectionGaps RenderLayer::rendererHasBlockSelection
Gaps() |
| 3220 { |
| 3221 if (!renderer()->isRenderBlock()) |
| 3222 return LayerDoesNotHaveBlockSelectionGaps; |
| 3223 |
| 3224 RenderBlock* renderBlock = toRenderBlock(renderer()); |
| 3225 LayoutRect gapRects = renderBlock->selectionGapRectsForRepaint(renderBlock); |
| 3226 |
| 3227 return gapRects.isEmpty() ? LayerDoesNotHaveBlockSelectionGaps : LayerHasBlo
ckSelectionGaps; |
| 3228 } |
| 3229 |
| 3230 void RenderLayer::blockSelectionGapsBoundsChanged() |
| 3231 { |
| 3232 if (needsCompositedScrolling() && hasCompositedLayerMapping()) |
| 3233 m_compositedLayerMapping->updateScrollingContentsForSelectionGaps(); |
| 3234 } |
| 3235 |
3219 void RenderLayer::addBlockSelectionGapsBounds(const LayoutRect& bounds) | 3236 void RenderLayer::addBlockSelectionGapsBounds(const LayoutRect& bounds) |
3220 { | 3237 { |
3221 m_blockSelectionGapsBounds.unite(enclosingIntRect(bounds)); | 3238 m_blockSelectionGapsBounds.unite(enclosingIntRect(bounds)); |
| 3239 blockSelectionGapsBoundsChanged(); |
3222 } | 3240 } |
3223 | 3241 |
3224 void RenderLayer::clearBlockSelectionGapsBounds() | 3242 void RenderLayer::clearBlockSelectionGapsBounds() |
3225 { | 3243 { |
3226 m_blockSelectionGapsBounds = IntRect(); | 3244 m_blockSelectionGapsBounds = IntRect(); |
3227 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) | 3245 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) |
3228 child->clearBlockSelectionGapsBounds(); | 3246 child->clearBlockSelectionGapsBounds(); |
| 3247 blockSelectionGapsBoundsChanged(); |
3229 } | 3248 } |
3230 | 3249 |
3231 void RenderLayer::repaintBlockSelectionGaps() | 3250 void RenderLayer::repaintBlockSelectionGaps() |
3232 { | 3251 { |
3233 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) | 3252 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) |
3234 child->repaintBlockSelectionGaps(); | 3253 child->repaintBlockSelectionGaps(); |
3235 | 3254 |
3236 if (m_blockSelectionGapsBounds.isEmpty()) | 3255 if (m_blockSelectionGapsBounds.isEmpty()) |
3237 return; | 3256 return; |
3238 | 3257 |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3962 } | 3981 } |
3963 } | 3982 } |
3964 | 3983 |
3965 void showLayerTree(const WebCore::RenderObject* renderer) | 3984 void showLayerTree(const WebCore::RenderObject* renderer) |
3966 { | 3985 { |
3967 if (!renderer) | 3986 if (!renderer) |
3968 return; | 3987 return; |
3969 showLayerTree(renderer->enclosingLayer()); | 3988 showLayerTree(renderer->enclosingLayer()); |
3970 } | 3989 } |
3971 #endif | 3990 #endif |
OLD | NEW |