| 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 4982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4993 outlineRect = backgroundRect; | 4993 outlineRect = backgroundRect; |
| 4994 | 4994 |
| 4995 LayoutPoint offset; | 4995 LayoutPoint offset; |
| 4996 if (offsetFromRoot) | 4996 if (offsetFromRoot) |
| 4997 offset = *offsetFromRoot; | 4997 offset = *offsetFromRoot; |
| 4998 else | 4998 else |
| 4999 convertToLayerCoords(clipRectsContext.rootLayer, offset); | 4999 convertToLayerCoords(clipRectsContext.rootLayer, offset); |
| 5000 layerBounds = LayoutRect(offset, size()); | 5000 layerBounds = LayoutRect(offset, size()); |
| 5001 | 5001 |
| 5002 // Update the clip rects that will be passed to child layers. | 5002 // Update the clip rects that will be passed to child layers. |
| 5003 if (renderer()->hasClipOrOverflowClip()) { | 5003 if (renderer()->hasOverflowClip()) { |
| 5004 // This layer establishes a clip of some kind. | 5004 // This layer establishes a clip of some kind. |
| 5005 if (renderer()->hasOverflowClip() && (this != clipRectsContext.rootLayer
|| clipRectsContext.respectOverflowClip == RespectOverflowClip)) { | 5005 if (this != clipRectsContext.rootLayer || clipRectsContext.respectOverfl
owClip == RespectOverflowClip) { |
| 5006 foregroundRect.intersect(toRenderBox(renderer())->overflowClipRect(o
ffset, clipRectsContext.region, clipRectsContext.overlayScrollbarSizeRelevancy))
; | 5006 foregroundRect.intersect(toRenderBox(renderer())->overflowClipRect(o
ffset, clipRectsContext.region, clipRectsContext.overlayScrollbarSizeRelevancy))
; |
| 5007 if (renderer()->style()->hasBorderRadius()) | 5007 if (renderer()->style()->hasBorderRadius()) |
| 5008 foregroundRect.setHasRadius(true); | 5008 foregroundRect.setHasRadius(true); |
| 5009 } | 5009 } |
| 5010 | 5010 |
| 5011 if (renderer()->hasClip()) { | 5011 // If we establish an overflow clip at all, then go ahead and make sure
our background |
| 5012 // Clip applies to *us* as well, so go ahead and update the damageRe
ct. | |
| 5013 LayoutRect newPosClip = toRenderBox(renderer())->clipRect(offset, cl
ipRectsContext.region); | |
| 5014 backgroundRect.intersect(newPosClip); | |
| 5015 foregroundRect.intersect(newPosClip); | |
| 5016 outlineRect.intersect(newPosClip); | |
| 5017 } | |
| 5018 | |
| 5019 // If we establish a clip at all, then go ahead and make sure our backgr
ound | |
| 5020 // rect is intersected with our layer's bounds including our visual over
flow, | 5012 // rect is intersected with our layer's bounds including our visual over
flow, |
| 5021 // since any visual overflow like box-shadow or border-outset is not cli
pped by overflow:auto/hidden. | 5013 // since any visual overflow like box-shadow or border-outset is not cli
pped by overflow:auto/hidden. |
| 5022 if (renderBox()->hasVisualOverflow()) { | 5014 if (renderBox()->hasVisualOverflow()) { |
| 5015 // FIXME: Perhaps we should be propagating the borderbox as the clip
rect for children, even though |
| 5016 // we may need to inflate our clip specifically for shadows o
r outsets. |
| 5023 // FIXME: Does not do the right thing with CSS regions yet, since we
don't yet factor in the | 5017 // FIXME: Does not do the right thing with CSS regions yet, since we
don't yet factor in the |
| 5024 // individual region boxes as overflow. | 5018 // individual region boxes as overflow. |
| 5025 LayoutRect layerBoundsWithVisualOverflow = renderBox()->visualOverfl
owRect(); | 5019 LayoutRect layerBoundsWithVisualOverflow = renderBox()->visualOverfl
owRect(); |
| 5026 renderBox()->flipForWritingMode(layerBoundsWithVisualOverflow); // L
ayers are in physical coordinates, so the overflow has to be flipped. | 5020 renderBox()->flipForWritingMode(layerBoundsWithVisualOverflow); // L
ayers are in physical coordinates, so the overflow has to be flipped. |
| 5027 layerBoundsWithVisualOverflow.moveBy(offset); | 5021 layerBoundsWithVisualOverflow.moveBy(offset); |
| 5028 if (this != clipRectsContext.rootLayer || clipRectsContext.respectOv
erflowClip == RespectOverflowClip) | 5022 if (this != clipRectsContext.rootLayer || clipRectsContext.respectOv
erflowClip == RespectOverflowClip) |
| 5029 backgroundRect.intersect(layerBoundsWithVisualOverflow); | 5023 backgroundRect.intersect(layerBoundsWithVisualOverflow); |
| 5030 } else if (renderer()->hasOverflowClip()) { | 5024 } else { |
| 5031 // Shift the bounds to be for our region only. | 5025 // Shift the bounds to be for our region only. |
| 5032 LayoutRect bounds = renderBox()->borderBoxRectInRegion(clipRectsCont
ext.region); | 5026 LayoutRect bounds = renderBox()->borderBoxRectInRegion(clipRectsCont
ext.region); |
| 5033 bounds.moveBy(offset); | 5027 bounds.moveBy(offset); |
| 5034 if (this != clipRectsContext.rootLayer || clipRectsContext.respectOv
erflowClip == RespectOverflowClip) | 5028 if (this != clipRectsContext.rootLayer || clipRectsContext.respectOv
erflowClip == RespectOverflowClip) |
| 5035 backgroundRect.intersect(bounds); | 5029 backgroundRect.intersect(bounds); |
| 5036 } | 5030 } |
| 5037 } | 5031 } |
| 5032 |
| 5033 // CSS clip (different than clipping due to overflow) can clip to any box, e
ven if it falls outside of the border box. |
| 5034 if (renderer()->hasClip()) { |
| 5035 // Clip applies to *us* as well, so go ahead and update the damageRect. |
| 5036 LayoutRect newPosClip = toRenderBox(renderer())->clipRect(offset, clipRe
ctsContext.region); |
| 5037 backgroundRect.intersect(newPosClip); |
| 5038 foregroundRect.intersect(newPosClip); |
| 5039 outlineRect.intersect(newPosClip); |
| 5040 } |
| 5038 } | 5041 } |
| 5039 | 5042 |
| 5040 LayoutRect RenderLayer::childrenClipRect() const | 5043 LayoutRect RenderLayer::childrenClipRect() const |
| 5041 { | 5044 { |
| 5042 // FIXME: border-radius not accounted for. | 5045 // FIXME: border-radius not accounted for. |
| 5043 // FIXME: Regions not accounted for. | 5046 // FIXME: Regions not accounted for. |
| 5044 RenderView* renderView = renderer()->view(); | 5047 RenderView* renderView = renderer()->view(); |
| 5045 RenderLayer* clippingRootLayer = clippingRootForPainting(); | 5048 RenderLayer* clippingRootLayer = clippingRootForPainting(); |
| 5046 LayoutRect layerBounds; | 5049 LayoutRect layerBounds; |
| 5047 ClipRect backgroundRect, foregroundRect, outlineRect; | 5050 ClipRect backgroundRect, foregroundRect, outlineRect; |
| (...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6395 } | 6398 } |
| 6396 } | 6399 } |
| 6397 | 6400 |
| 6398 void showLayerTree(const WebCore::RenderObject* renderer) | 6401 void showLayerTree(const WebCore::RenderObject* renderer) |
| 6399 { | 6402 { |
| 6400 if (!renderer) | 6403 if (!renderer) |
| 6401 return; | 6404 return; |
| 6402 showLayerTree(renderer->enclosingLayer()); | 6405 showLayerTree(renderer->enclosingLayer()); |
| 6403 } | 6406 } |
| 6404 #endif | 6407 #endif |
| OLD | NEW |