| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
| 4 * | 4 * |
| 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 6 * | 6 * |
| 7 * Other contributors: | 7 * Other contributors: |
| 8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
| 10 * Christian Biesinger <cbiesinger@web.de> | 10 * Christian Biesinger <cbiesinger@web.de> |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // #container and thus 'overflow' doesn't apply to it. During our tree walk, | 140 // #container and thus 'overflow' doesn't apply to it. During our tree walk, |
| 141 // #fixed is a child of #container, which is the reason why we keep 3 clip rects | 141 // #fixed is a child of #container, which is the reason why we keep 3 clip rects |
| 142 // depending on the 'position' of the elements. | 142 // depending on the 'position' of the elements. |
| 143 // | 143 // |
| 144 // Now instead if we add "clip: rect(0px, 100px, 100px, 0px)" to #container, | 144 // Now instead if we add "clip: rect(0px, 100px, 100px, 0px)" to #container, |
| 145 // the clip will apply to both #inflow and #fixed. That's because 'clip' | 145 // the clip will apply to both #inflow and #fixed. That's because 'clip' |
| 146 // applies to any descendant, regardless of containing blocks. Note that | 146 // applies to any descendant, regardless of containing blocks. Note that |
| 147 // #container and #fixed are siblings in the paint tree but #container does | 147 // #container and #fixed are siblings in the paint tree but #container does |
| 148 // clip #fixed. This is the reason why we compute the painting clip rects during | 148 // clip #fixed. This is the reason why we compute the painting clip rects during |
| 149 // a layout tree walk and cache them for painting. | 149 // a layout tree walk and cache them for painting. |
| 150 class PaintLayerClipper { | 150 class CORE_EXPORT PaintLayerClipper { |
| 151 DISALLOW_NEW(); | 151 DISALLOW_NEW(); |
| 152 WTF_MAKE_NONCOPYABLE(PaintLayerClipper); | 152 WTF_MAKE_NONCOPYABLE(PaintLayerClipper); |
| 153 public: | 153 public: |
| 154 explicit PaintLayerClipper(const LayoutBoxModelObject&); | 154 explicit PaintLayerClipper(const LayoutBoxModelObject&); |
| 155 | 155 |
| 156 void clearClipRectsIncludingDescendants(); | 156 void clearClipRectsIncludingDescendants(); |
| 157 void clearClipRectsIncludingDescendants(ClipRectsCacheSlot); | 157 void clearClipRectsIncludingDescendants(ClipRectsCacheSlot); |
| 158 | 158 |
| 159 LayoutRect childrenClipRect() const; // Returns the foreground clip rect of
the layer in the document's coordinate space. | 159 LayoutRect childrenClipRect() const; // Returns the foreground clip rect of
the layer in the absolute coordinate space. |
| 160 LayoutRect localClipRect() const; // Returns the background clip rect of the
layer in the local coordinate space. | 160 LayoutRect localClipRect() const; // Returns the background clip rect of the
layer in the local coordinate space. |
| 161 | 161 |
| 162 ClipRect backgroundClipRect(const ClipRectsContext&) const; | 162 ClipRect backgroundClipRect(const ClipRectsContext&) const; |
| 163 | 163 |
| 164 // This method figures out our layerBounds in coordinates relative to | 164 // This method figures out our layerBounds in coordinates relative to |
| 165 // |rootLayer|. It also computes our background and foreground clip rects | 165 // |rootLayer|. It also computes our background and foreground clip rects |
| 166 // for painting/event handling. | 166 // for painting/event handling. |
| 167 // Pass offsetFromRoot if known. | 167 // Pass offsetFromRoot if known. |
| 168 void calculateRects(const ClipRectsContext&, const LayoutRect& paintDirtyRec
t, LayoutRect& layerBounds, | 168 void calculateRects(const ClipRectsContext&, const LayoutRect& paintDirtyRec
t, LayoutRect& layerBounds, |
| 169 ClipRect& backgroundRect, ClipRect& foregroundRect, const LayoutPoint* o
ffsetFromRoot = 0) const; | 169 ClipRect& backgroundRect, ClipRect& foregroundRect, const LayoutPoint* o
ffsetFromRoot = 0) const; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 196 // FIXME: Could this be a LayoutBox? | 196 // FIXME: Could this be a LayoutBox? |
| 197 const LayoutBoxModelObject& m_layoutObject; | 197 const LayoutBoxModelObject& m_layoutObject; |
| 198 | 198 |
| 199 // Lazily created by 'cache() const'. | 199 // Lazily created by 'cache() const'. |
| 200 mutable OwnPtr<ClipRectsCache> m_cache; | 200 mutable OwnPtr<ClipRectsCache> m_cache; |
| 201 }; | 201 }; |
| 202 | 202 |
| 203 } // namespace blink | 203 } // namespace blink |
| 204 | 204 |
| 205 #endif // LayerClipper_h | 205 #endif // LayerClipper_h |
| OLD | NEW |