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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 backgroundRect.intersect(newPosClip); | 234 backgroundRect.intersect(newPosClip); |
235 backgroundRect.setIsClippedByClipCss(); | 235 backgroundRect.setIsClippedByClipCss(); |
236 foregroundRect.intersect(newPosClip); | 236 foregroundRect.intersect(newPosClip); |
237 foregroundRect.setIsClippedByClipCss(); | 237 foregroundRect.setIsClippedByClipCss(); |
238 } | 238 } |
239 } | 239 } |
240 | 240 |
241 void PaintLayerClipper::calculateClipRects(const ClipRectsContext& context, Clip
Rects& clipRects) const | 241 void PaintLayerClipper::calculateClipRects(const ClipRectsContext& context, Clip
Rects& clipRects) const |
242 { | 242 { |
243 const LayoutBoxModelObject& layoutObject = *m_layer.layoutObject(); | 243 const LayoutBoxModelObject& layoutObject = *m_layer.layoutObject(); |
244 bool rootLayerScrolls = layoutObject.document().settings() && layoutObject.d
ocument().settings()->rootLayerScrolls(); | 244 if (!m_layer.parent() && !RuntimeEnabledFeatures::rootLayerScrollingEnabled(
)) { |
245 if (!m_layer.parent() && !rootLayerScrolls) { | |
246 // The root layer's clip rect is always infinite. | 245 // The root layer's clip rect is always infinite. |
247 clipRects.reset(LayoutRect(LayoutRect::infiniteIntRect())); | 246 clipRects.reset(LayoutRect(LayoutRect::infiniteIntRect())); |
248 return; | 247 return; |
249 } | 248 } |
250 | 249 |
251 bool isClippingRoot = &m_layer == context.rootLayer; | 250 bool isClippingRoot = &m_layer == context.rootLayer; |
252 | 251 |
253 // For transformed layers, the root layer was shifted to be us, so there is
no need to | 252 // For transformed layers, the root layer was shifted to be us, so there is
no need to |
254 // examine the parent. We want to cache clip rects with us as the root. | 253 // examine the parent. We want to cache clip rects with us as the root. |
255 PaintLayer* parentLayer = !isClippingRoot ? m_layer.parent() : nullptr; | 254 PaintLayer* parentLayer = !isClippingRoot ? m_layer.parent() : nullptr; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 325 |
327 ClipRects& PaintLayerClipper::paintingClipRects(const PaintLayer* rootLayer, Sho
uldRespectOverflowClipType respectOverflowClip, const LayoutSize& subpixelAccumu
lation) const | 326 ClipRects& PaintLayerClipper::paintingClipRects(const PaintLayer* rootLayer, Sho
uldRespectOverflowClipType respectOverflowClip, const LayoutSize& subpixelAccumu
lation) const |
328 { | 327 { |
329 ClipRectsContext context(rootLayer, PaintingClipRects, IgnoreOverlayScrollba
rSize, subpixelAccumulation); | 328 ClipRectsContext context(rootLayer, PaintingClipRects, IgnoreOverlayScrollba
rSize, subpixelAccumulation); |
330 if (respectOverflowClip == IgnoreOverflowClip) | 329 if (respectOverflowClip == IgnoreOverflowClip) |
331 context.setIgnoreOverflowClip(); | 330 context.setIgnoreOverflowClip(); |
332 return getClipRects(context); | 331 return getClipRects(context); |
333 } | 332 } |
334 | 333 |
335 } // namespace blink | 334 } // namespace blink |
OLD | NEW |