OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r
ights reserved. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
11 * License as published by the Free Software Foundation; either | 11 * License as published by the Free Software Foundation; either |
12 * version 2 of the License, or (at your option) any later version. | 12 * version 2 of the License, or (at your option) any later version. |
13 * | 13 * |
14 * This library is distributed in the hope that it will be useful, | 14 * This library is distributed in the hope that it will be useful, |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 * Library General Public License for more details. | 17 * Library General Public License for more details. |
18 * | 18 * |
19 * You should have received a copy of the GNU Library General Public License | 19 * You should have received a copy of the GNU Library General Public License |
20 * along with this library; see the file COPYING.LIB. If not, write to | 20 * along with this library; see the file COPYING.LIB. If not, write to |
21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
22 * Boston, MA 02110-1301, USA. | 22 * Boston, MA 02110-1301, USA. |
23 * | 23 * |
24 */ | 24 */ |
25 | 25 |
26 #ifndef RenderObject_h | 26 #ifndef LayoutObject_h |
27 #define RenderObject_h | 27 #define LayoutObject_h |
28 | 28 |
29 #include "core/dom/Document.h" | 29 #include "core/dom/Document.h" |
30 #include "core/dom/DocumentLifecycle.h" | 30 #include "core/dom/DocumentLifecycle.h" |
31 #include "core/dom/Element.h" | 31 #include "core/dom/Element.h" |
32 #include "core/editing/TextAffinity.h" | 32 #include "core/editing/TextAffinity.h" |
33 #include "core/fetch/ImageResourceClient.h" | 33 #include "core/fetch/ImageResourceClient.h" |
34 #include "core/html/HTMLElement.h" | 34 #include "core/html/HTMLElement.h" |
35 #include "core/inspector/InspectorTraceEvents.h" | 35 #include "core/inspector/InspectorTraceEvents.h" |
36 #include "core/layout/HitTestRequest.h" | 36 #include "core/layout/HitTestRequest.h" |
| 37 #include "core/layout/LayoutObjectChildList.h" |
37 #include "core/layout/compositing/CompositingState.h" | 38 #include "core/layout/compositing/CompositingState.h" |
38 #include "core/layout/compositing/CompositingTriggers.h" | 39 #include "core/layout/compositing/CompositingTriggers.h" |
39 #include "core/rendering/PaintInvalidationState.h" | 40 #include "core/rendering/PaintInvalidationState.h" |
40 #include "core/rendering/PaintPhase.h" | 41 #include "core/rendering/PaintPhase.h" |
41 #include "core/rendering/RenderObjectChildList.h" | |
42 #include "core/rendering/ScrollAlignment.h" | 42 #include "core/rendering/ScrollAlignment.h" |
43 #include "core/rendering/SubtreeLayoutScope.h" | 43 #include "core/rendering/SubtreeLayoutScope.h" |
44 #include "core/rendering/style/RenderStyle.h" | 44 #include "core/rendering/style/RenderStyle.h" |
45 #include "core/rendering/style/StyleInheritedData.h" | 45 #include "core/rendering/style/StyleInheritedData.h" |
46 #include "platform/geometry/FloatQuad.h" | 46 #include "platform/geometry/FloatQuad.h" |
47 #include "platform/geometry/LayoutRect.h" | 47 #include "platform/geometry/LayoutRect.h" |
48 #include "platform/graphics/CompositingReasons.h" | 48 #include "platform/graphics/CompositingReasons.h" |
49 #include "platform/graphics/PaintInvalidationReason.h" | 49 #include "platform/graphics/PaintInvalidationReason.h" |
50 #include "platform/graphics/paint/DisplayItemClient.h" | 50 #include "platform/graphics/paint/DisplayItemClient.h" |
51 #include "platform/transforms/TransformationMatrix.h" | 51 #include "platform/transforms/TransformationMatrix.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 bool draggable; | 119 bool draggable; |
120 }; | 120 }; |
121 | 121 |
122 typedef WTF::HashMap<const Layer*, Vector<LayoutRect>> LayerHitTestRects; | 122 typedef WTF::HashMap<const Layer*, Vector<LayoutRect>> LayerHitTestRects; |
123 | 123 |
124 #ifndef NDEBUG | 124 #ifndef NDEBUG |
125 const int showTreeCharacterOffset = 39; | 125 const int showTreeCharacterOffset = 39; |
126 #endif | 126 #endif |
127 | 127 |
128 // Base class for all rendering tree objects. | 128 // Base class for all rendering tree objects. |
129 class RenderObject : public ImageResourceClient { | 129 class LayoutObject : public ImageResourceClient { |
130 friend class RenderBlock; | 130 friend class RenderBlock; |
131 friend class RenderBlockFlow; | 131 friend class RenderBlockFlow; |
132 friend class LayerReflectionInfo; // For setParent | 132 friend class LayerReflectionInfo; // For setParent |
133 friend class LayerScrollableArea; // For setParent. | 133 friend class LayerScrollableArea; // For setParent. |
134 friend class RenderObjectChildList; | 134 friend class LayoutObjectChildList; |
135 WTF_MAKE_NONCOPYABLE(RenderObject); | 135 WTF_MAKE_NONCOPYABLE(LayoutObject); |
136 public: | 136 public: |
137 // Anonymous objects should pass the document as their node, and they will t
hen automatically be | 137 // Anonymous objects should pass the document as their node, and they will t
hen automatically be |
138 // marked as anonymous in the constructor. | 138 // marked as anonymous in the constructor. |
139 explicit RenderObject(Node*); | 139 explicit LayoutObject(Node*); |
140 virtual ~RenderObject(); | 140 virtual ~LayoutObject(); |
141 | 141 |
142 virtual const char* renderName() const = 0; | 142 virtual const char* renderName() const = 0; |
143 | 143 |
144 String debugName() const; | 144 String debugName() const; |
145 | 145 |
146 RenderObject* parent() const { return m_parent; } | 146 LayoutObject* parent() const { return m_parent; } |
147 bool isDescendantOf(const RenderObject*) const; | 147 bool isDescendantOf(const LayoutObject*) const; |
148 | 148 |
149 RenderObject* previousSibling() const { return m_previous; } | 149 LayoutObject* previousSibling() const { return m_previous; } |
150 RenderObject* nextSibling() const { return m_next; } | 150 LayoutObject* nextSibling() const { return m_next; } |
151 | 151 |
152 RenderObject* slowFirstChild() const | 152 LayoutObject* slowFirstChild() const |
153 { | 153 { |
154 if (const RenderObjectChildList* children = virtualChildren()) | 154 if (const LayoutObjectChildList* children = virtualChildren()) |
155 return children->firstChild(); | 155 return children->firstChild(); |
156 return 0; | 156 return 0; |
157 } | 157 } |
158 RenderObject* slowLastChild() const | 158 LayoutObject* slowLastChild() const |
159 { | 159 { |
160 if (const RenderObjectChildList* children = virtualChildren()) | 160 if (const LayoutObjectChildList* children = virtualChildren()) |
161 return children->lastChild(); | 161 return children->lastChild(); |
162 return 0; | 162 return 0; |
163 } | 163 } |
164 | 164 |
165 virtual RenderObjectChildList* virtualChildren() { return 0; } | 165 virtual LayoutObjectChildList* virtualChildren() { return 0; } |
166 virtual const RenderObjectChildList* virtualChildren() const { return 0; } | 166 virtual const LayoutObjectChildList* virtualChildren() const { return 0; } |
167 | 167 |
168 RenderObject* nextInPreOrder() const; | 168 LayoutObject* nextInPreOrder() const; |
169 RenderObject* nextInPreOrder(const RenderObject* stayWithin) const; | 169 LayoutObject* nextInPreOrder(const LayoutObject* stayWithin) const; |
170 RenderObject* nextInPreOrderAfterChildren() const; | 170 LayoutObject* nextInPreOrderAfterChildren() const; |
171 RenderObject* nextInPreOrderAfterChildren(const RenderObject* stayWithin) co
nst; | 171 LayoutObject* nextInPreOrderAfterChildren(const LayoutObject* stayWithin) co
nst; |
172 RenderObject* previousInPreOrder() const; | 172 LayoutObject* previousInPreOrder() const; |
173 RenderObject* previousInPreOrder(const RenderObject* stayWithin) const; | 173 LayoutObject* previousInPreOrder(const LayoutObject* stayWithin) const; |
174 RenderObject* childAt(unsigned) const; | 174 LayoutObject* childAt(unsigned) const; |
175 | 175 |
176 RenderObject* lastLeafChild() const; | 176 LayoutObject* lastLeafChild() const; |
177 | 177 |
178 // The following six functions are used when the render tree hierarchy chang
es to make sure layers get | 178 // The following six functions are used when the render tree hierarchy chang
es to make sure layers get |
179 // properly added and removed. Since containership can be implemented by an
y subclass, and since a hierarchy | 179 // properly added and removed. Since containership can be implemented by an
y subclass, and since a hierarchy |
180 // can contain a mixture of boxes and other object types, these functions ne
ed to be in the base class. | 180 // can contain a mixture of boxes and other object types, these functions ne
ed to be in the base class. |
181 Layer* enclosingLayer() const; | 181 Layer* enclosingLayer() const; |
182 void addLayers(Layer* parentLayer); | 182 void addLayers(Layer* parentLayer); |
183 void removeLayers(Layer* parentLayer); | 183 void removeLayers(Layer* parentLayer); |
184 void moveLayers(Layer* oldParent, Layer* newParent); | 184 void moveLayers(Layer* oldParent, Layer* newParent); |
185 Layer* findNextLayer(Layer* parentLayer, RenderObject* startPoint, bool chec
kParent = true); | 185 Layer* findNextLayer(Layer* parentLayer, LayoutObject* startPoint, bool chec
kParent = true); |
186 | 186 |
187 // Scrolling is a RenderBox concept, however some code just cares about recu
rsively scrolling our enclosing ScrollableArea(s). | 187 // Scrolling is a RenderBox concept, however some code just cares about recu
rsively scrolling our enclosing ScrollableArea(s). |
188 bool scrollRectToVisible(const LayoutRect&, const ScrollAlignment& alignX =
ScrollAlignment::alignCenterIfNeeded, const ScrollAlignment& alignY = ScrollAlig
nment::alignCenterIfNeeded); | 188 bool scrollRectToVisible(const LayoutRect&, const ScrollAlignment& alignX =
ScrollAlignment::alignCenterIfNeeded, const ScrollAlignment& alignY = ScrollAlig
nment::alignCenterIfNeeded); |
189 | 189 |
190 // Convenience function for getting to the nearest enclosing box of a Render
Object. | 190 // Convenience function for getting to the nearest enclosing box of a Layout
Object. |
191 RenderBox* enclosingBox() const; | 191 RenderBox* enclosingBox() const; |
192 RenderBoxModelObject* enclosingBoxModelObject() const; | 192 RenderBoxModelObject* enclosingBoxModelObject() const; |
193 | 193 |
194 RenderBox* enclosingScrollableBox() const; | 194 RenderBox* enclosingScrollableBox() const; |
195 | 195 |
196 // Function to return our enclosing flow thread if we are contained inside o
ne. This | 196 // Function to return our enclosing flow thread if we are contained inside o
ne. This |
197 // function follows the containing block chain. | 197 // function follows the containing block chain. |
198 RenderFlowThread* flowThreadContainingBlock() const | 198 RenderFlowThread* flowThreadContainingBlock() const |
199 { | 199 { |
200 if (flowThreadState() == NotInsideFlowThread) | 200 if (flowThreadState() == NotInsideFlowThread) |
201 return 0; | 201 return 0; |
202 return locateFlowThreadContainingBlock(); | 202 return locateFlowThreadContainingBlock(); |
203 } | 203 } |
204 | 204 |
205 #if ENABLE(ASSERT) | 205 #if ENABLE(ASSERT) |
206 void setHasAXObject(bool flag) { m_hasAXObject = flag; } | 206 void setHasAXObject(bool flag) { m_hasAXObject = flag; } |
207 bool hasAXObject() const { return m_hasAXObject; } | 207 bool hasAXObject() const { return m_hasAXObject; } |
208 | 208 |
209 // Helper class forbidding calls to setNeedsLayout() during its lifetime. | 209 // Helper class forbidding calls to setNeedsLayout() during its lifetime. |
210 class SetLayoutNeededForbiddenScope { | 210 class SetLayoutNeededForbiddenScope { |
211 public: | 211 public: |
212 explicit SetLayoutNeededForbiddenScope(RenderObject&); | 212 explicit SetLayoutNeededForbiddenScope(LayoutObject&); |
213 ~SetLayoutNeededForbiddenScope(); | 213 ~SetLayoutNeededForbiddenScope(); |
214 private: | 214 private: |
215 RenderObject& m_renderObject; | 215 LayoutObject& m_layoutObject; |
216 bool m_preexistingForbidden; | 216 bool m_preexistingForbidden; |
217 }; | 217 }; |
218 | 218 |
219 void assertRendererLaidOut() const | 219 void assertRendererLaidOut() const |
220 { | 220 { |
221 #ifndef NDEBUG | 221 #ifndef NDEBUG |
222 if (needsLayout()) | 222 if (needsLayout()) |
223 showRenderTreeForThis(); | 223 showRenderTreeForThis(); |
224 #endif | 224 #endif |
225 ASSERT_WITH_SECURITY_IMPLICATION(!needsLayout()); | 225 ASSERT_WITH_SECURITY_IMPLICATION(!needsLayout()); |
226 } | 226 } |
227 | 227 |
228 void assertSubtreeIsLaidOut() const | 228 void assertSubtreeIsLaidOut() const |
229 { | 229 { |
230 for (const RenderObject* renderer = this; renderer; renderer = renderer-
>nextInPreOrder()) | 230 for (const LayoutObject* renderer = this; renderer; renderer = renderer-
>nextInPreOrder()) |
231 renderer->assertRendererLaidOut(); | 231 renderer->assertRendererLaidOut(); |
232 } | 232 } |
233 | 233 |
234 void assertRendererClearedPaintInvalidationState() const | 234 void assertRendererClearedPaintInvalidationState() const |
235 { | 235 { |
236 #ifndef NDEBUG | 236 #ifndef NDEBUG |
237 if (paintInvalidationStateIsDirty()) { | 237 if (paintInvalidationStateIsDirty()) { |
238 showRenderTreeForThis(); | 238 showRenderTreeForThis(); |
239 ASSERT_NOT_REACHED(); | 239 ASSERT_NOT_REACHED(); |
240 } | 240 } |
241 #endif | 241 #endif |
242 } | 242 } |
243 | 243 |
244 void assertSubtreeClearedPaintInvalidationState() const | 244 void assertSubtreeClearedPaintInvalidationState() const |
245 { | 245 { |
246 for (const RenderObject* renderer = this; renderer; renderer = renderer-
>nextInPreOrder()) | 246 for (const LayoutObject* renderer = this; renderer; renderer = renderer-
>nextInPreOrder()) |
247 renderer->assertRendererClearedPaintInvalidationState(); | 247 renderer->assertRendererClearedPaintInvalidationState(); |
248 } | 248 } |
249 | 249 |
250 #endif | 250 #endif |
251 | 251 |
252 // FIXME: This could be used when changing the size of a renderer without ch
ildren to skip some invalidations. | 252 // FIXME: This could be used when changing the size of a renderer without ch
ildren to skip some invalidations. |
253 bool rendererHasNoBoxEffect() const | 253 bool rendererHasNoBoxEffect() const |
254 { | 254 { |
255 return !style()->hasVisualOverflowingEffect() && !style()->hasBorder() &
& !style()->hasBackground(); | 255 return !style()->hasVisualOverflowingEffect() && !style()->hasBorder() &
& !style()->hasBackground(); |
256 } | 256 } |
257 | 257 |
258 // Obtains the nearest enclosing block (including this block) that contribut
es a first-line style to our inline | 258 // Obtains the nearest enclosing block (including this block) that contribut
es a first-line style to our inline |
259 // children. | 259 // children. |
260 virtual RenderBlock* firstLineBlock() const; | 260 virtual RenderBlock* firstLineBlock() const; |
261 | 261 |
262 // Called when an object that was floating or positioned becomes a normal fl
ow object | 262 // Called when an object that was floating or positioned becomes a normal fl
ow object |
263 // again. We have to make sure the render tree updates as needed to accommo
date the new | 263 // again. We have to make sure the render tree updates as needed to accommo
date the new |
264 // normal flow object. | 264 // normal flow object. |
265 void handleDynamicFloatPositionChange(); | 265 void handleDynamicFloatPositionChange(); |
266 | 266 |
267 // RenderObject tree manipulation | 267 // LayoutObject tree manipulation |
268 ////////////////////////////////////////// | 268 ////////////////////////////////////////// |
269 virtual bool canHaveChildren() const { return virtualChildren(); } | 269 virtual bool canHaveChildren() const { return virtualChildren(); } |
270 virtual bool canHaveGeneratedChildren() const; | 270 virtual bool canHaveGeneratedChildren() const; |
271 virtual bool isChildAllowed(RenderObject*, const RenderStyle&) const { retur
n true; } | 271 virtual bool isChildAllowed(LayoutObject*, const RenderStyle&) const { retur
n true; } |
272 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0)
; | 272 virtual void addChild(LayoutObject* newChild, LayoutObject* beforeChild = 0)
; |
273 virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObje
ct* beforeChild = 0) { return addChild(newChild, beforeChild); } | 273 virtual void addChildIgnoringContinuation(LayoutObject* newChild, LayoutObje
ct* beforeChild = 0) { return addChild(newChild, beforeChild); } |
274 virtual void removeChild(RenderObject*); | 274 virtual void removeChild(LayoutObject*); |
275 virtual bool createsAnonymousWrapper() const { return false; } | 275 virtual bool createsAnonymousWrapper() const { return false; } |
276 ////////////////////////////////////////// | 276 ////////////////////////////////////////// |
277 | 277 |
278 protected: | 278 protected: |
279 ////////////////////////////////////////// | 279 ////////////////////////////////////////// |
280 // Helper functions. Dangerous to use! | 280 // Helper functions. Dangerous to use! |
281 void setPreviousSibling(RenderObject* previous) { m_previous = previous; } | 281 void setPreviousSibling(LayoutObject* previous) { m_previous = previous; } |
282 void setNextSibling(RenderObject* next) { m_next = next; } | 282 void setNextSibling(LayoutObject* next) { m_next = next; } |
283 void setParent(RenderObject* parent) | 283 void setParent(LayoutObject* parent) |
284 { | 284 { |
285 m_parent = parent; | 285 m_parent = parent; |
286 | 286 |
287 // Only update if our flow thread state is different from our new parent
and if we're not a RenderFlowThread. | 287 // Only update if our flow thread state is different from our new parent
and if we're not a RenderFlowThread. |
288 // A RenderFlowThread is always considered to be inside itself, so it ne
ver has to change its state | 288 // A RenderFlowThread is always considered to be inside itself, so it ne
ver has to change its state |
289 // in response to parent changes. | 289 // in response to parent changes. |
290 FlowThreadState newState = parent ? parent->flowThreadState() : NotInsid
eFlowThread; | 290 FlowThreadState newState = parent ? parent->flowThreadState() : NotInsid
eFlowThread; |
291 if (newState != flowThreadState() && !isRenderFlowThread()) | 291 if (newState != flowThreadState() && !isRenderFlowThread()) |
292 setFlowThreadStateIncludingDescendants(newState); | 292 setFlowThreadStateIncludingDescendants(newState); |
293 } | 293 } |
294 | 294 |
295 ////////////////////////////////////////// | 295 ////////////////////////////////////////// |
296 private: | 296 private: |
297 #if ENABLE(ASSERT) | 297 #if ENABLE(ASSERT) |
298 bool isSetNeedsLayoutForbidden() const { return m_setNeedsLayoutForbidden; } | 298 bool isSetNeedsLayoutForbidden() const { return m_setNeedsLayoutForbidden; } |
299 void setNeedsLayoutIsForbidden(bool flag) { m_setNeedsLayoutForbidden = flag
; } | 299 void setNeedsLayoutIsForbidden(bool flag) { m_setNeedsLayoutForbidden = flag
; } |
300 #endif | 300 #endif |
301 | 301 |
302 void addAbsoluteRectForLayer(LayoutRect& result); | 302 void addAbsoluteRectForLayer(LayoutRect& result); |
303 bool requiresAnonymousTableWrappers(const RenderObject*) const; | 303 bool requiresAnonymousTableWrappers(const LayoutObject*) const; |
304 | 304 |
305 // Gets pseudoStyle from Shadow host(in case of input elements) | 305 // Gets pseudoStyle from Shadow host(in case of input elements) |
306 // or from Parent element. | 306 // or from Parent element. |
307 PassRefPtr<RenderStyle> getUncachedPseudoStyleFromParentOrShadowHost() const
; | 307 PassRefPtr<RenderStyle> getUncachedPseudoStyleFromParentOrShadowHost() const
; |
308 | 308 |
309 bool skipInvalidationWhenLaidOutChildren() const; | 309 bool skipInvalidationWhenLaidOutChildren() const; |
310 | 310 |
311 public: | 311 public: |
312 #ifndef NDEBUG | 312 #ifndef NDEBUG |
313 void showTreeForThis() const; | 313 void showTreeForThis() const; |
314 void showRenderTreeForThis() const; | 314 void showRenderTreeForThis() const; |
315 void showLineTreeForThis() const; | 315 void showLineTreeForThis() const; |
316 | 316 |
317 void showRenderObject() const; | 317 void showLayoutObject() const; |
318 // We don't make printedCharacters an optional parameter so that | 318 // We don't make printedCharacters an optional parameter so that |
319 // showRenderObject can be called from gdb easily. | 319 // showLayoutObject can be called from gdb easily. |
320 void showRenderObject(int printedCharacters) const; | 320 void showLayoutObject(int printedCharacters) const; |
321 void showRenderTreeAndMark(const RenderObject* markedObject1 = 0, const char
* markedLabel1 = 0, const RenderObject* markedObject2 = 0, const char* markedLab
el2 = 0, int depth = 0) const; | 321 void showRenderTreeAndMark(const LayoutObject* markedObject1 = 0, const char
* markedLabel1 = 0, const LayoutObject* markedObject2 = 0, const char* markedLab
el2 = 0, int depth = 0) const; |
322 #endif | 322 #endif |
323 | 323 |
324 static RenderObject* createObject(Element*, const RenderStyle&); | 324 static LayoutObject* createObject(Element*, const RenderStyle&); |
325 static unsigned instanceCount() { return s_instanceCount; } | 325 static unsigned instanceCount() { return s_instanceCount; } |
326 | 326 |
327 // RenderObjects are allocated out of the rendering partition. | 327 // LayoutObjects are allocated out of the rendering partition. |
328 void* operator new(size_t); | 328 void* operator new(size_t); |
329 void operator delete(void*); | 329 void operator delete(void*); |
330 | 330 |
331 public: | 331 public: |
332 bool isPseudoElement() const { return node() && node()->isPseudoElement(); } | 332 bool isPseudoElement() const { return node() && node()->isPseudoElement(); } |
333 | 333 |
334 virtual bool isBoxModelObject() const { return false; } | 334 virtual bool isBoxModelObject() const { return false; } |
335 bool isBR() const { return isOfType(RenderObjectBr); } | 335 bool isBR() const { return isOfType(LayoutObjectBr); } |
336 bool isCanvas() const { return isOfType(RenderObjectCanvas); } | 336 bool isCanvas() const { return isOfType(LayoutObjectCanvas); } |
337 bool isCounter() const { return isOfType(RenderObjectCounter); } | 337 bool isCounter() const { return isOfType(LayoutObjectCounter); } |
338 bool isDetailsMarker() const { return isOfType(RenderObjectDetailsMarker); } | 338 bool isDetailsMarker() const { return isOfType(LayoutObjectDetailsMarker); } |
339 bool isEmbeddedObject() const { return isOfType(RenderObjectEmbeddedObject);
} | 339 bool isEmbeddedObject() const { return isOfType(LayoutObjectEmbeddedObject);
} |
340 bool isFieldset() const { return isOfType(RenderObjectFieldset); } | 340 bool isFieldset() const { return isOfType(LayoutObjectFieldset); } |
341 bool isFileUploadControl() const { return isOfType(RenderObjectFileUploadCon
trol); } | 341 bool isFileUploadControl() const { return isOfType(LayoutObjectFileUploadCon
trol); } |
342 bool isFrame() const { return isOfType(RenderObjectFrame); } | 342 bool isFrame() const { return isOfType(LayoutObjectFrame); } |
343 bool isFrameSet() const { return isOfType(RenderObjectFrameSet); } | 343 bool isFrameSet() const { return isOfType(LayoutObjectFrameSet); } |
344 bool isLayoutTableCol() const { return isOfType(RenderObjectLayoutTableCol);
} | 344 bool isLayoutTableCol() const { return isOfType(LayoutObjectLayoutTableCol);
} |
345 bool isListBox() const { return isOfType(RenderObjectListBox); } | 345 bool isListBox() const { return isOfType(LayoutObjectListBox); } |
346 bool isListItem() const { return isOfType(RenderObjectListItem); } | 346 bool isListItem() const { return isOfType(LayoutObjectListItem); } |
347 bool isListMarker() const { return isOfType(RenderObjectListMarker); } | 347 bool isListMarker() const { return isOfType(LayoutObjectListMarker); } |
348 bool isMedia() const { return isOfType(RenderObjectMedia); } | 348 bool isMedia() const { return isOfType(LayoutObjectMedia); } |
349 bool isMenuList() const { return isOfType(RenderObjectMenuList); } | 349 bool isMenuList() const { return isOfType(LayoutObjectMenuList); } |
350 bool isMeter() const { return isOfType(RenderObjectMeter); } | 350 bool isMeter() const { return isOfType(LayoutObjectMeter); } |
351 bool isProgress() const { return isOfType(RenderObjectProgress); } | 351 bool isProgress() const { return isOfType(LayoutObjectProgress); } |
352 bool isQuote() const { return isOfType(RenderObjectQuote); } | 352 bool isQuote() const { return isOfType(LayoutObjectQuote); } |
353 bool isRenderButton() const { return isOfType(RenderObjectRenderButton); } | 353 bool isRenderButton() const { return isOfType(LayoutObjectRenderButton); } |
354 bool isRenderFullScreen() const { return isOfType(RenderObjectRenderFullScre
en); } | 354 bool isRenderFullScreen() const { return isOfType(LayoutObjectRenderFullScre
en); } |
355 bool isRenderFullScreenPlaceholder() const { return isOfType(RenderObjectRen
derFullScreenPlaceholder); } | 355 bool isRenderFullScreenPlaceholder() const { return isOfType(LayoutObjectRen
derFullScreenPlaceholder); } |
356 bool isRenderGrid() const { return isOfType(RenderObjectRenderGrid); } | 356 bool isRenderGrid() const { return isOfType(LayoutObjectRenderGrid); } |
357 bool isRenderIFrame() const { return isOfType(RenderObjectRenderIFrame); } | 357 bool isRenderIFrame() const { return isOfType(LayoutObjectRenderIFrame); } |
358 bool isRenderImage() const { return isOfType(RenderObjectRenderImage); } | 358 bool isRenderImage() const { return isOfType(LayoutObjectRenderImage); } |
359 bool isRenderMultiColumnSet() const { return isOfType(RenderObjectRenderMult
iColumnSet); } | 359 bool isRenderMultiColumnSet() const { return isOfType(LayoutObjectRenderMult
iColumnSet); } |
360 bool isRenderMultiColumnSpannerPlaceholder() const { return isOfType(RenderO
bjectRenderMultiColumnSpannerPlaceholder); } | 360 bool isRenderMultiColumnSpannerPlaceholder() const { return isOfType(LayoutO
bjectRenderMultiColumnSpannerPlaceholder); } |
361 bool isRenderRegion() const { return isOfType(RenderObjectRenderRegion); } | 361 bool isRenderRegion() const { return isOfType(LayoutObjectRenderRegion); } |
362 bool isRenderScrollbarPart() const { return isOfType(RenderObjectRenderScrol
lbarPart); } | 362 bool isRenderScrollbarPart() const { return isOfType(LayoutObjectRenderScrol
lbarPart); } |
363 bool isRenderView() const { return isOfType(RenderObjectRenderView); } | 363 bool isRenderView() const { return isOfType(LayoutObjectRenderView); } |
364 bool isReplica() const { return isOfType(RenderObjectReplica); } | 364 bool isReplica() const { return isOfType(LayoutObjectReplica); } |
365 bool isRuby() const { return isOfType(RenderObjectRuby); } | 365 bool isRuby() const { return isOfType(LayoutObjectRuby); } |
366 bool isRubyBase() const { return isOfType(RenderObjectRubyBase); } | 366 bool isRubyBase() const { return isOfType(LayoutObjectRubyBase); } |
367 bool isRubyRun() const { return isOfType(RenderObjectRubyRun); } | 367 bool isRubyRun() const { return isOfType(LayoutObjectRubyRun); } |
368 bool isRubyText() const { return isOfType(RenderObjectRubyText); } | 368 bool isRubyText() const { return isOfType(LayoutObjectRubyText); } |
369 bool isSlider() const { return isOfType(RenderObjectSlider); } | 369 bool isSlider() const { return isOfType(LayoutObjectSlider); } |
370 bool isSliderThumb() const { return isOfType(RenderObjectSliderThumb); } | 370 bool isSliderThumb() const { return isOfType(LayoutObjectSliderThumb); } |
371 bool isTable() const { return isOfType(RenderObjectTable); } | 371 bool isTable() const { return isOfType(LayoutObjectTable); } |
372 bool isTableCaption() const { return isOfType(RenderObjectTableCaption); } | 372 bool isTableCaption() const { return isOfType(LayoutObjectTableCaption); } |
373 bool isTableCell() const { return isOfType(RenderObjectTableCell); } | 373 bool isTableCell() const { return isOfType(LayoutObjectTableCell); } |
374 bool isTableRow() const { return isOfType(RenderObjectTableRow); } | 374 bool isTableRow() const { return isOfType(LayoutObjectTableRow); } |
375 bool isTableSection() const { return isOfType(RenderObjectTableSection); } | 375 bool isTableSection() const { return isOfType(LayoutObjectTableSection); } |
376 bool isTextArea() const { return isOfType(RenderObjectTextArea); } | 376 bool isTextArea() const { return isOfType(LayoutObjectTextArea); } |
377 bool isTextControl() const { return isOfType(RenderObjectTextControl); } | 377 bool isTextControl() const { return isOfType(LayoutObjectTextControl); } |
378 bool isTextField() const { return isOfType(RenderObjectTextField); } | 378 bool isTextField() const { return isOfType(LayoutObjectTextField); } |
379 bool isVideo() const { return isOfType(RenderObjectVideo); } | 379 bool isVideo() const { return isOfType(LayoutObjectVideo); } |
380 bool isWidget() const { return isOfType(RenderObjectWidget); } | 380 bool isWidget() const { return isOfType(LayoutObjectWidget); } |
381 | 381 |
382 virtual bool isImage() const { return false; } | 382 virtual bool isImage() const { return false; } |
383 | 383 |
384 virtual bool isInlineBlockOrInlineTable() const { return false; } | 384 virtual bool isInlineBlockOrInlineTable() const { return false; } |
385 virtual bool isLayoutLayerModelObject() const { return false; } | 385 virtual bool isLayoutLayerModelObject() const { return false; } |
386 virtual bool isRenderBlock() const { return false; } | 386 virtual bool isRenderBlock() const { return false; } |
387 virtual bool isRenderBlockFlow() const { return false; } | 387 virtual bool isRenderBlockFlow() const { return false; } |
388 virtual bool isRenderFlowThread() const { return false; } | 388 virtual bool isRenderFlowThread() const { return false; } |
389 virtual bool isRenderInline() const { return false; } | 389 virtual bool isRenderInline() const { return false; } |
390 virtual bool isRenderPart() const { return false; } | 390 virtual bool isRenderPart() const { return false; } |
391 | 391 |
392 bool isDocumentElement() const { return document().documentElement() == m_no
de; } | 392 bool isDocumentElement() const { return document().documentElement() == m_no
de; } |
393 // isBody is called from RenderBox::styleWillChange and is thus quite hot. | 393 // isBody is called from RenderBox::styleWillChange and is thus quite hot. |
394 bool isBody() const { return node() && node()->hasTagName(HTMLNames::bodyTag
); } | 394 bool isBody() const { return node() && node()->hasTagName(HTMLNames::bodyTag
); } |
395 bool isHR() const; | 395 bool isHR() const; |
396 bool isLegend() const; | 396 bool isLegend() const; |
397 | 397 |
398 bool isTablePart() const { return isTableCell() || isLayoutTableCol() || isT
ableCaption() || isTableRow() || isTableSection(); } | 398 bool isTablePart() const { return isTableCell() || isLayoutTableCol() || isT
ableCaption() || isTableRow() || isTableSection(); } |
399 | 399 |
400 inline bool isBeforeContent() const; | 400 inline bool isBeforeContent() const; |
401 inline bool isAfterContent() const; | 401 inline bool isAfterContent() const; |
402 inline bool isBeforeOrAfterContent() const; | 402 inline bool isBeforeOrAfterContent() const; |
403 static inline bool isAfterContent(const RenderObject* obj) { return obj && o
bj->isAfterContent(); } | 403 static inline bool isAfterContent(const LayoutObject* obj) { return obj && o
bj->isAfterContent(); } |
404 | 404 |
405 bool hasCounterNodeMap() const { return m_bitfields.hasCounterNodeMap(); } | 405 bool hasCounterNodeMap() const { return m_bitfields.hasCounterNodeMap(); } |
406 void setHasCounterNodeMap(bool hasCounterNodeMap) { m_bitfields.setHasCounte
rNodeMap(hasCounterNodeMap); } | 406 void setHasCounterNodeMap(bool hasCounterNodeMap) { m_bitfields.setHasCounte
rNodeMap(hasCounterNodeMap); } |
407 bool everHadLayout() const { return m_bitfields.everHadLayout(); } | 407 bool everHadLayout() const { return m_bitfields.everHadLayout(); } |
408 | 408 |
409 bool childrenInline() const { return m_bitfields.childrenInline(); } | 409 bool childrenInline() const { return m_bitfields.childrenInline(); } |
410 void setChildrenInline(bool b) { m_bitfields.setChildrenInline(b); } | 410 void setChildrenInline(bool b) { m_bitfields.setChildrenInline(b); } |
411 bool hasColumns() const { return m_bitfields.hasColumns(); } | 411 bool hasColumns() const { return m_bitfields.hasColumns(); } |
412 void setHasColumns(bool b = true) { m_bitfields.setHasColumns(b); } | 412 void setHasColumns(bool b = true) { m_bitfields.setHasColumns(b); } |
413 | 413 |
(...skipping 21 matching lines...) Expand all Loading... |
435 InsideOutOfFlowThread = 1, | 435 InsideOutOfFlowThread = 1, |
436 InsideInFlowThread = 2, | 436 InsideInFlowThread = 2, |
437 }; | 437 }; |
438 | 438 |
439 void setFlowThreadStateIncludingDescendants(FlowThreadState); | 439 void setFlowThreadStateIncludingDescendants(FlowThreadState); |
440 | 440 |
441 FlowThreadState flowThreadState() const { return m_bitfields.flowThreadState
(); } | 441 FlowThreadState flowThreadState() const { return m_bitfields.flowThreadState
(); } |
442 void setFlowThreadState(FlowThreadState state) { m_bitfields.setFlowThreadSt
ate(state); } | 442 void setFlowThreadState(FlowThreadState state) { m_bitfields.setFlowThreadSt
ate(state); } |
443 | 443 |
444 // FIXME: Until all SVG renders can be subclasses of RenderSVGModelObject we
have | 444 // FIXME: Until all SVG renders can be subclasses of RenderSVGModelObject we
have |
445 // to add SVG renderer methods to RenderObject with an ASSERT_NOT_REACHED()
default implementation. | 445 // to add SVG renderer methods to LayoutObject with an ASSERT_NOT_REACHED()
default implementation. |
446 bool isSVG() const { return isOfType(RenderObjectSVG); } | 446 bool isSVG() const { return isOfType(LayoutObjectSVG); } |
447 bool isSVGRoot() const { return isOfType(RenderObjectSVGRoot); } | 447 bool isSVGRoot() const { return isOfType(LayoutObjectSVGRoot); } |
448 bool isSVGContainer() const { return isOfType(RenderObjectSVGContainer); } | 448 bool isSVGContainer() const { return isOfType(LayoutObjectSVGContainer); } |
449 bool isSVGTransformableContainer() const { return isOfType(RenderObjectSVGTr
ansformableContainer); } | 449 bool isSVGTransformableContainer() const { return isOfType(LayoutObjectSVGTr
ansformableContainer); } |
450 bool isSVGViewportContainer() const { return isOfType(RenderObjectSVGViewpor
tContainer); } | 450 bool isSVGViewportContainer() const { return isOfType(LayoutObjectSVGViewpor
tContainer); } |
451 bool isSVGGradientStop() const { return isOfType(RenderObjectSVGGradientStop
); } | 451 bool isSVGGradientStop() const { return isOfType(LayoutObjectSVGGradientStop
); } |
452 bool isSVGHiddenContainer() const { return isOfType(RenderObjectSVGHiddenCon
tainer); } | 452 bool isSVGHiddenContainer() const { return isOfType(LayoutObjectSVGHiddenCon
tainer); } |
453 bool isSVGShape() const { return isOfType(RenderObjectSVGShape); } | 453 bool isSVGShape() const { return isOfType(LayoutObjectSVGShape); } |
454 bool isSVGText() const { return isOfType(RenderObjectSVGText); } | 454 bool isSVGText() const { return isOfType(LayoutObjectSVGText); } |
455 bool isSVGTextPath() const { return isOfType(RenderObjectSVGTextPath); } | 455 bool isSVGTextPath() const { return isOfType(LayoutObjectSVGTextPath); } |
456 bool isSVGInline() const { return isOfType(RenderObjectSVGInline); } | 456 bool isSVGInline() const { return isOfType(LayoutObjectSVGInline); } |
457 bool isSVGInlineText() const { return isOfType(RenderObjectSVGInlineText); } | 457 bool isSVGInlineText() const { return isOfType(LayoutObjectSVGInlineText); } |
458 bool isSVGImage() const { return isOfType(RenderObjectSVGImage); } | 458 bool isSVGImage() const { return isOfType(LayoutObjectSVGImage); } |
459 bool isSVGForeignObject() const { return isOfType(RenderObjectSVGForeignObje
ct); } | 459 bool isSVGForeignObject() const { return isOfType(LayoutObjectSVGForeignObje
ct); } |
460 bool isSVGResourceContainer() const { return isOfType(RenderObjectSVGResourc
eContainer); } | 460 bool isSVGResourceContainer() const { return isOfType(LayoutObjectSVGResourc
eContainer); } |
461 bool isSVGResourceFilter() const { return isOfType(RenderObjectSVGResourceFi
lter); } | 461 bool isSVGResourceFilter() const { return isOfType(LayoutObjectSVGResourceFi
lter); } |
462 bool isSVGResourceFilterPrimitive() const { return isOfType(RenderObjectSVGR
esourceFilterPrimitive); } | 462 bool isSVGResourceFilterPrimitive() const { return isOfType(LayoutObjectSVGR
esourceFilterPrimitive); } |
463 | 463 |
464 // FIXME: Those belong into a SVG specific base-class for all renderers (see
above) | 464 // FIXME: Those belong into a SVG specific base-class for all renderers (see
above) |
465 // Unfortunately we don't have such a class yet, because it's not possible f
or all renderers | 465 // Unfortunately we don't have such a class yet, because it's not possible f
or all renderers |
466 // to inherit from RenderSVGObject -> RenderObject (some need RenderBlock in
heritance for instance) | 466 // to inherit from RenderSVGObject -> LayoutObject (some need RenderBlock in
heritance for instance) |
467 virtual void setNeedsTransformUpdate() { } | 467 virtual void setNeedsTransformUpdate() { } |
468 virtual void setNeedsBoundariesUpdate(); | 468 virtual void setNeedsBoundariesUpdate(); |
469 | 469 |
470 bool isBlendingAllowed() const { return !isSVG() || (isSVGContainer() && !is
SVGHiddenContainer()) || isSVGShape() || isSVGImage() || isSVGText(); } | 470 bool isBlendingAllowed() const { return !isSVG() || (isSVGContainer() && !is
SVGHiddenContainer()) || isSVGShape() || isSVGImage() || isSVGText(); } |
471 virtual bool hasNonIsolatedBlendingDescendants() const { return false; } | 471 virtual bool hasNonIsolatedBlendingDescendants() const { return false; } |
472 enum DescendantIsolationState { | 472 enum DescendantIsolationState { |
473 DescendantIsolationRequired, | 473 DescendantIsolationRequired, |
474 DescendantIsolationNeedsUpdate, | 474 DescendantIsolationNeedsUpdate, |
475 }; | 475 }; |
476 virtual void descendantIsolationRequirementsChanged(DescendantIsolationState
) { } | 476 virtual void descendantIsolationRequirementsChanged(DescendantIsolationState
) { } |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 | 631 |
632 Document& document() const { return m_node->document(); } | 632 Document& document() const { return m_node->document(); } |
633 LocalFrame* frame() const { return document().frame(); } | 633 LocalFrame* frame() const { return document().frame(); } |
634 | 634 |
635 virtual RenderMultiColumnSpannerPlaceholder* spannerPlaceholder() const { re
turn 0; } | 635 virtual RenderMultiColumnSpannerPlaceholder* spannerPlaceholder() const { re
turn 0; } |
636 bool isColumnSpanAll() const { return style()->columnSpan() == ColumnSpanAll
&& spannerPlaceholder(); } | 636 bool isColumnSpanAll() const { return style()->columnSpan() == ColumnSpanAll
&& spannerPlaceholder(); } |
637 | 637 |
638 // Returns the object containing this one. Can be different from parent for
positioned elements. | 638 // Returns the object containing this one. Can be different from parent for
positioned elements. |
639 // If paintInvalidationContainer and paintInvalidationContainerSkipped are n
ot null, on return *paintInvalidationContainerSkipped | 639 // If paintInvalidationContainer and paintInvalidationContainerSkipped are n
ot null, on return *paintInvalidationContainerSkipped |
640 // is true if the renderer returned is an ancestor of paintInvalidationConta
iner. | 640 // is true if the renderer returned is an ancestor of paintInvalidationConta
iner. |
641 RenderObject* container(const LayoutLayerModelObject* paintInvalidationConta
iner = 0, bool* paintInvalidationContainerSkipped = 0) const; | 641 LayoutObject* container(const LayoutLayerModelObject* paintInvalidationConta
iner = 0, bool* paintInvalidationContainerSkipped = 0) const; |
642 RenderBlock* containerForFixedPosition(const LayoutLayerModelObject* paintIn
validationContainer = 0, bool* paintInvalidationContainerSkipped = 0) const; | 642 RenderBlock* containerForFixedPosition(const LayoutLayerModelObject* paintIn
validationContainer = 0, bool* paintInvalidationContainerSkipped = 0) const; |
643 | 643 |
644 virtual RenderObject* hoverAncestor() const { return parent(); } | 644 virtual LayoutObject* hoverAncestor() const { return parent(); } |
645 | 645 |
646 Element* offsetParent() const; | 646 Element* offsetParent() const; |
647 | 647 |
648 void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObjec
t* newRoot = 0, SubtreeLayoutScope* = 0); | 648 void markContainingBlocksForLayout(bool scheduleRelayout = true, LayoutObjec
t* newRoot = 0, SubtreeLayoutScope* = 0); |
649 void setNeedsLayout(MarkingBehavior = MarkContainingBlockChain, SubtreeLayou
tScope* = 0); | 649 void setNeedsLayout(MarkingBehavior = MarkContainingBlockChain, SubtreeLayou
tScope* = 0); |
650 void setNeedsLayoutAndFullPaintInvalidation(MarkingBehavior = MarkContaining
BlockChain, SubtreeLayoutScope* = 0); | 650 void setNeedsLayoutAndFullPaintInvalidation(MarkingBehavior = MarkContaining
BlockChain, SubtreeLayoutScope* = 0); |
651 void clearNeedsLayout(); | 651 void clearNeedsLayout(); |
652 void setChildNeedsLayout(MarkingBehavior = MarkContainingBlockChain, Subtree
LayoutScope* = 0); | 652 void setChildNeedsLayout(MarkingBehavior = MarkContainingBlockChain, Subtree
LayoutScope* = 0); |
653 void setNeedsPositionedMovementLayout(); | 653 void setNeedsPositionedMovementLayout(); |
654 void setPreferredLogicalWidthsDirty(MarkingBehavior = MarkContainingBlockCha
in); | 654 void setPreferredLogicalWidthsDirty(MarkingBehavior = MarkContainingBlockCha
in); |
655 void clearPreferredLogicalWidthsDirty(); | 655 void clearPreferredLogicalWidthsDirty(); |
656 void invalidateContainerPreferredLogicalWidths(); | 656 void invalidateContainerPreferredLogicalWidths(); |
657 | 657 |
658 void setNeedsLayoutAndPrefWidthsRecalc() | 658 void setNeedsLayoutAndPrefWidthsRecalc() |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 virtual void paint(const PaintInfo&, const LayoutPoint& paintOffset); | 699 virtual void paint(const PaintInfo&, const LayoutPoint& paintOffset); |
700 | 700 |
701 // Subclasses must reimplement this method to compute the size and position | 701 // Subclasses must reimplement this method to compute the size and position |
702 // of this object and all its descendants. | 702 // of this object and all its descendants. |
703 virtual void layout() = 0; | 703 virtual void layout() = 0; |
704 virtual bool updateImageLoadingPriorities() { return false; } | 704 virtual bool updateImageLoadingPriorities() { return false; } |
705 void setHasPendingResourceUpdate(bool hasPendingResourceUpdate) { m_bitfield
s.setHasPendingResourceUpdate(hasPendingResourceUpdate); } | 705 void setHasPendingResourceUpdate(bool hasPendingResourceUpdate) { m_bitfield
s.setHasPendingResourceUpdate(hasPendingResourceUpdate); } |
706 bool hasPendingResourceUpdate() const { return m_bitfields.hasPendingResourc
eUpdate(); } | 706 bool hasPendingResourceUpdate() const { return m_bitfields.hasPendingResourc
eUpdate(); } |
707 | 707 |
708 /* This function performs a layout only if one is needed. */ | 708 /* This function performs a layout only if one is needed. */ |
709 void layoutIfNeeded() { if (needsLayout()) layout(); } | 709 void layoutIfNeeded() |
| 710 { |
| 711 if (needsLayout()) |
| 712 layout(); |
| 713 } |
710 | 714 |
711 void forceLayout(); | 715 void forceLayout(); |
712 void forceChildLayout(); | 716 void forceChildLayout(); |
713 | 717 |
714 // Used for element state updates that cannot be fixed with a | 718 // Used for element state updates that cannot be fixed with a |
715 // paint invalidation and do not need a relayout. | 719 // paint invalidation and do not need a relayout. |
716 virtual void updateFromElement() { } | 720 virtual void updateFromElement() { } |
717 | 721 |
718 virtual void addAnnotatedRegions(Vector<AnnotatedRegionValue>&); | 722 virtual void addAnnotatedRegions(Vector<AnnotatedRegionValue>&); |
719 void collectAnnotatedRegions(Vector<AnnotatedRegionValue>&); | 723 void collectAnnotatedRegions(Vector<AnnotatedRegionValue>&); |
720 | 724 |
721 CompositingState compositingState() const; | 725 CompositingState compositingState() const; |
722 virtual CompositingReasons additionalCompositingReasons() const; | 726 virtual CompositingReasons additionalCompositingReasons() const; |
723 | 727 |
724 bool hitTest(const HitTestRequest&, HitTestResult&, const HitTestLocation& l
ocationInContainer, const LayoutPoint& accumulatedOffset, HitTestFilter = HitTes
tAll); | 728 bool hitTest(const HitTestRequest&, HitTestResult&, const HitTestLocation& l
ocationInContainer, const LayoutPoint& accumulatedOffset, HitTestFilter = HitTes
tAll); |
725 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&); | 729 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&); |
726 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion); | 730 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion); |
727 | 731 |
728 virtual PositionWithAffinity positionForPoint(const LayoutPoint&); | 732 virtual PositionWithAffinity positionForPoint(const LayoutPoint&); |
729 PositionWithAffinity createPositionWithAffinity(int offset, EAffinity); | 733 PositionWithAffinity createPositionWithAffinity(int offset, EAffinity); |
730 PositionWithAffinity createPositionWithAffinity(const Position&); | 734 PositionWithAffinity createPositionWithAffinity(const Position&); |
731 | 735 |
732 virtual void dirtyLinesFromChangedChild(RenderObject*); | 736 virtual void dirtyLinesFromChangedChild(LayoutObject*); |
733 | 737 |
734 // Set the style of the object and update the state of the object accordingl
y. | 738 // Set the style of the object and update the state of the object accordingl
y. |
735 void setStyle(PassRefPtr<RenderStyle>); | 739 void setStyle(PassRefPtr<RenderStyle>); |
736 | 740 |
737 // Set the style of the object if it's generated content. | 741 // Set the style of the object if it's generated content. |
738 void setPseudoStyle(PassRefPtr<RenderStyle>); | 742 void setPseudoStyle(PassRefPtr<RenderStyle>); |
739 | 743 |
740 // Updates only the local style ptr of the object. Does not update the stat
e of the object, | 744 // Updates only the local style ptr of the object. Does not update the stat
e of the object, |
741 // and so only should be called when the style is known not to have changed
(or from setStyle). | 745 // and so only should be called when the style is known not to have changed
(or from setStyle). |
742 void setStyleInternal(PassRefPtr<RenderStyle> style) { m_style = style; } | 746 void setStyleInternal(PassRefPtr<RenderStyle> style) { m_style = style; } |
(...skipping 21 matching lines...) Expand all Loading... |
764 | 768 |
765 // Convert a local quad into the coordinate system of container, taking tran
sforms into account. | 769 // Convert a local quad into the coordinate system of container, taking tran
sforms into account. |
766 FloatQuad localToContainerQuad(const FloatQuad&, const LayoutLayerModelObjec
t* paintInvalidatinoContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0) cons
t; | 770 FloatQuad localToContainerQuad(const FloatQuad&, const LayoutLayerModelObjec
t* paintInvalidatinoContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0) cons
t; |
767 FloatPoint localToContainerPoint(const FloatPoint&, const LayoutLayerModelOb
ject* paintInvalidationContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0, c
onst PaintInvalidationState* = 0) const; | 771 FloatPoint localToContainerPoint(const FloatPoint&, const LayoutLayerModelOb
ject* paintInvalidationContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0, c
onst PaintInvalidationState* = 0) const; |
768 | 772 |
769 // Convert a local point into the coordinate system of backing coordinates.
Also returns the backing layer if needed. | 773 // Convert a local point into the coordinate system of backing coordinates.
Also returns the backing layer if needed. |
770 FloatPoint localToInvalidationBackingPoint(const LayoutPoint&, Layer** backi
ngLayer = nullptr); | 774 FloatPoint localToInvalidationBackingPoint(const LayoutPoint&, Layer** backi
ngLayer = nullptr); |
771 | 775 |
772 // Return the offset from the container() renderer (excluding transforms). I
n multi-column layout, | 776 // Return the offset from the container() renderer (excluding transforms). I
n multi-column layout, |
773 // different offsets apply at different points, so return the offset that ap
plies to the given point. | 777 // different offsets apply at different points, so return the offset that ap
plies to the given point. |
774 virtual LayoutSize offsetFromContainer(const RenderObject*, const LayoutPoin
t&, bool* offsetDependsOnPoint = 0) const; | 778 virtual LayoutSize offsetFromContainer(const LayoutObject*, const LayoutPoin
t&, bool* offsetDependsOnPoint = 0) const; |
775 // Return the offset from an object up the container() chain. Asserts that n
one of the intermediate objects have transforms. | 779 // Return the offset from an object up the container() chain. Asserts that n
one of the intermediate objects have transforms. |
776 LayoutSize offsetFromAncestorContainer(const RenderObject*) const; | 780 LayoutSize offsetFromAncestorContainer(const LayoutObject*) const; |
777 | 781 |
778 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint&) const { } | 782 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint&) const { } |
779 | 783 |
780 IntRect absoluteBoundingBoxRect() const; | 784 IntRect absoluteBoundingBoxRect() const; |
781 // FIXME: This function should go away eventually | 785 // FIXME: This function should go away eventually |
782 IntRect absoluteBoundingBoxRectIgnoringTransforms() const; | 786 IntRect absoluteBoundingBoxRectIgnoringTransforms() const; |
783 | 787 |
784 // Build an array of quads in absolute coords for line boxes | 788 // Build an array of quads in absolute coords for line boxes |
785 virtual void absoluteQuads(Vector<FloatQuad>&, bool* /*wasFixed*/ = 0) const
{ } | 789 virtual void absoluteQuads(Vector<FloatQuad>&, bool* /*wasFixed*/ = 0) const
{ } |
786 | 790 |
787 virtual IntRect absoluteFocusRingBoundingBoxRect() const; | 791 virtual IntRect absoluteFocusRingBoundingBoxRect() const; |
788 | 792 |
789 static FloatRect absoluteBoundingBoxRectForRange(const Range*); | 793 static FloatRect absoluteBoundingBoxRectForRange(const Range*); |
790 | 794 |
791 // the rect that will be painted if this object is passed as the paintingRoo
t | 795 // the rect that will be painted if this object is passed as the paintingRoo
t |
792 LayoutRect paintingRootRect(LayoutRect& topLevelRect); | 796 LayoutRect paintingRootRect(LayoutRect& topLevelRect); |
793 | 797 |
794 virtual LayoutUnit minPreferredLogicalWidth() const { return 0; } | 798 virtual LayoutUnit minPreferredLogicalWidth() const { return 0; } |
795 virtual LayoutUnit maxPreferredLogicalWidth() const { return 0; } | 799 virtual LayoutUnit maxPreferredLogicalWidth() const { return 0; } |
796 | 800 |
797 RenderStyle* style() const { return m_style.get(); } | 801 RenderStyle* style() const { return m_style.get(); } |
798 | 802 |
799 // m_style can only be nullptr before the first style is set, thus most | 803 // m_style can only be nullptr before the first style is set, thus most |
800 // callers will never see a nullptr style and should use styleRef(). | 804 // callers will never see a nullptr style and should use styleRef(). |
801 // FIXME: It would be better if style() returned a const reference. | 805 // FIXME: It would be better if style() returned a const reference. |
802 const RenderStyle& styleRef() const { return mutableStyleRef(); } | 806 const RenderStyle& styleRef() const { return mutableStyleRef(); } |
803 RenderStyle& mutableStyleRef() const { ASSERT(m_style); return *m_style; } | 807 RenderStyle& mutableStyleRef() const { ASSERT(m_style); return *m_style; } |
804 | 808 |
805 /* The following methods are inlined in RenderObjectInlines.h */ | 809 /* The following methods are inlined in LayoutObjectInlines.h */ |
806 RenderStyle* firstLineStyle() const; | 810 RenderStyle* firstLineStyle() const; |
807 RenderStyle* style(bool firstLine) const; | 811 RenderStyle* style(bool firstLine) const; |
808 const RenderStyle& styleRef(bool firstLine) const; | 812 const RenderStyle& styleRef(bool firstLine) const; |
809 | 813 |
810 static inline Color resolveColor(const RenderStyle& styleToUse, int colorPro
perty) | 814 static inline Color resolveColor(const RenderStyle& styleToUse, int colorPro
perty) |
811 { | 815 { |
812 return styleToUse.visitedDependentColor(colorProperty); | 816 return styleToUse.visitedDependentColor(colorProperty); |
813 } | 817 } |
814 | 818 |
815 inline Color resolveColor(int colorProperty) const | 819 inline Color resolveColor(int colorProperty) const |
(...skipping 20 matching lines...) Expand all Loading... |
836 // methods. | 840 // methods. |
837 const LayoutLayerModelObject* containerForPaintInvalidation() const; | 841 const LayoutLayerModelObject* containerForPaintInvalidation() const; |
838 const LayoutLayerModelObject* adjustCompositedContainerForSpecialAncestors(c
onst LayoutLayerModelObject* paintInvalidationContainer) const; | 842 const LayoutLayerModelObject* adjustCompositedContainerForSpecialAncestors(c
onst LayoutLayerModelObject* paintInvalidationContainer) const; |
839 bool isPaintInvalidationContainer() const; | 843 bool isPaintInvalidationContainer() const; |
840 | 844 |
841 LayoutRect computePaintInvalidationRect() | 845 LayoutRect computePaintInvalidationRect() |
842 { | 846 { |
843 return computePaintInvalidationRect(containerForPaintInvalidation()); | 847 return computePaintInvalidationRect(containerForPaintInvalidation()); |
844 } | 848 } |
845 | 849 |
846 // Returns the paint invalidation rect for this RenderObject in the coordina
te space of the paint backing (typically a GraphicsLayer) for |paintInvalidation
Container|. | 850 // Returns the paint invalidation rect for this LayoutObject in the coordina
te space of the paint backing (typically a GraphicsLayer) for |paintInvalidation
Container|. |
847 LayoutRect computePaintInvalidationRect(const LayoutLayerModelObject* paintI
nvalidationContainer, const PaintInvalidationState* = 0) const; | 851 LayoutRect computePaintInvalidationRect(const LayoutLayerModelObject* paintI
nvalidationContainer, const PaintInvalidationState* = 0) const; |
848 | 852 |
849 // Returns the rect bounds needed to invalidate the paint of this object, in
the coordinate space of the rendering backing of |paintInvalidationContainer| | 853 // Returns the rect bounds needed to invalidate the paint of this object, in
the coordinate space of the rendering backing of |paintInvalidationContainer| |
850 LayoutRect boundsRectForPaintInvalidation(const LayoutLayerModelObject* pain
tInvalidationContainer, const PaintInvalidationState* = 0) const; | 854 LayoutRect boundsRectForPaintInvalidation(const LayoutLayerModelObject* pain
tInvalidationContainer, const PaintInvalidationState* = 0) const; |
851 | 855 |
852 // Actually do the paint invalidate of rect r for this object which has been
computed in the coordinate space | 856 // Actually do the paint invalidate of rect r for this object which has been
computed in the coordinate space |
853 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t
his coordinaten space is not the same | 857 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t
his coordinaten space is not the same |
854 // as the local coordinate space of |paintInvalidationContainer| in the pres
ence of layer squashing. | 858 // as the local coordinate space of |paintInvalidationContainer| in the pres
ence of layer squashing. |
855 // If |paintInvalidationContainer| is 0, invalidate paints via the view. | 859 // If |paintInvalidationContainer| is 0, invalidate paints via the view. |
856 // FIXME: |paintInvalidationContainer| should never be 0. See crbug.com/3636
99. | 860 // FIXME: |paintInvalidationContainer| should never be 0. See crbug.com/3636
99. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 virtual int previousOffsetForBackwardDeletion(int current) const; | 962 virtual int previousOffsetForBackwardDeletion(int current) const; |
959 virtual int nextOffset(int current) const; | 963 virtual int nextOffset(int current) const; |
960 | 964 |
961 virtual void imageChanged(ImageResource*, const IntRect* = 0) override final
; | 965 virtual void imageChanged(ImageResource*, const IntRect* = 0) override final
; |
962 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) { } | 966 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) { } |
963 virtual bool willRenderImage(ImageResource*) override final; | 967 virtual bool willRenderImage(ImageResource*) override final; |
964 virtual bool getImageAnimationPolicy(ImageResource*, ImageAnimationPolicy&)
override final; | 968 virtual bool getImageAnimationPolicy(ImageResource*, ImageAnimationPolicy&)
override final; |
965 | 969 |
966 void selectionStartEnd(int& spos, int& epos) const; | 970 void selectionStartEnd(int& spos, int& epos) const; |
967 | 971 |
968 void remove() { if (parent()) parent()->removeChild(this); } | 972 void remove() |
| 973 { |
| 974 if (parent()) |
| 975 parent()->removeChild(this); |
| 976 } |
969 | 977 |
970 bool isInert() const; | 978 bool isInert() const; |
971 | 979 |
972 bool supportsTouchAction() const; | 980 bool supportsTouchAction() const; |
973 | 981 |
974 bool visibleToHitTestRequest(const HitTestRequest& request) const { return s
tyle()->visibility() == VISIBLE && (request.ignorePointerEventsNone() || style()
->pointerEvents() != PE_NONE) && !isInert(); } | 982 bool visibleToHitTestRequest(const HitTestRequest& request) const { return s
tyle()->visibility() == VISIBLE && (request.ignorePointerEventsNone() || style()
->pointerEvents() != PE_NONE) && !isInert(); } |
975 | 983 |
976 bool visibleToHitTesting() const { return style()->visibility() == VISIBLE &
& style()->pointerEvents() != PE_NONE && !isInert(); } | 984 bool visibleToHitTesting() const { return style()->visibility() == VISIBLE &
& style()->pointerEvents() != PE_NONE && !isInert(); } |
977 | 985 |
978 // Map points and quads through elements, potentially via 3d transforms. You
should never need to call these directly; use | 986 // Map points and quads through elements, potentially via 3d transforms. You
should never need to call these directly; use |
979 // localToAbsolute/absoluteToLocal methods instead. | 987 // localToAbsolute/absoluteToLocal methods instead. |
980 virtual void mapLocalToContainer(const LayoutLayerModelObject* paintInvalida
tionContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool*
wasFixed = 0, const PaintInvalidationState* = 0) const; | 988 virtual void mapLocalToContainer(const LayoutLayerModelObject* paintInvalida
tionContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool*
wasFixed = 0, const PaintInvalidationState* = 0) const; |
981 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c
onst; | 989 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c
onst; |
982 | 990 |
983 // Pushes state onto RenderGeometryMap about how to map coordinates from thi
s renderer to its container, or ancestorToStopAt (whichever is encountered first
). | 991 // Pushes state onto RenderGeometryMap about how to map coordinates from thi
s renderer to its container, or ancestorToStopAt (whichever is encountered first
). |
984 // Returns the renderer which was mapped to (container or ancestorToStopAt). | 992 // Returns the renderer which was mapped to (container or ancestorToStopAt). |
985 virtual const RenderObject* pushMappingToContainer(const LayoutLayerModelObj
ect* ancestorToStopAt, RenderGeometryMap&) const; | 993 virtual const LayoutObject* pushMappingToContainer(const LayoutLayerModelObj
ect* ancestorToStopAt, RenderGeometryMap&) const; |
986 | 994 |
987 bool shouldUseTransformFromContainer(const RenderObject* container) const; | 995 bool shouldUseTransformFromContainer(const LayoutObject* container) const; |
988 void getTransformFromContainer(const RenderObject* container, const LayoutSi
ze& offsetInContainer, TransformationMatrix&) const; | 996 void getTransformFromContainer(const LayoutObject* container, const LayoutSi
ze& offsetInContainer, TransformationMatrix&) const; |
989 | 997 |
990 bool createsGroup() const { return isTransparent() || hasMask() || hasFilter
() || style()->hasBlendMode(); } | 998 bool createsGroup() const { return isTransparent() || hasMask() || hasFilter
() || style()->hasBlendMode(); } |
991 | 999 |
992 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit
ionalOffset) const { } | 1000 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit
ionalOffset) const { } |
993 | 1001 |
994 // Compute a list of hit-test rectangles per layer rooted at this renderer. | 1002 // Compute a list of hit-test rectangles per layer rooted at this renderer. |
995 virtual void computeLayerHitTestRects(LayerHitTestRects&) const; | 1003 virtual void computeLayerHitTestRects(LayerHitTestRects&) const; |
996 | 1004 |
997 // Return the renderer whose background style is used to paint the root back
ground. Should only be called on the renderer for which isDocumentElement() is t
rue. | 1005 // Return the renderer whose background style is used to paint the root back
ground. Should only be called on the renderer for which isDocumentElement() is t
rue. |
998 RenderObject* rendererForRootBackground(); | 1006 LayoutObject* rendererForRootBackground(); |
999 | 1007 |
1000 RespectImageOrientationEnum shouldRespectImageOrientation() const; | 1008 RespectImageOrientationEnum shouldRespectImageOrientation() const; |
1001 | 1009 |
1002 bool isRelayoutBoundaryForInspector() const; | 1010 bool isRelayoutBoundaryForInspector() const; |
1003 | 1011 |
1004 // The previous paint invalidation rect in the object's previous paint backi
ng. | 1012 // The previous paint invalidation rect in the object's previous paint backi
ng. |
1005 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP
aintInvalidationRect; } | 1013 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP
aintInvalidationRect; } |
1006 void setPreviousPaintInvalidationRect(const LayoutRect& rect) { m_previousPa
intInvalidationRect = rect; } | 1014 void setPreviousPaintInvalidationRect(const LayoutRect& rect) { m_previousPa
intInvalidationRect = rect; } |
1007 | 1015 |
1008 // The previous position of the top-left corner of the object in its previou
s paint backing. | 1016 // The previous position of the top-left corner of the object in its previou
s paint backing. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 virtual bool supportsPaintInvalidationStateCachedOffsets() const { return !h
asColumns() && !hasTransformRelatedProperty() && !hasReflection() && !style()->i
sFlippedBlocksWritingMode(); } | 1060 virtual bool supportsPaintInvalidationStateCachedOffsets() const { return !h
asColumns() && !hasTransformRelatedProperty() && !hasReflection() && !style()->i
sFlippedBlocksWritingMode(); } |
1053 | 1061 |
1054 void setNeedsOverflowRecalcAfterStyleChange(); | 1062 void setNeedsOverflowRecalcAfterStyleChange(); |
1055 void markContainingBlocksForOverflowRecalc(); | 1063 void markContainingBlocksForOverflowRecalc(); |
1056 | 1064 |
1057 virtual LayoutRect viewRect() const; | 1065 virtual LayoutRect viewRect() const; |
1058 | 1066 |
1059 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi
s); } | 1067 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi
s); } |
1060 | 1068 |
1061 protected: | 1069 protected: |
1062 enum RenderObjectType { | 1070 enum LayoutObjectType { |
1063 RenderObjectBr, | 1071 LayoutObjectBr, |
1064 RenderObjectCanvas, | 1072 LayoutObjectCanvas, |
1065 RenderObjectFieldset, | 1073 LayoutObjectFieldset, |
1066 RenderObjectCounter, | 1074 LayoutObjectCounter, |
1067 RenderObjectDetailsMarker, | 1075 LayoutObjectDetailsMarker, |
1068 RenderObjectEmbeddedObject, | 1076 LayoutObjectEmbeddedObject, |
1069 RenderObjectFileUploadControl, | 1077 LayoutObjectFileUploadControl, |
1070 RenderObjectFrame, | 1078 LayoutObjectFrame, |
1071 RenderObjectFrameSet, | 1079 LayoutObjectFrameSet, |
1072 RenderObjectLayoutTableCol, | 1080 LayoutObjectLayoutTableCol, |
1073 RenderObjectListBox, | 1081 LayoutObjectListBox, |
1074 RenderObjectListItem, | 1082 LayoutObjectListItem, |
1075 RenderObjectListMarker, | 1083 LayoutObjectListMarker, |
1076 RenderObjectMedia, | 1084 LayoutObjectMedia, |
1077 RenderObjectMenuList, | 1085 LayoutObjectMenuList, |
1078 RenderObjectMeter, | 1086 LayoutObjectMeter, |
1079 RenderObjectProgress, | 1087 LayoutObjectProgress, |
1080 RenderObjectQuote, | 1088 LayoutObjectQuote, |
1081 RenderObjectRenderButton, | 1089 LayoutObjectRenderButton, |
1082 RenderObjectRenderFlowThread, | 1090 LayoutObjectRenderFlowThread, |
1083 RenderObjectRenderFullScreen, | 1091 LayoutObjectRenderFullScreen, |
1084 RenderObjectRenderFullScreenPlaceholder, | 1092 LayoutObjectRenderFullScreenPlaceholder, |
1085 RenderObjectRenderGrid, | 1093 LayoutObjectRenderGrid, |
1086 RenderObjectRenderIFrame, | 1094 LayoutObjectRenderIFrame, |
1087 RenderObjectRenderImage, | 1095 LayoutObjectRenderImage, |
1088 RenderObjectRenderInline, | 1096 LayoutObjectRenderInline, |
1089 RenderObjectRenderMultiColumnSet, | 1097 LayoutObjectRenderMultiColumnSet, |
1090 RenderObjectRenderMultiColumnSpannerPlaceholder, | 1098 LayoutObjectRenderMultiColumnSpannerPlaceholder, |
1091 RenderObjectRenderPart, | 1099 LayoutObjectRenderPart, |
1092 RenderObjectRenderRegion, | 1100 LayoutObjectRenderRegion, |
1093 RenderObjectRenderScrollbarPart, | 1101 LayoutObjectRenderScrollbarPart, |
1094 RenderObjectRenderView, | 1102 LayoutObjectRenderView, |
1095 RenderObjectReplica, | 1103 LayoutObjectReplica, |
1096 RenderObjectRuby, | 1104 LayoutObjectRuby, |
1097 RenderObjectRubyBase, | 1105 LayoutObjectRubyBase, |
1098 RenderObjectRubyRun, | 1106 LayoutObjectRubyRun, |
1099 RenderObjectRubyText, | 1107 LayoutObjectRubyText, |
1100 RenderObjectSlider, | 1108 LayoutObjectSlider, |
1101 RenderObjectSliderThumb, | 1109 LayoutObjectSliderThumb, |
1102 RenderObjectTable, | 1110 LayoutObjectTable, |
1103 RenderObjectTableCaption, | 1111 LayoutObjectTableCaption, |
1104 RenderObjectTableCell, | 1112 LayoutObjectTableCell, |
1105 RenderObjectTableRow, | 1113 LayoutObjectTableRow, |
1106 RenderObjectTableSection, | 1114 LayoutObjectTableSection, |
1107 RenderObjectTextArea, | 1115 LayoutObjectTextArea, |
1108 RenderObjectTextControl, | 1116 LayoutObjectTextControl, |
1109 RenderObjectTextField, | 1117 LayoutObjectTextField, |
1110 RenderObjectVideo, | 1118 LayoutObjectVideo, |
1111 RenderObjectWidget, | 1119 LayoutObjectWidget, |
1112 | 1120 |
1113 RenderObjectSVG, /* Keep by itself? */ | 1121 LayoutObjectSVG, /* Keep by itself? */ |
1114 RenderObjectSVGRoot, | 1122 LayoutObjectSVGRoot, |
1115 RenderObjectSVGContainer, | 1123 LayoutObjectSVGContainer, |
1116 RenderObjectSVGTransformableContainer, | 1124 LayoutObjectSVGTransformableContainer, |
1117 RenderObjectSVGViewportContainer, | 1125 LayoutObjectSVGViewportContainer, |
1118 RenderObjectSVGHiddenContainer, | 1126 LayoutObjectSVGHiddenContainer, |
1119 RenderObjectSVGGradientStop, | 1127 LayoutObjectSVGGradientStop, |
1120 RenderObjectSVGShape, | 1128 LayoutObjectSVGShape, |
1121 RenderObjectSVGText, | 1129 LayoutObjectSVGText, |
1122 RenderObjectSVGTextPath, | 1130 LayoutObjectSVGTextPath, |
1123 RenderObjectSVGInline, | 1131 LayoutObjectSVGInline, |
1124 RenderObjectSVGInlineText, | 1132 LayoutObjectSVGInlineText, |
1125 RenderObjectSVGImage, | 1133 LayoutObjectSVGImage, |
1126 RenderObjectSVGForeignObject, | 1134 LayoutObjectSVGForeignObject, |
1127 RenderObjectSVGResourceContainer, | 1135 LayoutObjectSVGResourceContainer, |
1128 RenderObjectSVGResourceFilter, | 1136 LayoutObjectSVGResourceFilter, |
1129 RenderObjectSVGResourceFilterPrimitive, | 1137 LayoutObjectSVGResourceFilterPrimitive, |
1130 }; | 1138 }; |
1131 virtual bool isOfType(RenderObjectType type) const { return false; } | 1139 virtual bool isOfType(LayoutObjectType type) const { return false; } |
1132 | 1140 |
1133 inline bool layerCreationAllowedForSubtree() const; | 1141 inline bool layerCreationAllowedForSubtree() const; |
1134 | 1142 |
1135 // Overrides should call the superclass at the end. m_style will be 0 the fi
rst time | 1143 // Overrides should call the superclass at the end. m_style will be 0 the fi
rst time |
1136 // this function will be called. | 1144 // this function will be called. |
1137 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle); | 1145 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle); |
1138 // Overrides should call the superclass at the start. |oldStyle| will be 0 t
he first | 1146 // Overrides should call the superclass at the start. |oldStyle| will be 0 t
he first |
1139 // time this function is called. | 1147 // time this function is called. |
1140 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); | 1148 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); |
1141 void propagateStyleToAnonymousChildren(bool blockChildrenOnly = false); | 1149 void propagateStyleToAnonymousChildren(bool blockChildrenOnly = false); |
1142 virtual void updateAnonymousChildStyle(const RenderObject* child, RenderStyl
e* style) const { } | 1150 virtual void updateAnonymousChildStyle(const LayoutObject* child, RenderStyl
e* style) const { } |
1143 | 1151 |
1144 protected: | 1152 protected: |
1145 void setSelfMayNeedPaintInvalidation(); | 1153 void setSelfMayNeedPaintInvalidation(); |
1146 | 1154 |
1147 void clearLayoutRootIfNeeded() const; | 1155 void clearLayoutRootIfNeeded() const; |
1148 virtual void willBeDestroyed(); | 1156 virtual void willBeDestroyed(); |
1149 void postDestroy(); | 1157 void postDestroy(); |
1150 | 1158 |
1151 virtual void insertedIntoTree(); | 1159 virtual void insertedIntoTree(); |
1152 virtual void willBeRemovedFromTree(); | 1160 virtual void willBeRemovedFromTree(); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1223 | 1231 |
1224 void markContainingBlockChainForPaintInvalidation(); | 1232 void markContainingBlockChainForPaintInvalidation(); |
1225 | 1233 |
1226 static bool isAllowedToModifyRenderTreeStructure(Document&); | 1234 static bool isAllowedToModifyRenderTreeStructure(Document&); |
1227 | 1235 |
1228 RefPtr<RenderStyle> m_style; | 1236 RefPtr<RenderStyle> m_style; |
1229 | 1237 |
1230 // Oilpan: raw pointer back to the owning Node is considered safe. | 1238 // Oilpan: raw pointer back to the owning Node is considered safe. |
1231 Node* m_node; | 1239 Node* m_node; |
1232 | 1240 |
1233 RenderObject* m_parent; | 1241 LayoutObject* m_parent; |
1234 RenderObject* m_previous; | 1242 LayoutObject* m_previous; |
1235 RenderObject* m_next; | 1243 LayoutObject* m_next; |
1236 | 1244 |
1237 #if ENABLE(ASSERT) | 1245 #if ENABLE(ASSERT) |
1238 unsigned m_hasAXObject : 1; | 1246 unsigned m_hasAXObject : 1; |
1239 unsigned m_setNeedsLayoutForbidden : 1; | 1247 unsigned m_setNeedsLayoutForbidden : 1; |
1240 #endif | 1248 #endif |
1241 | 1249 |
1242 #define ADD_BOOLEAN_BITFIELD(name, Name) \ | 1250 #define ADD_BOOLEAN_BITFIELD(name, Name) \ |
1243 private:\ | 1251 private:\ |
1244 unsigned m_##name : 1;\ | 1252 unsigned m_##name : 1;\ |
1245 public:\ | 1253 public:\ |
1246 bool name() const { return m_##name; }\ | 1254 bool name() const { return m_##name; }\ |
1247 void set##Name(bool name) { m_##name = name; }\ | 1255 void set##Name(bool name) { m_##name = name; }\ |
1248 | 1256 |
1249 class RenderObjectBitfields { | 1257 class LayoutObjectBitfields { |
1250 enum PositionedState { | 1258 enum PositionedState { |
1251 IsStaticallyPositioned = 0, | 1259 IsStaticallyPositioned = 0, |
1252 IsRelativelyPositioned = 1, | 1260 IsRelativelyPositioned = 1, |
1253 IsOutOfFlowPositioned = 2, | 1261 IsOutOfFlowPositioned = 2, |
1254 }; | 1262 }; |
1255 | 1263 |
1256 public: | 1264 public: |
1257 RenderObjectBitfields(Node* node) | 1265 LayoutObjectBitfields(Node* node) |
1258 : m_selfNeedsLayout(false) | 1266 : m_selfNeedsLayout(false) |
1259 , m_shouldInvalidateOverflowForPaint(false) | 1267 , m_shouldInvalidateOverflowForPaint(false) |
1260 // FIXME: We should remove mayNeedPaintInvalidation once we are able
to | 1268 // FIXME: We should remove mayNeedPaintInvalidation once we are able
to |
1261 // use the other layout flags to detect the same cases. crbug.com/37
0118 | 1269 // use the other layout flags to detect the same cases. crbug.com/37
0118 |
1262 , m_mayNeedPaintInvalidation(false) | 1270 , m_mayNeedPaintInvalidation(false) |
1263 , m_shouldInvalidateSelection(false) | 1271 , m_shouldInvalidateSelection(false) |
1264 , m_neededLayoutBecauseOfChildren(false) | 1272 , m_neededLayoutBecauseOfChildren(false) |
1265 , m_needsPositionedMovementLayout(false) | 1273 , m_needsPositionedMovementLayout(false) |
1266 , m_normalChildNeedsLayout(false) | 1274 , m_normalChildNeedsLayout(false) |
1267 , m_posChildNeedsLayout(false) | 1275 , m_posChildNeedsLayout(false) |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1367 | 1375 |
1368 ALWAYS_INLINE BoxDecorationBackgroundState boxDecorationBackgroundState(
) const { return static_cast<BoxDecorationBackgroundState>(m_boxDecorationBackgr
oundState); } | 1376 ALWAYS_INLINE BoxDecorationBackgroundState boxDecorationBackgroundState(
) const { return static_cast<BoxDecorationBackgroundState>(m_boxDecorationBackgr
oundState); } |
1369 ALWAYS_INLINE void setBoxDecorationBackgroundState(BoxDecorationBackgrou
ndState s) { m_boxDecorationBackgroundState = s; } | 1377 ALWAYS_INLINE void setBoxDecorationBackgroundState(BoxDecorationBackgrou
ndState s) { m_boxDecorationBackgroundState = s; } |
1370 | 1378 |
1371 PaintInvalidationReason fullPaintInvalidationReason() const { return sta
tic_cast<PaintInvalidationReason>(m_fullPaintInvalidationReason); } | 1379 PaintInvalidationReason fullPaintInvalidationReason() const { return sta
tic_cast<PaintInvalidationReason>(m_fullPaintInvalidationReason); } |
1372 void setFullPaintInvalidationReason(PaintInvalidationReason reason) { m_
fullPaintInvalidationReason = reason; } | 1380 void setFullPaintInvalidationReason(PaintInvalidationReason reason) { m_
fullPaintInvalidationReason = reason; } |
1373 }; | 1381 }; |
1374 | 1382 |
1375 #undef ADD_BOOLEAN_BITFIELD | 1383 #undef ADD_BOOLEAN_BITFIELD |
1376 | 1384 |
1377 RenderObjectBitfields m_bitfields; | 1385 LayoutObjectBitfields m_bitfields; |
1378 | 1386 |
1379 void setSelfNeedsLayout(bool b) { m_bitfields.setSelfNeedsLayout(b); } | 1387 void setSelfNeedsLayout(bool b) { m_bitfields.setSelfNeedsLayout(b); } |
1380 void setNeedsPositionedMovementLayout(bool b) { m_bitfields.setNeedsPosition
edMovementLayout(b); } | 1388 void setNeedsPositionedMovementLayout(bool b) { m_bitfields.setNeedsPosition
edMovementLayout(b); } |
1381 void setNormalChildNeedsLayout(bool b) { m_bitfields.setNormalChildNeedsLayo
ut(b); } | 1389 void setNormalChildNeedsLayout(bool b) { m_bitfields.setNormalChildNeedsLayo
ut(b); } |
1382 void setPosChildNeedsLayout(bool b) { m_bitfields.setPosChildNeedsLayout(b);
} | 1390 void setPosChildNeedsLayout(bool b) { m_bitfields.setPosChildNeedsLayout(b);
} |
1383 void setNeedsSimplifiedNormalFlowLayout(bool b) { m_bitfields.setNeedsSimpli
fiedNormalFlowLayout(b); } | 1391 void setNeedsSimplifiedNormalFlowLayout(bool b) { m_bitfields.setNeedsSimpli
fiedNormalFlowLayout(b); } |
1384 void setIsDragging(bool b) { m_bitfields.setIsDragging(b); } | 1392 void setIsDragging(bool b) { m_bitfields.setIsDragging(b); } |
1385 void setEverHadLayout(bool b) { m_bitfields.setEverHadLayout(b); } | 1393 void setEverHadLayout(bool b) { m_bitfields.setEverHadLayout(b); } |
1386 void setShouldInvalidateOverflowForPaint(bool b) { m_bitfields.setShouldInva
lidateOverflowForPaint(b); } | 1394 void setShouldInvalidateOverflowForPaint(bool b) { m_bitfields.setShouldInva
lidateOverflowForPaint(b); } |
1387 void setSelfNeedsOverflowRecalcAfterStyleChange(bool b) { m_bitfields.setSel
fNeedsOverflowRecalcAfterStyleChange(b); } | 1395 void setSelfNeedsOverflowRecalcAfterStyleChange(bool b) { m_bitfields.setSel
fNeedsOverflowRecalcAfterStyleChange(b); } |
(...skipping 18 matching lines...) Expand all Loading... |
1406 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyRenderTreeStructureAsserts); | 1414 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyRenderTreeStructureAsserts); |
1407 public: | 1415 public: |
1408 DeprecatedDisableModifyRenderTreeStructureAsserts(); | 1416 DeprecatedDisableModifyRenderTreeStructureAsserts(); |
1409 | 1417 |
1410 static bool canModifyRenderTreeStateInAnyState(); | 1418 static bool canModifyRenderTreeStateInAnyState(); |
1411 | 1419 |
1412 private: | 1420 private: |
1413 TemporaryChange<bool> m_disabler; | 1421 TemporaryChange<bool> m_disabler; |
1414 }; | 1422 }; |
1415 | 1423 |
1416 // Allow equality comparisons of RenderObjects by reference or pointer, intercha
ngeably. | 1424 // Allow equality comparisons of LayoutObjects by reference or pointer, intercha
ngeably. |
1417 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(RenderObject) | 1425 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(LayoutObject) |
1418 | 1426 |
1419 inline bool RenderObject::documentBeingDestroyed() const | 1427 inline bool LayoutObject::documentBeingDestroyed() const |
1420 { | 1428 { |
1421 return document().lifecycle().state() >= DocumentLifecycle::Stopping; | 1429 return document().lifecycle().state() >= DocumentLifecycle::Stopping; |
1422 } | 1430 } |
1423 | 1431 |
1424 inline bool RenderObject::isBeforeContent() const | 1432 inline bool LayoutObject::isBeforeContent() const |
1425 { | 1433 { |
1426 if (style()->styleType() != BEFORE) | 1434 if (style()->styleType() != BEFORE) |
1427 return false; | 1435 return false; |
1428 // Text nodes don't have their own styles, so ignore the style on a text nod
e. | 1436 // Text nodes don't have their own styles, so ignore the style on a text nod
e. |
1429 if (isText() && !isBR()) | 1437 if (isText() && !isBR()) |
1430 return false; | 1438 return false; |
1431 return true; | 1439 return true; |
1432 } | 1440 } |
1433 | 1441 |
1434 inline bool RenderObject::isAfterContent() const | 1442 inline bool LayoutObject::isAfterContent() const |
1435 { | 1443 { |
1436 if (style()->styleType() != AFTER) | 1444 if (style()->styleType() != AFTER) |
1437 return false; | 1445 return false; |
1438 // Text nodes don't have their own styles, so ignore the style on a text nod
e. | 1446 // Text nodes don't have their own styles, so ignore the style on a text nod
e. |
1439 if (isText() && !isBR()) | 1447 if (isText() && !isBR()) |
1440 return false; | 1448 return false; |
1441 return true; | 1449 return true; |
1442 } | 1450 } |
1443 | 1451 |
1444 inline bool RenderObject::isBeforeOrAfterContent() const | 1452 inline bool LayoutObject::isBeforeOrAfterContent() const |
1445 { | 1453 { |
1446 return isBeforeContent() || isAfterContent(); | 1454 return isBeforeContent() || isAfterContent(); |
1447 } | 1455 } |
1448 | 1456 |
1449 // setNeedsLayout() won't cause full paint invalidations as | 1457 // setNeedsLayout() won't cause full paint invalidations as |
1450 // setNeedsLayoutAndFullPaintInvalidation() does. Otherwise the two methods are
identical. | 1458 // setNeedsLayoutAndFullPaintInvalidation() does. Otherwise the two methods are
identical. |
1451 inline void RenderObject::setNeedsLayout(MarkingBehavior markParents, SubtreeLay
outScope* layouter) | 1459 inline void LayoutObject::setNeedsLayout(MarkingBehavior markParents, SubtreeLay
outScope* layouter) |
1452 { | 1460 { |
1453 TRACE_EVENT_INSTANT1( | 1461 TRACE_EVENT_INSTANT1( |
1454 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidationTracking"), | 1462 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidationTracking"), |
1455 "LayoutInvalidationTracking", | 1463 "LayoutInvalidationTracking", |
1456 "data", | 1464 "data", |
1457 InspectorLayoutInvalidationTrackingEvent::data(this)); | 1465 InspectorLayoutInvalidationTrackingEvent::data(this)); |
1458 ASSERT(!isSetNeedsLayoutForbidden()); | 1466 ASSERT(!isSetNeedsLayoutForbidden()); |
1459 bool alreadyNeededLayout = m_bitfields.selfNeedsLayout(); | 1467 bool alreadyNeededLayout = m_bitfields.selfNeedsLayout(); |
1460 setSelfNeedsLayout(true); | 1468 setSelfNeedsLayout(true); |
1461 if (!alreadyNeededLayout) { | 1469 if (!alreadyNeededLayout) { |
1462 if (markParents == MarkContainingBlockChain && (!layouter || layouter->r
oot() != this)) | 1470 if (markParents == MarkContainingBlockChain && (!layouter || layouter->r
oot() != this)) |
1463 markContainingBlocksForLayout(true, 0, layouter); | 1471 markContainingBlocksForLayout(true, 0, layouter); |
1464 } | 1472 } |
1465 } | 1473 } |
1466 | 1474 |
1467 inline void RenderObject::setNeedsLayoutAndFullPaintInvalidation(MarkingBehavior
markParents, SubtreeLayoutScope* layouter) | 1475 inline void LayoutObject::setNeedsLayoutAndFullPaintInvalidation(MarkingBehavior
markParents, SubtreeLayoutScope* layouter) |
1468 { | 1476 { |
1469 setNeedsLayout(markParents, layouter); | 1477 setNeedsLayout(markParents, layouter); |
1470 setShouldDoFullPaintInvalidation(); | 1478 setShouldDoFullPaintInvalidation(); |
1471 } | 1479 } |
1472 | 1480 |
1473 inline void RenderObject::clearNeedsLayout() | 1481 inline void LayoutObject::clearNeedsLayout() |
1474 { | 1482 { |
1475 setNeededLayoutBecauseOfChildren(needsLayoutBecauseOfChildren()); | 1483 setNeededLayoutBecauseOfChildren(needsLayoutBecauseOfChildren()); |
1476 setLayoutDidGetCalledSinceLastFrame(); | 1484 setLayoutDidGetCalledSinceLastFrame(); |
1477 setSelfNeedsLayout(false); | 1485 setSelfNeedsLayout(false); |
1478 setEverHadLayout(true); | 1486 setEverHadLayout(true); |
1479 setPosChildNeedsLayout(false); | 1487 setPosChildNeedsLayout(false); |
1480 setNeedsSimplifiedNormalFlowLayout(false); | 1488 setNeedsSimplifiedNormalFlowLayout(false); |
1481 setNormalChildNeedsLayout(false); | 1489 setNormalChildNeedsLayout(false); |
1482 setNeedsPositionedMovementLayout(false); | 1490 setNeedsPositionedMovementLayout(false); |
1483 setAncestorLineBoxDirty(false); | 1491 setAncestorLineBoxDirty(false); |
1484 #if ENABLE(ASSERT) | 1492 #if ENABLE(ASSERT) |
1485 checkBlockPositionedObjectsNeedLayout(); | 1493 checkBlockPositionedObjectsNeedLayout(); |
1486 #endif | 1494 #endif |
1487 } | 1495 } |
1488 | 1496 |
1489 inline void RenderObject::setChildNeedsLayout(MarkingBehavior markParents, Subtr
eeLayoutScope* layouter) | 1497 inline void LayoutObject::setChildNeedsLayout(MarkingBehavior markParents, Subtr
eeLayoutScope* layouter) |
1490 { | 1498 { |
1491 ASSERT(!isSetNeedsLayoutForbidden()); | 1499 ASSERT(!isSetNeedsLayoutForbidden()); |
1492 bool alreadyNeededLayout = normalChildNeedsLayout(); | 1500 bool alreadyNeededLayout = normalChildNeedsLayout(); |
1493 setNormalChildNeedsLayout(true); | 1501 setNormalChildNeedsLayout(true); |
1494 // FIXME: Replace MarkOnlyThis with the SubtreeLayoutScope code path and rem
ove the MarkingBehavior argument entirely. | 1502 // FIXME: Replace MarkOnlyThis with the SubtreeLayoutScope code path and rem
ove the MarkingBehavior argument entirely. |
1495 if (!alreadyNeededLayout && markParents == MarkContainingBlockChain && (!lay
outer || layouter->root() != this)) | 1503 if (!alreadyNeededLayout && markParents == MarkContainingBlockChain && (!lay
outer || layouter->root() != this)) |
1496 markContainingBlocksForLayout(true, 0, layouter); | 1504 markContainingBlocksForLayout(true, 0, layouter); |
1497 } | 1505 } |
1498 | 1506 |
1499 inline void RenderObject::setNeedsPositionedMovementLayout() | 1507 inline void LayoutObject::setNeedsPositionedMovementLayout() |
1500 { | 1508 { |
1501 bool alreadyNeededLayout = needsPositionedMovementLayout(); | 1509 bool alreadyNeededLayout = needsPositionedMovementLayout(); |
1502 setNeedsPositionedMovementLayout(true); | 1510 setNeedsPositionedMovementLayout(true); |
1503 ASSERT(!isSetNeedsLayoutForbidden()); | 1511 ASSERT(!isSetNeedsLayoutForbidden()); |
1504 if (!alreadyNeededLayout) | 1512 if (!alreadyNeededLayout) |
1505 markContainingBlocksForLayout(); | 1513 markContainingBlocksForLayout(); |
1506 } | 1514 } |
1507 | 1515 |
1508 inline bool RenderObject::preservesNewline() const | 1516 inline bool LayoutObject::preservesNewline() const |
1509 { | 1517 { |
1510 if (isSVGInlineText()) | 1518 if (isSVGInlineText()) |
1511 return false; | 1519 return false; |
1512 | 1520 |
1513 return style()->preserveNewline(); | 1521 return style()->preserveNewline(); |
1514 } | 1522 } |
1515 | 1523 |
1516 inline bool RenderObject::layerCreationAllowedForSubtree() const | 1524 inline bool LayoutObject::layerCreationAllowedForSubtree() const |
1517 { | 1525 { |
1518 RenderObject* parentRenderer = parent(); | 1526 LayoutObject* parentRenderer = parent(); |
1519 while (parentRenderer) { | 1527 while (parentRenderer) { |
1520 if (parentRenderer->isSVGHiddenContainer()) | 1528 if (parentRenderer->isSVGHiddenContainer()) |
1521 return false; | 1529 return false; |
1522 parentRenderer = parentRenderer->parent(); | 1530 parentRenderer = parentRenderer->parent(); |
1523 } | 1531 } |
1524 | 1532 |
1525 return true; | 1533 return true; |
1526 } | 1534 } |
1527 | 1535 |
1528 inline void RenderObject::setSelectionStateIfNeeded(SelectionState state) | 1536 inline void LayoutObject::setSelectionStateIfNeeded(SelectionState state) |
1529 { | 1537 { |
1530 if (selectionState() == state) | 1538 if (selectionState() == state) |
1531 return; | 1539 return; |
1532 | 1540 |
1533 setSelectionState(state); | 1541 setSelectionState(state); |
1534 } | 1542 } |
1535 | 1543 |
1536 inline void RenderObject::setHasBoxDecorationBackground(bool b) | 1544 inline void LayoutObject::setHasBoxDecorationBackground(bool b) |
1537 { | 1545 { |
1538 if (!b) { | 1546 if (!b) { |
1539 m_bitfields.setBoxDecorationBackgroundState(NoBoxDecorationBackground); | 1547 m_bitfields.setBoxDecorationBackgroundState(NoBoxDecorationBackground); |
1540 return; | 1548 return; |
1541 } | 1549 } |
1542 if (hasBoxDecorationBackground()) | 1550 if (hasBoxDecorationBackground()) |
1543 return; | 1551 return; |
1544 m_bitfields.setBoxDecorationBackgroundState(HasBoxDecorationBackgroundObscur
ationStatusInvalid); | 1552 m_bitfields.setBoxDecorationBackgroundState(HasBoxDecorationBackgroundObscur
ationStatusInvalid); |
1545 } | 1553 } |
1546 | 1554 |
1547 inline void RenderObject::invalidateBackgroundObscurationStatus() | 1555 inline void LayoutObject::invalidateBackgroundObscurationStatus() |
1548 { | 1556 { |
1549 if (!hasBoxDecorationBackground()) | 1557 if (!hasBoxDecorationBackground()) |
1550 return; | 1558 return; |
1551 m_bitfields.setBoxDecorationBackgroundState(HasBoxDecorationBackgroundObscur
ationStatusInvalid); | 1559 m_bitfields.setBoxDecorationBackgroundState(HasBoxDecorationBackgroundObscur
ationStatusInvalid); |
1552 } | 1560 } |
1553 | 1561 |
1554 inline bool RenderObject::boxDecorationBackgroundIsKnownToBeObscured() | 1562 inline bool LayoutObject::boxDecorationBackgroundIsKnownToBeObscured() |
1555 { | 1563 { |
1556 if (m_bitfields.boxDecorationBackgroundState() == HasBoxDecorationBackground
ObscurationStatusInvalid) { | 1564 if (m_bitfields.boxDecorationBackgroundState() == HasBoxDecorationBackground
ObscurationStatusInvalid) { |
1557 BoxDecorationBackgroundState state = computeBackgroundIsKnownToBeObscure
d() ? HasBoxDecorationBackgroundKnownToBeObscured : HasBoxDecorationBackgroundMa
yBeVisible; | 1565 BoxDecorationBackgroundState state = computeBackgroundIsKnownToBeObscure
d() ? HasBoxDecorationBackgroundKnownToBeObscured : HasBoxDecorationBackgroundMa
yBeVisible; |
1558 m_bitfields.setBoxDecorationBackgroundState(state); | 1566 m_bitfields.setBoxDecorationBackgroundState(state); |
1559 } | 1567 } |
1560 return m_bitfields.boxDecorationBackgroundState() == HasBoxDecorationBackgro
undKnownToBeObscured; | 1568 return m_bitfields.boxDecorationBackgroundState() == HasBoxDecorationBackgro
undKnownToBeObscured; |
1561 } | 1569 } |
1562 | 1570 |
1563 inline void makeMatrixRenderable(TransformationMatrix& matrix, bool has3DRenderi
ng) | 1571 inline void makeMatrixRenderable(TransformationMatrix& matrix, bool has3DRenderi
ng) |
1564 { | 1572 { |
1565 if (!has3DRendering) | 1573 if (!has3DRendering) |
1566 matrix.makeAffine(); | 1574 matrix.makeAffine(); |
1567 } | 1575 } |
1568 | 1576 |
1569 inline int adjustForAbsoluteZoom(int value, RenderObject* renderer) | 1577 inline int adjustForAbsoluteZoom(int value, LayoutObject* renderer) |
1570 { | 1578 { |
1571 return adjustForAbsoluteZoom(value, renderer->style()); | 1579 return adjustForAbsoluteZoom(value, renderer->style()); |
1572 } | 1580 } |
1573 | 1581 |
1574 inline double adjustDoubleForAbsoluteZoom(double value, RenderObject& renderer) | 1582 inline double adjustDoubleForAbsoluteZoom(double value, LayoutObject& renderer) |
1575 { | 1583 { |
1576 ASSERT(renderer.style()); | 1584 ASSERT(renderer.style()); |
1577 return adjustDoubleForAbsoluteZoom(value, *renderer.style()); | 1585 return adjustDoubleForAbsoluteZoom(value, *renderer.style()); |
1578 } | 1586 } |
1579 | 1587 |
1580 inline LayoutUnit adjustLayoutUnitForAbsoluteZoom(LayoutUnit value, RenderObject
& renderer) | 1588 inline LayoutUnit adjustLayoutUnitForAbsoluteZoom(LayoutUnit value, LayoutObject
& renderer) |
1581 { | 1589 { |
1582 ASSERT(renderer.style()); | 1590 ASSERT(renderer.style()); |
1583 return adjustLayoutUnitForAbsoluteZoom(value, *renderer.style()); | 1591 return adjustLayoutUnitForAbsoluteZoom(value, *renderer.style()); |
1584 } | 1592 } |
1585 | 1593 |
1586 inline void adjustFloatQuadForAbsoluteZoom(FloatQuad& quad, RenderObject& render
er) | 1594 inline void adjustFloatQuadForAbsoluteZoom(FloatQuad& quad, LayoutObject& render
er) |
1587 { | 1595 { |
1588 float zoom = renderer.style()->effectiveZoom(); | 1596 float zoom = renderer.style()->effectiveZoom(); |
1589 if (zoom != 1) | 1597 if (zoom != 1) |
1590 quad.scale(1 / zoom, 1 / zoom); | 1598 quad.scale(1 / zoom, 1 / zoom); |
1591 } | 1599 } |
1592 | 1600 |
1593 inline void adjustFloatRectForAbsoluteZoom(FloatRect& rect, RenderObject& render
er) | 1601 inline void adjustFloatRectForAbsoluteZoom(FloatRect& rect, LayoutObject& render
er) |
1594 { | 1602 { |
1595 float zoom = renderer.style()->effectiveZoom(); | 1603 float zoom = renderer.style()->effectiveZoom(); |
1596 if (zoom != 1) | 1604 if (zoom != 1) |
1597 rect.scale(1 / zoom, 1 / zoom); | 1605 rect.scale(1 / zoom, 1 / zoom); |
1598 } | 1606 } |
1599 | 1607 |
1600 inline double adjustScrollForAbsoluteZoom(double value, RenderObject& renderer) | 1608 inline double adjustScrollForAbsoluteZoom(double value, LayoutObject& renderer) |
1601 { | 1609 { |
1602 ASSERT(renderer.style()); | 1610 ASSERT(renderer.style()); |
1603 return adjustScrollForAbsoluteZoom(value, *renderer.style()); | 1611 return adjustScrollForAbsoluteZoom(value, *renderer.style()); |
1604 } | 1612 } |
1605 | 1613 |
1606 #define DEFINE_RENDER_OBJECT_TYPE_CASTS(thisType, predicate) \ | 1614 #define DEFINE_LAYOUT_OBJECT_TYPE_CASTS(thisType, predicate) \ |
1607 DEFINE_TYPE_CASTS(thisType, RenderObject, object, object->predicate, object.
predicate) | 1615 DEFINE_TYPE_CASTS(thisType, LayoutObject, object, object->predicate, object.
predicate) |
1608 | 1616 |
1609 } // namespace blink | 1617 } // namespace blink |
1610 | 1618 |
1611 #ifndef NDEBUG | 1619 #ifndef NDEBUG |
1612 // Outside the WebCore namespace for ease of invocation from gdb. | 1620 // Outside the WebCore namespace for ease of invocation from gdb. |
1613 void showTree(const blink::RenderObject*); | 1621 void showTree(const blink::LayoutObject*); |
1614 void showLineTree(const blink::RenderObject*); | 1622 void showLineTree(const blink::LayoutObject*); |
1615 void showRenderTree(const blink::RenderObject* object1); | 1623 void showRenderTree(const blink::LayoutObject* object1); |
1616 // We don't make object2 an optional parameter so that showRenderTree | 1624 // We don't make object2 an optional parameter so that showRenderTree |
1617 // can be called from gdb easily. | 1625 // can be called from gdb easily. |
1618 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec
t* object2); | 1626 void showRenderTree(const blink::LayoutObject* object1, const blink::LayoutObjec
t* object2); |
1619 | 1627 |
1620 #endif | 1628 #endif |
1621 | 1629 |
1622 #endif // RenderObject_h | 1630 #endif // LayoutObject_h |
OLD | NEW |