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 3178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3189 } | 3189 } |
3190 | 3190 |
3191 if (hitLayer) | 3191 if (hitLayer) |
3192 return hitLayer; | 3192 return hitLayer; |
3193 } | 3193 } |
3194 } | 3194 } |
3195 | 3195 |
3196 return 0; | 3196 return 0; |
3197 } | 3197 } |
3198 | 3198 |
3199 IntRect RenderLayer::blockSelectionGapsBounds() | |
3200 { | |
3201 if (!renderer()->isRenderBlock()) | |
3202 return IntRect(); | |
3203 | |
3204 RenderBlock* renderBlock = toRenderBlock(renderer()); | |
3205 LayoutRect gapRects = renderBlock->selectionGapRectsForRepaint(renderBlock); | |
3206 | |
3207 return static_cast<IntRect>(gapRects); | |
Ian Vollick
2014/06/03 17:11:47
Please be explicit about this conversion. Eg, use
| |
3208 } | |
3209 | |
3210 void RenderLayer::blockSelectionGapsBoundsChanged() | |
3211 { | |
3212 if (needsCompositedScrolling() && hasCompositedLayerMapping()) | |
3213 m_compositedLayerMapping->updateScrollingContentsForSelectionGaps(blockS electionGapsBounds()); | |
3214 } | |
3215 | |
3199 void RenderLayer::addBlockSelectionGapsBounds(const LayoutRect& bounds) | 3216 void RenderLayer::addBlockSelectionGapsBounds(const LayoutRect& bounds) |
3200 { | 3217 { |
3201 m_blockSelectionGapsBounds.unite(enclosingIntRect(bounds)); | 3218 m_blockSelectionGapsBounds.unite(enclosingIntRect(bounds)); |
3219 blockSelectionGapsBoundsChanged(); | |
3202 } | 3220 } |
3203 | 3221 |
3204 void RenderLayer::clearBlockSelectionGapsBounds() | 3222 void RenderLayer::clearBlockSelectionGapsBounds() |
3205 { | 3223 { |
3206 m_blockSelectionGapsBounds = IntRect(); | 3224 m_blockSelectionGapsBounds = IntRect(); |
3207 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) | 3225 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) |
3208 child->clearBlockSelectionGapsBounds(); | 3226 child->clearBlockSelectionGapsBounds(); |
3227 blockSelectionGapsBoundsChanged(); | |
3209 } | 3228 } |
3210 | 3229 |
3211 void RenderLayer::repaintBlockSelectionGaps() | 3230 void RenderLayer::repaintBlockSelectionGaps() |
3212 { | 3231 { |
3213 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) | 3232 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) |
3214 child->repaintBlockSelectionGaps(); | 3233 child->repaintBlockSelectionGaps(); |
3215 | 3234 |
3216 if (m_blockSelectionGapsBounds.isEmpty()) | 3235 if (m_blockSelectionGapsBounds.isEmpty()) |
3217 return; | 3236 return; |
3218 | 3237 |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3927 } | 3946 } |
3928 } | 3947 } |
3929 | 3948 |
3930 void showLayerTree(const WebCore::RenderObject* renderer) | 3949 void showLayerTree(const WebCore::RenderObject* renderer) |
3931 { | 3950 { |
3932 if (!renderer) | 3951 if (!renderer) |
3933 return; | 3952 return; |
3934 showLayerTree(renderer->enclosingLayer()); | 3953 showLayerTree(renderer->enclosingLayer()); |
3935 } | 3954 } |
3936 #endif | 3955 #endif |
OLD | NEW |