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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 const DeprecatedPaintLayerReflectionInfo* reflectionInfo() const { return m_ reflectionInfo.get(); } | 135 const DeprecatedPaintLayerReflectionInfo* reflectionInfo() const { return m_ reflectionInfo.get(); } |
136 | 136 |
137 const DeprecatedPaintLayer* root() const | 137 const DeprecatedPaintLayer* root() const |
138 { | 138 { |
139 const DeprecatedPaintLayer* curr = this; | 139 const DeprecatedPaintLayer* curr = this; |
140 while (curr->parent()) | 140 while (curr->parent()) |
141 curr = curr->parent(); | 141 curr = curr->parent(); |
142 return curr; | 142 return curr; |
143 } | 143 } |
144 | 144 |
145 const LayoutPoint& location() const { ASSERT(!m_needsPositionUpdate); return m_location; } | 145 enum LocationQueryBehavior { |
146 IncludeScroll, | |
147 ExcludeScroll | |
148 }; | |
149 LayoutPoint location(LocationQueryBehavior behavior = IncludeScroll) const { ASSERT(!m_needsPositionUpdate); return behavior == IncludeScroll ? m_location : locationExcludeOverflowScroll(); } | |
150 // Note: This function is only needed during the transition period to SPv2. | |
151 // Once we have eliminated layer-based hit testing and clipping, | |
152 // we can cache the unscrolled location instead. | |
153 LayoutPoint locationExcludeOverflowScroll() const; | |
jbroman
2015/09/09 19:58:30
nit: "locationExcludingOverflowScroll", please? I
trchen
2015/09/15 04:48:40
Done.
| |
146 // FIXME: size() should ASSERT(!m_needsPositionUpdate) as well, but that fai ls in some tests, | 154 // FIXME: size() should ASSERT(!m_needsPositionUpdate) as well, but that fai ls in some tests, |
147 // for example, fast/repaint/clipped-relative.html. | 155 // for example, fast/repaint/clipped-relative.html. |
148 const IntSize& size() const { return m_size; } | 156 const IntSize& size() const { return m_size; } |
149 void setSizeHackForLayoutTreeAsText(const IntSize& size) { m_size = size; } | 157 void setSizeHackForLayoutTreeAsText(const IntSize& size) { m_size = size; } |
150 | 158 |
151 LayoutRect rect() const { return LayoutRect(location(), LayoutSize(size())); } | 159 LayoutRect rect() const { return LayoutRect(location(), LayoutSize(size())); } |
152 | 160 |
153 bool isRootLayer() const { return m_isRootLayer; } | 161 bool isRootLayer() const { return m_isRootLayer; } |
154 | 162 |
155 DeprecatedPaintLayerCompositor* compositor() const; | 163 DeprecatedPaintLayerCompositor* compositor() const; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 DeprecatedPaintLayer* enclosingLayerForPaintInvalidationCrossingFrameBoundar ies() const; | 228 DeprecatedPaintLayer* enclosingLayerForPaintInvalidationCrossingFrameBoundar ies() const; |
221 | 229 |
222 bool hasAncestorWithFilterOutsets() const; | 230 bool hasAncestorWithFilterOutsets() const; |
223 | 231 |
224 bool canUseConvertToLayerCoords() const | 232 bool canUseConvertToLayerCoords() const |
225 { | 233 { |
226 // These LayoutObjects have an impact on their layers without the layout Objects knowing about it. | 234 // These LayoutObjects have an impact on their layers without the layout Objects knowing about it. |
227 return !layoutObject()->hasTransformRelatedProperty() && !layoutObject() ->isSVGRoot(); | 235 return !layoutObject()->hasTransformRelatedProperty() && !layoutObject() ->isSVGRoot(); |
228 } | 236 } |
229 | 237 |
230 void convertToLayerCoords(const DeprecatedPaintLayer* ancestorLayer, LayoutP oint&) const; | 238 void convertToLayerCoords(const DeprecatedPaintLayer* ancestorLayer, LayoutP oint&, LocationQueryBehavior = IncludeScroll) const; |
231 void convertToLayerCoords(const DeprecatedPaintLayer* ancestorLayer, LayoutR ect&) const; | 239 void convertToLayerCoords(const DeprecatedPaintLayer* ancestorLayer, LayoutR ect&) const; |
232 | 240 |
233 // Does the same as convertToLayerCoords() when not in multicol. For multico l, however, | 241 // Does the same as convertToLayerCoords() when not in multicol. For multico l, however, |
234 // convertToLayerCoords() calculates the offset in flow-thread coordinates ( what the layout | 242 // convertToLayerCoords() calculates the offset in flow-thread coordinates ( what the layout |
235 // engine uses internally), while this method calculates the visual coordina tes; i.e. it figures | 243 // engine uses internally), while this method calculates the visual coordina tes; i.e. it figures |
236 // out which column the layer starts in and adds in the offset. See | 244 // out which column the layer starts in and adds in the offset. See |
237 // http://www.chromium.org/developers/design-documents/multi-column-layout f or more info. | 245 // http://www.chromium.org/developers/design-documents/multi-column-layout f or more info. |
238 LayoutPoint visualOffsetFromAncestor(const DeprecatedPaintLayer* ancestorLay er) const; | 246 LayoutPoint visualOffsetFromAncestor(const DeprecatedPaintLayer* ancestorLay er) const; |
239 | 247 |
240 // The hitTest() method looks for mouse events by walking layers that inters ect the point from front to back. | 248 // The hitTest() method looks for mouse events by walking layers that inters ect the point from front to back. |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
740 | 748 |
741 } // namespace blink | 749 } // namespace blink |
742 | 750 |
743 #ifndef NDEBUG | 751 #ifndef NDEBUG |
744 // Outside the WebCore namespace for ease of invocation from gdb. | 752 // Outside the WebCore namespace for ease of invocation from gdb. |
745 void showLayerTree(const blink::DeprecatedPaintLayer*); | 753 void showLayerTree(const blink::DeprecatedPaintLayer*); |
746 void showLayerTree(const blink::LayoutObject*); | 754 void showLayerTree(const blink::LayoutObject*); |
747 #endif | 755 #endif |
748 | 756 |
749 #endif // Layer_h | 757 #endif // Layer_h |
OLD | NEW |