OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef LayoutItem_h | 5 #ifndef LayoutItem_h |
6 #define LayoutItem_h | 6 #define LayoutItem_h |
7 | 7 |
8 #include "core/inspector/InspectorTraceEvents.h" | 8 #include "core/inspector/InspectorTraceEvents.h" |
9 #include "core/layout/LayoutObject.h" | 9 #include "core/layout/LayoutObject.h" |
10 | 10 |
11 #include "wtf/Allocator.h" | 11 #include "wtf/Allocator.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 class FrameView; | 15 class FrameView; |
16 class LayoutAPIShim; | 16 class LayoutAPIShim; |
| 17 class LocalFrame; |
17 class LayoutViewItem; | 18 class LayoutViewItem; |
18 class Node; | 19 class Node; |
19 class ObjectPaintProperties; | 20 class ObjectPaintProperties; |
20 | 21 |
21 class LayoutItem { | 22 class LayoutItem { |
22 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 23 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
23 public: | 24 public: |
24 explicit LayoutItem(LayoutObject* layoutObject) | 25 explicit LayoutItem(LayoutObject* layoutObject) |
25 : m_layoutObject(layoutObject) | 26 : m_layoutObject(layoutObject) |
26 { | 27 { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 bool isLayoutView() const | 134 bool isLayoutView() const |
134 { | 135 { |
135 return m_layoutObject->isLayoutView(); | 136 return m_layoutObject->isLayoutView(); |
136 } | 137 } |
137 | 138 |
138 bool needsLayout() | 139 bool needsLayout() |
139 { | 140 { |
140 return m_layoutObject->needsLayout(); | 141 return m_layoutObject->needsLayout(); |
141 } | 142 } |
142 | 143 |
143 void setNeedsLayout(LayoutInvalidationReasonForTracing reason, MarkingBehavi
or marking = MarkContainerChain, SubtreeLayoutScope* scope = nullptr) | |
144 { | |
145 m_layoutObject->setNeedsLayout(reason, marking, scope); | |
146 } | |
147 | |
148 void layout() | 144 void layout() |
149 { | 145 { |
150 m_layoutObject->layout(); | 146 m_layoutObject->layout(); |
151 } | 147 } |
152 | 148 |
153 LayoutItem container() const | 149 LayoutItem container() const |
154 { | 150 { |
155 return LayoutItem(m_layoutObject->container()); | 151 return LayoutItem(m_layoutObject->container()); |
156 } | 152 } |
157 | 153 |
158 Node* node() const | 154 Node* node() const |
159 { | 155 { |
160 return m_layoutObject->node(); | 156 return m_layoutObject->node(); |
161 } | 157 } |
162 | 158 |
163 Document& document() const | 159 Document& document() const |
164 { | 160 { |
165 return m_layoutObject->document(); | 161 return m_layoutObject->document(); |
166 } | 162 } |
167 | 163 |
| 164 LocalFrame* frame() const |
| 165 { |
| 166 return m_layoutObject->frame(); |
| 167 } |
| 168 |
168 LayoutItem nextInPreOrder() const | 169 LayoutItem nextInPreOrder() const |
169 { | 170 { |
170 return LayoutItem(m_layoutObject->nextInPreOrder()); | 171 return LayoutItem(m_layoutObject->nextInPreOrder()); |
171 } | 172 } |
172 | 173 |
173 void updateStyleAndLayout() | 174 void updateStyleAndLayout() |
174 { | 175 { |
175 return m_layoutObject->document().updateStyleAndLayout(); | 176 return m_layoutObject->document().updateStyleAndLayout(); |
176 } | 177 } |
177 | 178 |
(...skipping 22 matching lines...) Expand all Loading... |
200 return m_layoutObject->offsetFromContainer(item.layoutObject()); | 201 return m_layoutObject->offsetFromContainer(item.layoutObject()); |
201 } | 202 } |
202 | 203 |
203 LayoutViewItem view() const; | 204 LayoutViewItem view() const; |
204 | 205 |
205 FrameView* frameView() const | 206 FrameView* frameView() const |
206 { | 207 { |
207 return m_layoutObject->document().view(); | 208 return m_layoutObject->document().view(); |
208 } | 209 } |
209 | 210 |
210 void setMayNeedPaintInvalidation() | |
211 { | |
212 m_layoutObject->setMayNeedPaintInvalidation(); | |
213 } | |
214 | |
215 const ComputedStyle* style() const | 211 const ComputedStyle* style() const |
216 { | 212 { |
217 return m_layoutObject->style(); | 213 return m_layoutObject->style(); |
218 } | 214 } |
219 | 215 |
220 PaintLayer* enclosingLayer() const | 216 PaintLayer* enclosingLayer() const |
221 { | 217 { |
222 return m_layoutObject->enclosingLayer(); | 218 return m_layoutObject->enclosingLayer(); |
223 } | 219 } |
224 | 220 |
225 bool hasLayer() const | 221 bool hasLayer() const |
226 { | 222 { |
227 return m_layoutObject->hasLayer(); | 223 return m_layoutObject->hasLayer(); |
228 } | 224 } |
229 | 225 |
| 226 void setNeedsLayout(LayoutInvalidationReasonForTracing reason, MarkingBehavi
or marking = MarkContainerChain, SubtreeLayoutScope* scope = nullptr) |
| 227 { |
| 228 m_layoutObject->setNeedsLayout(reason, marking, scope); |
| 229 } |
| 230 |
| 231 void setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReasonForTraci
ng reason, MarkingBehavior behavior = MarkContainerChain, SubtreeLayoutScope* sc
ope = nullptr) |
| 232 { |
| 233 m_layoutObject->setNeedsLayoutAndFullPaintInvalidation(reason, behavior,
scope); |
| 234 } |
| 235 |
| 236 void setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReasonForTracing re
ason) |
| 237 { |
| 238 m_layoutObject->setNeedsLayoutAndPrefWidthsRecalc(reason); |
| 239 } |
| 240 |
| 241 void setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalid
ationReasonForTracing reason) |
| 242 { |
| 243 m_layoutObject->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidatio
n(reason); |
| 244 } |
| 245 |
| 246 void setMayNeedPaintInvalidation() |
| 247 { |
| 248 m_layoutObject->setMayNeedPaintInvalidation(); |
| 249 } |
| 250 |
230 void setShouldDoFullPaintInvalidation(PaintInvalidationReason reason = Paint
InvalidationFull) | 251 void setShouldDoFullPaintInvalidation(PaintInvalidationReason reason = Paint
InvalidationFull) |
231 { | 252 { |
232 m_layoutObject->setShouldDoFullPaintInvalidation(reason); | 253 m_layoutObject->setShouldDoFullPaintInvalidation(reason); |
233 } | 254 } |
234 | 255 |
235 void setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants() | 256 void setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants() |
236 { | 257 { |
237 m_layoutObject->setShouldDoFullPaintInvalidationIncludingNonCompositingD
escendants(); | 258 m_layoutObject->setShouldDoFullPaintInvalidationIncludingNonCompositingD
escendants(); |
238 } | 259 } |
239 | 260 |
240 void computeLayerHitTestRects(LayerHitTestRects& layerRects) const | 261 void computeLayerHitTestRects(LayerHitTestRects& layerRects) const |
241 { | 262 { |
242 m_layoutObject->computeLayerHitTestRects(layerRects); | 263 m_layoutObject->computeLayerHitTestRects(layerRects); |
243 } | 264 } |
244 | 265 |
245 FloatQuad localToAbsoluteQuad(const FloatQuad& quad, MapCoordinatesFlags mod
e = 0) const | 266 FloatQuad localToAbsoluteQuad(const FloatQuad& quad, MapCoordinatesFlags mod
e = 0) const |
246 { | 267 { |
247 return m_layoutObject->localToAbsoluteQuad(quad, mode); | 268 return m_layoutObject->localToAbsoluteQuad(quad, mode); |
248 } | 269 } |
249 | 270 |
250 FloatPoint absoluteToLocal(const FloatPoint& point, MapCoordinatesFlags mode
= 0) const | 271 FloatPoint absoluteToLocal(const FloatPoint& point, MapCoordinatesFlags mode
= 0) const |
251 { | 272 { |
252 return m_layoutObject->absoluteToLocal(point, mode); | 273 return m_layoutObject->absoluteToLocal(point, mode); |
253 } | 274 } |
254 | 275 |
255 void setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReasonForTraci
ng reason, MarkingBehavior behavior = MarkContainerChain, SubtreeLayoutScope* sc
ope = nullptr) | |
256 { | |
257 m_layoutObject->setNeedsLayoutAndFullPaintInvalidation(reason, behavior,
scope); | |
258 } | |
259 | |
260 void setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReasonForTracing re
ason) | |
261 { | |
262 m_layoutObject->setNeedsLayoutAndPrefWidthsRecalc(reason); | |
263 } | |
264 | |
265 bool wasNotifiedOfSubtreeChange() const | 276 bool wasNotifiedOfSubtreeChange() const |
266 { | 277 { |
267 return m_layoutObject->wasNotifiedOfSubtreeChange(); | 278 return m_layoutObject->wasNotifiedOfSubtreeChange(); |
268 } | 279 } |
269 | 280 |
270 void handleSubtreeModifications() | 281 void handleSubtreeModifications() |
271 { | 282 { |
272 m_layoutObject->handleSubtreeModifications(); | 283 m_layoutObject->handleSubtreeModifications(); |
273 } | 284 } |
274 | 285 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 | 324 |
314 private: | 325 private: |
315 LayoutObject* m_layoutObject; | 326 LayoutObject* m_layoutObject; |
316 | 327 |
317 friend class LayoutAPIShim; | 328 friend class LayoutAPIShim; |
318 }; | 329 }; |
319 | 330 |
320 } // namespace blink | 331 } // namespace blink |
321 | 332 |
322 #endif // LayoutItem_h | 333 #endif // LayoutItem_h |
OLD | NEW |