| 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*, RenderStyle*) const { return true
; } | 271 virtual bool isChildAllowed(LayoutObject*, RenderStyle*) const { return 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*, RenderStyle*); | 324 static LayoutObject* createObject(Element*, 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 { ASSERT(m_style); return *m_style; } | 806 const RenderStyle& styleRef() const { ASSERT(m_style); return *m_style; } |
| 803 | 807 |
| 804 /* The following methods are inlined in RenderObjectInlines.h */ | 808 /* The following methods are inlined in LayoutObjectInlines.h */ |
| 805 RenderStyle* firstLineStyle() const; | 809 RenderStyle* firstLineStyle() const; |
| 806 RenderStyle* style(bool firstLine) const; | 810 RenderStyle* style(bool firstLine) const; |
| 807 const RenderStyle& styleRef(bool firstLine) const; | 811 const RenderStyle& styleRef(bool firstLine) const; |
| 808 | 812 |
| 809 static inline Color resolveColor(const RenderStyle& styleToUse, int colorPro
perty) | 813 static inline Color resolveColor(const RenderStyle& styleToUse, int colorPro
perty) |
| 810 { | 814 { |
| 811 return styleToUse.visitedDependentColor(colorProperty); | 815 return styleToUse.visitedDependentColor(colorProperty); |
| 812 } | 816 } |
| 813 | 817 |
| 814 inline Color resolveColor(int colorProperty) const | 818 inline Color resolveColor(int colorProperty) const |
| (...skipping 20 matching lines...) Expand all Loading... |
| 835 // methods. | 839 // methods. |
| 836 const LayoutLayerModelObject* containerForPaintInvalidation() const; | 840 const LayoutLayerModelObject* containerForPaintInvalidation() const; |
| 837 const LayoutLayerModelObject* adjustCompositedContainerForSpecialAncestors(c
onst LayoutLayerModelObject* paintInvalidationContainer) const; | 841 const LayoutLayerModelObject* adjustCompositedContainerForSpecialAncestors(c
onst LayoutLayerModelObject* paintInvalidationContainer) const; |
| 838 bool isPaintInvalidationContainer() const; | 842 bool isPaintInvalidationContainer() const; |
| 839 | 843 |
| 840 LayoutRect computePaintInvalidationRect() | 844 LayoutRect computePaintInvalidationRect() |
| 841 { | 845 { |
| 842 return computePaintInvalidationRect(containerForPaintInvalidation()); | 846 return computePaintInvalidationRect(containerForPaintInvalidation()); |
| 843 } | 847 } |
| 844 | 848 |
| 845 // Returns the paint invalidation rect for this RenderObject in the coordina
te space of the paint backing (typically a GraphicsLayer) for |paintInvalidation
Container|. | 849 // Returns the paint invalidation rect for this LayoutObject in the coordina
te space of the paint backing (typically a GraphicsLayer) for |paintInvalidation
Container|. |
| 846 LayoutRect computePaintInvalidationRect(const LayoutLayerModelObject* paintI
nvalidationContainer, const PaintInvalidationState* = 0) const; | 850 LayoutRect computePaintInvalidationRect(const LayoutLayerModelObject* paintI
nvalidationContainer, const PaintInvalidationState* = 0) const; |
| 847 | 851 |
| 848 // Returns the rect bounds needed to invalidate the paint of this object, in
the coordinate space of the rendering backing of |paintInvalidationContainer| | 852 // Returns the rect bounds needed to invalidate the paint of this object, in
the coordinate space of the rendering backing of |paintInvalidationContainer| |
| 849 LayoutRect boundsRectForPaintInvalidation(const LayoutLayerModelObject* pain
tInvalidationContainer, const PaintInvalidationState* = 0) const; | 853 LayoutRect boundsRectForPaintInvalidation(const LayoutLayerModelObject* pain
tInvalidationContainer, const PaintInvalidationState* = 0) const; |
| 850 | 854 |
| 851 // Actually do the paint invalidate of rect r for this object which has been
computed in the coordinate space | 855 // Actually do the paint invalidate of rect r for this object which has been
computed in the coordinate space |
| 852 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t
his coordinaten space is not the same | 856 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t
his coordinaten space is not the same |
| 853 // as the local coordinate space of |paintInvalidationContainer| in the pres
ence of layer squashing. | 857 // as the local coordinate space of |paintInvalidationContainer| in the pres
ence of layer squashing. |
| 854 // If |paintInvalidationContainer| is 0, invalidate paints via the view. | 858 // If |paintInvalidationContainer| is 0, invalidate paints via the view. |
| 855 // FIXME: |paintInvalidationContainer| should never be 0. See crbug.com/3636
99. | 859 // FIXME: |paintInvalidationContainer| should never be 0. See crbug.com/3636
99. |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 957 virtual int previousOffsetForBackwardDeletion(int current) const; | 961 virtual int previousOffsetForBackwardDeletion(int current) const; |
| 958 virtual int nextOffset(int current) const; | 962 virtual int nextOffset(int current) const; |
| 959 | 963 |
| 960 virtual void imageChanged(ImageResource*, const IntRect* = 0) override final
; | 964 virtual void imageChanged(ImageResource*, const IntRect* = 0) override final
; |
| 961 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) { } | 965 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) { } |
| 962 virtual bool willRenderImage(ImageResource*) override final; | 966 virtual bool willRenderImage(ImageResource*) override final; |
| 963 virtual bool getImageAnimationPolicy(ImageResource*, ImageAnimationPolicy&)
override final; | 967 virtual bool getImageAnimationPolicy(ImageResource*, ImageAnimationPolicy&)
override final; |
| 964 | 968 |
| 965 void selectionStartEnd(int& spos, int& epos) const; | 969 void selectionStartEnd(int& spos, int& epos) const; |
| 966 | 970 |
| 967 void remove() { if (parent()) parent()->removeChild(this); } | 971 void remove() |
| 972 { |
| 973 if (parent()) |
| 974 parent()->removeChild(this); |
| 975 } |
| 968 | 976 |
| 969 bool isInert() const; | 977 bool isInert() const; |
| 970 | 978 |
| 971 bool supportsTouchAction() const; | 979 bool supportsTouchAction() const; |
| 972 | 980 |
| 973 bool visibleToHitTestRequest(const HitTestRequest& request) const { return s
tyle()->visibility() == VISIBLE && (request.ignorePointerEventsNone() || style()
->pointerEvents() != PE_NONE) && !isInert(); } | 981 bool visibleToHitTestRequest(const HitTestRequest& request) const { return s
tyle()->visibility() == VISIBLE && (request.ignorePointerEventsNone() || style()
->pointerEvents() != PE_NONE) && !isInert(); } |
| 974 | 982 |
| 975 bool visibleToHitTesting() const { return style()->visibility() == VISIBLE &
& style()->pointerEvents() != PE_NONE && !isInert(); } | 983 bool visibleToHitTesting() const { return style()->visibility() == VISIBLE &
& style()->pointerEvents() != PE_NONE && !isInert(); } |
| 976 | 984 |
| 977 // Map points and quads through elements, potentially via 3d transforms. You
should never need to call these directly; use | 985 // Map points and quads through elements, potentially via 3d transforms. You
should never need to call these directly; use |
| 978 // localToAbsolute/absoluteToLocal methods instead. | 986 // localToAbsolute/absoluteToLocal methods instead. |
| 979 virtual void mapLocalToContainer(const LayoutLayerModelObject* paintInvalida
tionContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool*
wasFixed = 0, const PaintInvalidationState* = 0) const; | 987 virtual void mapLocalToContainer(const LayoutLayerModelObject* paintInvalida
tionContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool*
wasFixed = 0, const PaintInvalidationState* = 0) const; |
| 980 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c
onst; | 988 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c
onst; |
| 981 | 989 |
| 982 // Pushes state onto RenderGeometryMap about how to map coordinates from thi
s renderer to its container, or ancestorToStopAt (whichever is encountered first
). | 990 // Pushes state onto RenderGeometryMap about how to map coordinates from thi
s renderer to its container, or ancestorToStopAt (whichever is encountered first
). |
| 983 // Returns the renderer which was mapped to (container or ancestorToStopAt). | 991 // Returns the renderer which was mapped to (container or ancestorToStopAt). |
| 984 virtual const RenderObject* pushMappingToContainer(const LayoutLayerModelObj
ect* ancestorToStopAt, RenderGeometryMap&) const; | 992 virtual const LayoutObject* pushMappingToContainer(const LayoutLayerModelObj
ect* ancestorToStopAt, RenderGeometryMap&) const; |
| 985 | 993 |
| 986 bool shouldUseTransformFromContainer(const RenderObject* container) const; | 994 bool shouldUseTransformFromContainer(const LayoutObject* container) const; |
| 987 void getTransformFromContainer(const RenderObject* container, const LayoutSi
ze& offsetInContainer, TransformationMatrix&) const; | 995 void getTransformFromContainer(const LayoutObject* container, const LayoutSi
ze& offsetInContainer, TransformationMatrix&) const; |
| 988 | 996 |
| 989 bool createsGroup() const { return isTransparent() || hasMask() || hasFilter
() || style()->hasBlendMode(); } | 997 bool createsGroup() const { return isTransparent() || hasMask() || hasFilter
() || style()->hasBlendMode(); } |
| 990 | 998 |
| 991 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit
ionalOffset) const { } | 999 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit
ionalOffset) const { } |
| 992 | 1000 |
| 993 // Compute a list of hit-test rectangles per layer rooted at this renderer. | 1001 // Compute a list of hit-test rectangles per layer rooted at this renderer. |
| 994 virtual void computeLayerHitTestRects(LayerHitTestRects&) const; | 1002 virtual void computeLayerHitTestRects(LayerHitTestRects&) const; |
| 995 | 1003 |
| 996 // 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. | 1004 // 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. |
| 997 RenderObject* rendererForRootBackground(); | 1005 LayoutObject* rendererForRootBackground(); |
| 998 | 1006 |
| 999 RespectImageOrientationEnum shouldRespectImageOrientation() const; | 1007 RespectImageOrientationEnum shouldRespectImageOrientation() const; |
| 1000 | 1008 |
| 1001 bool isRelayoutBoundaryForInspector() const; | 1009 bool isRelayoutBoundaryForInspector() const; |
| 1002 | 1010 |
| 1003 // The previous paint invalidation rect in the object's previous paint backi
ng. | 1011 // The previous paint invalidation rect in the object's previous paint backi
ng. |
| 1004 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP
aintInvalidationRect; } | 1012 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP
aintInvalidationRect; } |
| 1005 void setPreviousPaintInvalidationRect(const LayoutRect& rect) { m_previousPa
intInvalidationRect = rect; } | 1013 void setPreviousPaintInvalidationRect(const LayoutRect& rect) { m_previousPa
intInvalidationRect = rect; } |
| 1006 | 1014 |
| 1007 // The previous position of the top-left corner of the object in its previou
s paint backing. | 1015 // 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... |
| 1051 virtual bool supportsPaintInvalidationStateCachedOffsets() const { return !h
asColumns() && !hasTransformRelatedProperty() && !hasReflection() && !style()->i
sFlippedBlocksWritingMode(); } | 1059 virtual bool supportsPaintInvalidationStateCachedOffsets() const { return !h
asColumns() && !hasTransformRelatedProperty() && !hasReflection() && !style()->i
sFlippedBlocksWritingMode(); } |
| 1052 | 1060 |
| 1053 void setNeedsOverflowRecalcAfterStyleChange(); | 1061 void setNeedsOverflowRecalcAfterStyleChange(); |
| 1054 void markContainingBlocksForOverflowRecalc(); | 1062 void markContainingBlocksForOverflowRecalc(); |
| 1055 | 1063 |
| 1056 virtual LayoutRect viewRect() const; | 1064 virtual LayoutRect viewRect() const; |
| 1057 | 1065 |
| 1058 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi
s); } | 1066 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi
s); } |
| 1059 | 1067 |
| 1060 protected: | 1068 protected: |
| 1061 enum RenderObjectType { | 1069 enum LayoutObjectType { |
| 1062 RenderObjectBr, | 1070 LayoutObjectBr, |
| 1063 RenderObjectCanvas, | 1071 LayoutObjectCanvas, |
| 1064 RenderObjectFieldset, | 1072 LayoutObjectFieldset, |
| 1065 RenderObjectCounter, | 1073 LayoutObjectCounter, |
| 1066 RenderObjectDetailsMarker, | 1074 LayoutObjectDetailsMarker, |
| 1067 RenderObjectEmbeddedObject, | 1075 LayoutObjectEmbeddedObject, |
| 1068 RenderObjectFileUploadControl, | 1076 LayoutObjectFileUploadControl, |
| 1069 RenderObjectFrame, | 1077 LayoutObjectFrame, |
| 1070 RenderObjectFrameSet, | 1078 LayoutObjectFrameSet, |
| 1071 RenderObjectLayoutTableCol, | 1079 LayoutObjectLayoutTableCol, |
| 1072 RenderObjectListBox, | 1080 LayoutObjectListBox, |
| 1073 RenderObjectListItem, | 1081 LayoutObjectListItem, |
| 1074 RenderObjectListMarker, | 1082 LayoutObjectListMarker, |
| 1075 RenderObjectMedia, | 1083 LayoutObjectMedia, |
| 1076 RenderObjectMenuList, | 1084 LayoutObjectMenuList, |
| 1077 RenderObjectMeter, | 1085 LayoutObjectMeter, |
| 1078 RenderObjectProgress, | 1086 LayoutObjectProgress, |
| 1079 RenderObjectQuote, | 1087 LayoutObjectQuote, |
| 1080 RenderObjectRenderButton, | 1088 LayoutObjectRenderButton, |
| 1081 RenderObjectRenderFlowThread, | 1089 LayoutObjectRenderFlowThread, |
| 1082 RenderObjectRenderFullScreen, | 1090 LayoutObjectRenderFullScreen, |
| 1083 RenderObjectRenderFullScreenPlaceholder, | 1091 LayoutObjectRenderFullScreenPlaceholder, |
| 1084 RenderObjectRenderGrid, | 1092 LayoutObjectRenderGrid, |
| 1085 RenderObjectRenderIFrame, | 1093 LayoutObjectRenderIFrame, |
| 1086 RenderObjectRenderImage, | 1094 LayoutObjectRenderImage, |
| 1087 RenderObjectRenderInline, | 1095 LayoutObjectRenderInline, |
| 1088 RenderObjectRenderMultiColumnSet, | 1096 LayoutObjectRenderMultiColumnSet, |
| 1089 RenderObjectRenderMultiColumnSpannerPlaceholder, | 1097 LayoutObjectRenderMultiColumnSpannerPlaceholder, |
| 1090 RenderObjectRenderPart, | 1098 LayoutObjectRenderPart, |
| 1091 RenderObjectRenderRegion, | 1099 LayoutObjectRenderRegion, |
| 1092 RenderObjectRenderScrollbarPart, | 1100 LayoutObjectRenderScrollbarPart, |
| 1093 RenderObjectRenderView, | 1101 LayoutObjectRenderView, |
| 1094 RenderObjectReplica, | 1102 LayoutObjectReplica, |
| 1095 RenderObjectRuby, | 1103 LayoutObjectRuby, |
| 1096 RenderObjectRubyBase, | 1104 LayoutObjectRubyBase, |
| 1097 RenderObjectRubyRun, | 1105 LayoutObjectRubyRun, |
| 1098 RenderObjectRubyText, | 1106 LayoutObjectRubyText, |
| 1099 RenderObjectSlider, | 1107 LayoutObjectSlider, |
| 1100 RenderObjectSliderThumb, | 1108 LayoutObjectSliderThumb, |
| 1101 RenderObjectTable, | 1109 LayoutObjectTable, |
| 1102 RenderObjectTableCaption, | 1110 LayoutObjectTableCaption, |
| 1103 RenderObjectTableCell, | 1111 LayoutObjectTableCell, |
| 1104 RenderObjectTableRow, | 1112 LayoutObjectTableRow, |
| 1105 RenderObjectTableSection, | 1113 LayoutObjectTableSection, |
| 1106 RenderObjectTextArea, | 1114 LayoutObjectTextArea, |
| 1107 RenderObjectTextControl, | 1115 LayoutObjectTextControl, |
| 1108 RenderObjectTextField, | 1116 LayoutObjectTextField, |
| 1109 RenderObjectVideo, | 1117 LayoutObjectVideo, |
| 1110 RenderObjectWidget, | 1118 LayoutObjectWidget, |
| 1111 | 1119 |
| 1112 RenderObjectSVG, /* Keep by itself? */ | 1120 LayoutObjectSVG, /* Keep by itself? */ |
| 1113 RenderObjectSVGRoot, | 1121 LayoutObjectSVGRoot, |
| 1114 RenderObjectSVGContainer, | 1122 LayoutObjectSVGContainer, |
| 1115 RenderObjectSVGTransformableContainer, | 1123 LayoutObjectSVGTransformableContainer, |
| 1116 RenderObjectSVGViewportContainer, | 1124 LayoutObjectSVGViewportContainer, |
| 1117 RenderObjectSVGHiddenContainer, | 1125 LayoutObjectSVGHiddenContainer, |
| 1118 RenderObjectSVGGradientStop, | 1126 LayoutObjectSVGGradientStop, |
| 1119 RenderObjectSVGShape, | 1127 LayoutObjectSVGShape, |
| 1120 RenderObjectSVGText, | 1128 LayoutObjectSVGText, |
| 1121 RenderObjectSVGTextPath, | 1129 LayoutObjectSVGTextPath, |
| 1122 RenderObjectSVGInline, | 1130 LayoutObjectSVGInline, |
| 1123 RenderObjectSVGInlineText, | 1131 LayoutObjectSVGInlineText, |
| 1124 RenderObjectSVGImage, | 1132 LayoutObjectSVGImage, |
| 1125 RenderObjectSVGForeignObject, | 1133 LayoutObjectSVGForeignObject, |
| 1126 RenderObjectSVGResourceContainer, | 1134 LayoutObjectSVGResourceContainer, |
| 1127 RenderObjectSVGResourceFilter, | 1135 LayoutObjectSVGResourceFilter, |
| 1128 RenderObjectSVGResourceFilterPrimitive, | 1136 LayoutObjectSVGResourceFilterPrimitive, |
| 1129 }; | 1137 }; |
| 1130 virtual bool isOfType(RenderObjectType type) const { return false; } | 1138 virtual bool isOfType(LayoutObjectType type) const { return false; } |
| 1131 | 1139 |
| 1132 inline bool layerCreationAllowedForSubtree() const; | 1140 inline bool layerCreationAllowedForSubtree() const; |
| 1133 | 1141 |
| 1134 // Overrides should call the superclass at the end. m_style will be 0 the fi
rst time | 1142 // Overrides should call the superclass at the end. m_style will be 0 the fi
rst time |
| 1135 // this function will be called. | 1143 // this function will be called. |
| 1136 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle); | 1144 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle); |
| 1137 // Overrides should call the superclass at the start. |oldStyle| will be 0 t
he first | 1145 // Overrides should call the superclass at the start. |oldStyle| will be 0 t
he first |
| 1138 // time this function is called. | 1146 // time this function is called. |
| 1139 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); | 1147 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); |
| 1140 void propagateStyleToAnonymousChildren(bool blockChildrenOnly = false); | 1148 void propagateStyleToAnonymousChildren(bool blockChildrenOnly = false); |
| 1141 virtual void updateAnonymousChildStyle(const RenderObject* child, RenderStyl
e* style) const { } | 1149 virtual void updateAnonymousChildStyle(const LayoutObject* child, RenderStyl
e* style) const { } |
| 1142 | 1150 |
| 1143 protected: | 1151 protected: |
| 1144 void setSelfMayNeedPaintInvalidation(); | 1152 void setSelfMayNeedPaintInvalidation(); |
| 1145 | 1153 |
| 1146 void clearLayoutRootIfNeeded() const; | 1154 void clearLayoutRootIfNeeded() const; |
| 1147 virtual void willBeDestroyed(); | 1155 virtual void willBeDestroyed(); |
| 1148 void postDestroy(); | 1156 void postDestroy(); |
| 1149 | 1157 |
| 1150 virtual void insertedIntoTree(); | 1158 virtual void insertedIntoTree(); |
| 1151 virtual void willBeRemovedFromTree(); | 1159 virtual void willBeRemovedFromTree(); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1222 | 1230 |
| 1223 void markContainingBlockChainForPaintInvalidation(); | 1231 void markContainingBlockChainForPaintInvalidation(); |
| 1224 | 1232 |
| 1225 static bool isAllowedToModifyRenderTreeStructure(Document&); | 1233 static bool isAllowedToModifyRenderTreeStructure(Document&); |
| 1226 | 1234 |
| 1227 RefPtr<RenderStyle> m_style; | 1235 RefPtr<RenderStyle> m_style; |
| 1228 | 1236 |
| 1229 // Oilpan: raw pointer back to the owning Node is considered safe. | 1237 // Oilpan: raw pointer back to the owning Node is considered safe. |
| 1230 Node* m_node; | 1238 Node* m_node; |
| 1231 | 1239 |
| 1232 RenderObject* m_parent; | 1240 LayoutObject* m_parent; |
| 1233 RenderObject* m_previous; | 1241 LayoutObject* m_previous; |
| 1234 RenderObject* m_next; | 1242 LayoutObject* m_next; |
| 1235 | 1243 |
| 1236 #if ENABLE(ASSERT) | 1244 #if ENABLE(ASSERT) |
| 1237 unsigned m_hasAXObject : 1; | 1245 unsigned m_hasAXObject : 1; |
| 1238 unsigned m_setNeedsLayoutForbidden : 1; | 1246 unsigned m_setNeedsLayoutForbidden : 1; |
| 1239 #endif | 1247 #endif |
| 1240 | 1248 |
| 1241 #define ADD_BOOLEAN_BITFIELD(name, Name) \ | 1249 #define ADD_BOOLEAN_BITFIELD(name, Name) \ |
| 1242 private:\ | 1250 private:\ |
| 1243 unsigned m_##name : 1;\ | 1251 unsigned m_##name : 1;\ |
| 1244 public:\ | 1252 public:\ |
| 1245 bool name() const { return m_##name; }\ | 1253 bool name() const { return m_##name; }\ |
| 1246 void set##Name(bool name) { m_##name = name; }\ | 1254 void set##Name(bool name) { m_##name = name; }\ |
| 1247 | 1255 |
| 1248 class RenderObjectBitfields { | 1256 class LayoutObjectBitfields { |
| 1249 enum PositionedState { | 1257 enum PositionedState { |
| 1250 IsStaticallyPositioned = 0, | 1258 IsStaticallyPositioned = 0, |
| 1251 IsRelativelyPositioned = 1, | 1259 IsRelativelyPositioned = 1, |
| 1252 IsOutOfFlowPositioned = 2, | 1260 IsOutOfFlowPositioned = 2, |
| 1253 }; | 1261 }; |
| 1254 | 1262 |
| 1255 public: | 1263 public: |
| 1256 RenderObjectBitfields(Node* node) | 1264 LayoutObjectBitfields(Node* node) |
| 1257 : m_selfNeedsLayout(false) | 1265 : m_selfNeedsLayout(false) |
| 1258 , m_shouldInvalidateOverflowForPaint(false) | 1266 , m_shouldInvalidateOverflowForPaint(false) |
| 1259 // FIXME: We should remove mayNeedPaintInvalidation once we are able
to | 1267 // FIXME: We should remove mayNeedPaintInvalidation once we are able
to |
| 1260 // use the other layout flags to detect the same cases. crbug.com/37
0118 | 1268 // use the other layout flags to detect the same cases. crbug.com/37
0118 |
| 1261 , m_mayNeedPaintInvalidation(false) | 1269 , m_mayNeedPaintInvalidation(false) |
| 1262 , m_shouldInvalidateSelection(false) | 1270 , m_shouldInvalidateSelection(false) |
| 1263 , m_neededLayoutBecauseOfChildren(false) | 1271 , m_neededLayoutBecauseOfChildren(false) |
| 1264 , m_needsPositionedMovementLayout(false) | 1272 , m_needsPositionedMovementLayout(false) |
| 1265 , m_normalChildNeedsLayout(false) | 1273 , m_normalChildNeedsLayout(false) |
| 1266 , m_posChildNeedsLayout(false) | 1274 , m_posChildNeedsLayout(false) |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1366 | 1374 |
| 1367 ALWAYS_INLINE BoxDecorationBackgroundState boxDecorationBackgroundState(
) const { return static_cast<BoxDecorationBackgroundState>(m_boxDecorationBackgr
oundState); } | 1375 ALWAYS_INLINE BoxDecorationBackgroundState boxDecorationBackgroundState(
) const { return static_cast<BoxDecorationBackgroundState>(m_boxDecorationBackgr
oundState); } |
| 1368 ALWAYS_INLINE void setBoxDecorationBackgroundState(BoxDecorationBackgrou
ndState s) { m_boxDecorationBackgroundState = s; } | 1376 ALWAYS_INLINE void setBoxDecorationBackgroundState(BoxDecorationBackgrou
ndState s) { m_boxDecorationBackgroundState = s; } |
| 1369 | 1377 |
| 1370 PaintInvalidationReason fullPaintInvalidationReason() const { return sta
tic_cast<PaintInvalidationReason>(m_fullPaintInvalidationReason); } | 1378 PaintInvalidationReason fullPaintInvalidationReason() const { return sta
tic_cast<PaintInvalidationReason>(m_fullPaintInvalidationReason); } |
| 1371 void setFullPaintInvalidationReason(PaintInvalidationReason reason) { m_
fullPaintInvalidationReason = reason; } | 1379 void setFullPaintInvalidationReason(PaintInvalidationReason reason) { m_
fullPaintInvalidationReason = reason; } |
| 1372 }; | 1380 }; |
| 1373 | 1381 |
| 1374 #undef ADD_BOOLEAN_BITFIELD | 1382 #undef ADD_BOOLEAN_BITFIELD |
| 1375 | 1383 |
| 1376 RenderObjectBitfields m_bitfields; | 1384 LayoutObjectBitfields m_bitfields; |
| 1377 | 1385 |
| 1378 void setSelfNeedsLayout(bool b) { m_bitfields.setSelfNeedsLayout(b); } | 1386 void setSelfNeedsLayout(bool b) { m_bitfields.setSelfNeedsLayout(b); } |
| 1379 void setNeedsPositionedMovementLayout(bool b) { m_bitfields.setNeedsPosition
edMovementLayout(b); } | 1387 void setNeedsPositionedMovementLayout(bool b) { m_bitfields.setNeedsPosition
edMovementLayout(b); } |
| 1380 void setNormalChildNeedsLayout(bool b) { m_bitfields.setNormalChildNeedsLayo
ut(b); } | 1388 void setNormalChildNeedsLayout(bool b) { m_bitfields.setNormalChildNeedsLayo
ut(b); } |
| 1381 void setPosChildNeedsLayout(bool b) { m_bitfields.setPosChildNeedsLayout(b);
} | 1389 void setPosChildNeedsLayout(bool b) { m_bitfields.setPosChildNeedsLayout(b);
} |
| 1382 void setNeedsSimplifiedNormalFlowLayout(bool b) { m_bitfields.setNeedsSimpli
fiedNormalFlowLayout(b); } | 1390 void setNeedsSimplifiedNormalFlowLayout(bool b) { m_bitfields.setNeedsSimpli
fiedNormalFlowLayout(b); } |
| 1383 void setIsDragging(bool b) { m_bitfields.setIsDragging(b); } | 1391 void setIsDragging(bool b) { m_bitfields.setIsDragging(b); } |
| 1384 void setEverHadLayout(bool b) { m_bitfields.setEverHadLayout(b); } | 1392 void setEverHadLayout(bool b) { m_bitfields.setEverHadLayout(b); } |
| 1385 void setShouldInvalidateOverflowForPaint(bool b) { m_bitfields.setShouldInva
lidateOverflowForPaint(b); } | 1393 void setShouldInvalidateOverflowForPaint(bool b) { m_bitfields.setShouldInva
lidateOverflowForPaint(b); } |
| 1386 void setSelfNeedsOverflowRecalcAfterStyleChange(bool b) { m_bitfields.setSel
fNeedsOverflowRecalcAfterStyleChange(b); } | 1394 void setSelfNeedsOverflowRecalcAfterStyleChange(bool b) { m_bitfields.setSel
fNeedsOverflowRecalcAfterStyleChange(b); } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1405 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyRenderTreeStructureAsserts); | 1413 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyRenderTreeStructureAsserts); |
| 1406 public: | 1414 public: |
| 1407 DeprecatedDisableModifyRenderTreeStructureAsserts(); | 1415 DeprecatedDisableModifyRenderTreeStructureAsserts(); |
| 1408 | 1416 |
| 1409 static bool canModifyRenderTreeStateInAnyState(); | 1417 static bool canModifyRenderTreeStateInAnyState(); |
| 1410 | 1418 |
| 1411 private: | 1419 private: |
| 1412 TemporaryChange<bool> m_disabler; | 1420 TemporaryChange<bool> m_disabler; |
| 1413 }; | 1421 }; |
| 1414 | 1422 |
| 1415 // Allow equality comparisons of RenderObjects by reference or pointer, intercha
ngeably. | 1423 // Allow equality comparisons of LayoutObjects by reference or pointer, intercha
ngeably. |
| 1416 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(RenderObject) | 1424 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(LayoutObject) |
| 1417 | 1425 |
| 1418 inline bool RenderObject::documentBeingDestroyed() const | 1426 inline bool LayoutObject::documentBeingDestroyed() const |
| 1419 { | 1427 { |
| 1420 return document().lifecycle().state() >= DocumentLifecycle::Stopping; | 1428 return document().lifecycle().state() >= DocumentLifecycle::Stopping; |
| 1421 } | 1429 } |
| 1422 | 1430 |
| 1423 inline bool RenderObject::isBeforeContent() const | 1431 inline bool LayoutObject::isBeforeContent() const |
| 1424 { | 1432 { |
| 1425 if (style()->styleType() != BEFORE) | 1433 if (style()->styleType() != BEFORE) |
| 1426 return false; | 1434 return false; |
| 1427 // Text nodes don't have their own styles, so ignore the style on a text nod
e. | 1435 // Text nodes don't have their own styles, so ignore the style on a text nod
e. |
| 1428 if (isText() && !isBR()) | 1436 if (isText() && !isBR()) |
| 1429 return false; | 1437 return false; |
| 1430 return true; | 1438 return true; |
| 1431 } | 1439 } |
| 1432 | 1440 |
| 1433 inline bool RenderObject::isAfterContent() const | 1441 inline bool LayoutObject::isAfterContent() const |
| 1434 { | 1442 { |
| 1435 if (style()->styleType() != AFTER) | 1443 if (style()->styleType() != AFTER) |
| 1436 return false; | 1444 return false; |
| 1437 // Text nodes don't have their own styles, so ignore the style on a text nod
e. | 1445 // Text nodes don't have their own styles, so ignore the style on a text nod
e. |
| 1438 if (isText() && !isBR()) | 1446 if (isText() && !isBR()) |
| 1439 return false; | 1447 return false; |
| 1440 return true; | 1448 return true; |
| 1441 } | 1449 } |
| 1442 | 1450 |
| 1443 inline bool RenderObject::isBeforeOrAfterContent() const | 1451 inline bool LayoutObject::isBeforeOrAfterContent() const |
| 1444 { | 1452 { |
| 1445 return isBeforeContent() || isAfterContent(); | 1453 return isBeforeContent() || isAfterContent(); |
| 1446 } | 1454 } |
| 1447 | 1455 |
| 1448 // setNeedsLayout() won't cause full paint invalidations as | 1456 // setNeedsLayout() won't cause full paint invalidations as |
| 1449 // setNeedsLayoutAndFullPaintInvalidation() does. Otherwise the two methods are
identical. | 1457 // setNeedsLayoutAndFullPaintInvalidation() does. Otherwise the two methods are
identical. |
| 1450 inline void RenderObject::setNeedsLayout(MarkingBehavior markParents, SubtreeLay
outScope* layouter) | 1458 inline void LayoutObject::setNeedsLayout(MarkingBehavior markParents, SubtreeLay
outScope* layouter) |
| 1451 { | 1459 { |
| 1452 TRACE_EVENT_INSTANT1( | 1460 TRACE_EVENT_INSTANT1( |
| 1453 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidationTracking"), | 1461 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidationTracking"), |
| 1454 "LayoutInvalidationTracking", | 1462 "LayoutInvalidationTracking", |
| 1455 "data", | 1463 "data", |
| 1456 InspectorLayoutInvalidationTrackingEvent::data(this)); | 1464 InspectorLayoutInvalidationTrackingEvent::data(this)); |
| 1457 ASSERT(!isSetNeedsLayoutForbidden()); | 1465 ASSERT(!isSetNeedsLayoutForbidden()); |
| 1458 bool alreadyNeededLayout = m_bitfields.selfNeedsLayout(); | 1466 bool alreadyNeededLayout = m_bitfields.selfNeedsLayout(); |
| 1459 setSelfNeedsLayout(true); | 1467 setSelfNeedsLayout(true); |
| 1460 if (!alreadyNeededLayout) { | 1468 if (!alreadyNeededLayout) { |
| 1461 if (markParents == MarkContainingBlockChain && (!layouter || layouter->r
oot() != this)) | 1469 if (markParents == MarkContainingBlockChain && (!layouter || layouter->r
oot() != this)) |
| 1462 markContainingBlocksForLayout(true, 0, layouter); | 1470 markContainingBlocksForLayout(true, 0, layouter); |
| 1463 } | 1471 } |
| 1464 } | 1472 } |
| 1465 | 1473 |
| 1466 inline void RenderObject::setNeedsLayoutAndFullPaintInvalidation(MarkingBehavior
markParents, SubtreeLayoutScope* layouter) | 1474 inline void LayoutObject::setNeedsLayoutAndFullPaintInvalidation(MarkingBehavior
markParents, SubtreeLayoutScope* layouter) |
| 1467 { | 1475 { |
| 1468 setNeedsLayout(markParents, layouter); | 1476 setNeedsLayout(markParents, layouter); |
| 1469 setShouldDoFullPaintInvalidation(); | 1477 setShouldDoFullPaintInvalidation(); |
| 1470 } | 1478 } |
| 1471 | 1479 |
| 1472 inline void RenderObject::clearNeedsLayout() | 1480 inline void LayoutObject::clearNeedsLayout() |
| 1473 { | 1481 { |
| 1474 setNeededLayoutBecauseOfChildren(needsLayoutBecauseOfChildren()); | 1482 setNeededLayoutBecauseOfChildren(needsLayoutBecauseOfChildren()); |
| 1475 setLayoutDidGetCalledSinceLastFrame(); | 1483 setLayoutDidGetCalledSinceLastFrame(); |
| 1476 setSelfNeedsLayout(false); | 1484 setSelfNeedsLayout(false); |
| 1477 setEverHadLayout(true); | 1485 setEverHadLayout(true); |
| 1478 setPosChildNeedsLayout(false); | 1486 setPosChildNeedsLayout(false); |
| 1479 setNeedsSimplifiedNormalFlowLayout(false); | 1487 setNeedsSimplifiedNormalFlowLayout(false); |
| 1480 setNormalChildNeedsLayout(false); | 1488 setNormalChildNeedsLayout(false); |
| 1481 setNeedsPositionedMovementLayout(false); | 1489 setNeedsPositionedMovementLayout(false); |
| 1482 setAncestorLineBoxDirty(false); | 1490 setAncestorLineBoxDirty(false); |
| 1483 #if ENABLE(ASSERT) | 1491 #if ENABLE(ASSERT) |
| 1484 checkBlockPositionedObjectsNeedLayout(); | 1492 checkBlockPositionedObjectsNeedLayout(); |
| 1485 #endif | 1493 #endif |
| 1486 } | 1494 } |
| 1487 | 1495 |
| 1488 inline void RenderObject::setChildNeedsLayout(MarkingBehavior markParents, Subtr
eeLayoutScope* layouter) | 1496 inline void LayoutObject::setChildNeedsLayout(MarkingBehavior markParents, Subtr
eeLayoutScope* layouter) |
| 1489 { | 1497 { |
| 1490 ASSERT(!isSetNeedsLayoutForbidden()); | 1498 ASSERT(!isSetNeedsLayoutForbidden()); |
| 1491 bool alreadyNeededLayout = normalChildNeedsLayout(); | 1499 bool alreadyNeededLayout = normalChildNeedsLayout(); |
| 1492 setNormalChildNeedsLayout(true); | 1500 setNormalChildNeedsLayout(true); |
| 1493 // FIXME: Replace MarkOnlyThis with the SubtreeLayoutScope code path and rem
ove the MarkingBehavior argument entirely. | 1501 // FIXME: Replace MarkOnlyThis with the SubtreeLayoutScope code path and rem
ove the MarkingBehavior argument entirely. |
| 1494 if (!alreadyNeededLayout && markParents == MarkContainingBlockChain && (!lay
outer || layouter->root() != this)) | 1502 if (!alreadyNeededLayout && markParents == MarkContainingBlockChain && (!lay
outer || layouter->root() != this)) |
| 1495 markContainingBlocksForLayout(true, 0, layouter); | 1503 markContainingBlocksForLayout(true, 0, layouter); |
| 1496 } | 1504 } |
| 1497 | 1505 |
| 1498 inline void RenderObject::setNeedsPositionedMovementLayout() | 1506 inline void LayoutObject::setNeedsPositionedMovementLayout() |
| 1499 { | 1507 { |
| 1500 bool alreadyNeededLayout = needsPositionedMovementLayout(); | 1508 bool alreadyNeededLayout = needsPositionedMovementLayout(); |
| 1501 setNeedsPositionedMovementLayout(true); | 1509 setNeedsPositionedMovementLayout(true); |
| 1502 ASSERT(!isSetNeedsLayoutForbidden()); | 1510 ASSERT(!isSetNeedsLayoutForbidden()); |
| 1503 if (!alreadyNeededLayout) | 1511 if (!alreadyNeededLayout) |
| 1504 markContainingBlocksForLayout(); | 1512 markContainingBlocksForLayout(); |
| 1505 } | 1513 } |
| 1506 | 1514 |
| 1507 inline bool RenderObject::preservesNewline() const | 1515 inline bool LayoutObject::preservesNewline() const |
| 1508 { | 1516 { |
| 1509 if (isSVGInlineText()) | 1517 if (isSVGInlineText()) |
| 1510 return false; | 1518 return false; |
| 1511 | 1519 |
| 1512 return style()->preserveNewline(); | 1520 return style()->preserveNewline(); |
| 1513 } | 1521 } |
| 1514 | 1522 |
| 1515 inline bool RenderObject::layerCreationAllowedForSubtree() const | 1523 inline bool LayoutObject::layerCreationAllowedForSubtree() const |
| 1516 { | 1524 { |
| 1517 RenderObject* parentRenderer = parent(); | 1525 LayoutObject* parentRenderer = parent(); |
| 1518 while (parentRenderer) { | 1526 while (parentRenderer) { |
| 1519 if (parentRenderer->isSVGHiddenContainer()) | 1527 if (parentRenderer->isSVGHiddenContainer()) |
| 1520 return false; | 1528 return false; |
| 1521 parentRenderer = parentRenderer->parent(); | 1529 parentRenderer = parentRenderer->parent(); |
| 1522 } | 1530 } |
| 1523 | 1531 |
| 1524 return true; | 1532 return true; |
| 1525 } | 1533 } |
| 1526 | 1534 |
| 1527 inline void RenderObject::setSelectionStateIfNeeded(SelectionState state) | 1535 inline void LayoutObject::setSelectionStateIfNeeded(SelectionState state) |
| 1528 { | 1536 { |
| 1529 if (selectionState() == state) | 1537 if (selectionState() == state) |
| 1530 return; | 1538 return; |
| 1531 | 1539 |
| 1532 setSelectionState(state); | 1540 setSelectionState(state); |
| 1533 } | 1541 } |
| 1534 | 1542 |
| 1535 inline void RenderObject::setHasBoxDecorationBackground(bool b) | 1543 inline void LayoutObject::setHasBoxDecorationBackground(bool b) |
| 1536 { | 1544 { |
| 1537 if (!b) { | 1545 if (!b) { |
| 1538 m_bitfields.setBoxDecorationBackgroundState(NoBoxDecorationBackground); | 1546 m_bitfields.setBoxDecorationBackgroundState(NoBoxDecorationBackground); |
| 1539 return; | 1547 return; |
| 1540 } | 1548 } |
| 1541 if (hasBoxDecorationBackground()) | 1549 if (hasBoxDecorationBackground()) |
| 1542 return; | 1550 return; |
| 1543 m_bitfields.setBoxDecorationBackgroundState(HasBoxDecorationBackgroundObscur
ationStatusInvalid); | 1551 m_bitfields.setBoxDecorationBackgroundState(HasBoxDecorationBackgroundObscur
ationStatusInvalid); |
| 1544 } | 1552 } |
| 1545 | 1553 |
| 1546 inline void RenderObject::invalidateBackgroundObscurationStatus() | 1554 inline void LayoutObject::invalidateBackgroundObscurationStatus() |
| 1547 { | 1555 { |
| 1548 if (!hasBoxDecorationBackground()) | 1556 if (!hasBoxDecorationBackground()) |
| 1549 return; | 1557 return; |
| 1550 m_bitfields.setBoxDecorationBackgroundState(HasBoxDecorationBackgroundObscur
ationStatusInvalid); | 1558 m_bitfields.setBoxDecorationBackgroundState(HasBoxDecorationBackgroundObscur
ationStatusInvalid); |
| 1551 } | 1559 } |
| 1552 | 1560 |
| 1553 inline bool RenderObject::boxDecorationBackgroundIsKnownToBeObscured() | 1561 inline bool LayoutObject::boxDecorationBackgroundIsKnownToBeObscured() |
| 1554 { | 1562 { |
| 1555 if (m_bitfields.boxDecorationBackgroundState() == HasBoxDecorationBackground
ObscurationStatusInvalid) { | 1563 if (m_bitfields.boxDecorationBackgroundState() == HasBoxDecorationBackground
ObscurationStatusInvalid) { |
| 1556 BoxDecorationBackgroundState state = computeBackgroundIsKnownToBeObscure
d() ? HasBoxDecorationBackgroundKnownToBeObscured : HasBoxDecorationBackgroundMa
yBeVisible; | 1564 BoxDecorationBackgroundState state = computeBackgroundIsKnownToBeObscure
d() ? HasBoxDecorationBackgroundKnownToBeObscured : HasBoxDecorationBackgroundMa
yBeVisible; |
| 1557 m_bitfields.setBoxDecorationBackgroundState(state); | 1565 m_bitfields.setBoxDecorationBackgroundState(state); |
| 1558 } | 1566 } |
| 1559 return m_bitfields.boxDecorationBackgroundState() == HasBoxDecorationBackgro
undKnownToBeObscured; | 1567 return m_bitfields.boxDecorationBackgroundState() == HasBoxDecorationBackgro
undKnownToBeObscured; |
| 1560 } | 1568 } |
| 1561 | 1569 |
| 1562 inline void makeMatrixRenderable(TransformationMatrix& matrix, bool has3DRenderi
ng) | 1570 inline void makeMatrixRenderable(TransformationMatrix& matrix, bool has3DRenderi
ng) |
| 1563 { | 1571 { |
| 1564 if (!has3DRendering) | 1572 if (!has3DRendering) |
| 1565 matrix.makeAffine(); | 1573 matrix.makeAffine(); |
| 1566 } | 1574 } |
| 1567 | 1575 |
| 1568 inline int adjustForAbsoluteZoom(int value, RenderObject* renderer) | 1576 inline int adjustForAbsoluteZoom(int value, LayoutObject* renderer) |
| 1569 { | 1577 { |
| 1570 return adjustForAbsoluteZoom(value, renderer->style()); | 1578 return adjustForAbsoluteZoom(value, renderer->style()); |
| 1571 } | 1579 } |
| 1572 | 1580 |
| 1573 inline double adjustDoubleForAbsoluteZoom(double value, RenderObject& renderer) | 1581 inline double adjustDoubleForAbsoluteZoom(double value, LayoutObject& renderer) |
| 1574 { | 1582 { |
| 1575 ASSERT(renderer.style()); | 1583 ASSERT(renderer.style()); |
| 1576 return adjustDoubleForAbsoluteZoom(value, *renderer.style()); | 1584 return adjustDoubleForAbsoluteZoom(value, *renderer.style()); |
| 1577 } | 1585 } |
| 1578 | 1586 |
| 1579 inline LayoutUnit adjustLayoutUnitForAbsoluteZoom(LayoutUnit value, RenderObject
& renderer) | 1587 inline LayoutUnit adjustLayoutUnitForAbsoluteZoom(LayoutUnit value, LayoutObject
& renderer) |
| 1580 { | 1588 { |
| 1581 ASSERT(renderer.style()); | 1589 ASSERT(renderer.style()); |
| 1582 return adjustLayoutUnitForAbsoluteZoom(value, *renderer.style()); | 1590 return adjustLayoutUnitForAbsoluteZoom(value, *renderer.style()); |
| 1583 } | 1591 } |
| 1584 | 1592 |
| 1585 inline void adjustFloatQuadForAbsoluteZoom(FloatQuad& quad, RenderObject& render
er) | 1593 inline void adjustFloatQuadForAbsoluteZoom(FloatQuad& quad, LayoutObject& render
er) |
| 1586 { | 1594 { |
| 1587 float zoom = renderer.style()->effectiveZoom(); | 1595 float zoom = renderer.style()->effectiveZoom(); |
| 1588 if (zoom != 1) | 1596 if (zoom != 1) |
| 1589 quad.scale(1 / zoom, 1 / zoom); | 1597 quad.scale(1 / zoom, 1 / zoom); |
| 1590 } | 1598 } |
| 1591 | 1599 |
| 1592 inline void adjustFloatRectForAbsoluteZoom(FloatRect& rect, RenderObject& render
er) | 1600 inline void adjustFloatRectForAbsoluteZoom(FloatRect& rect, LayoutObject& render
er) |
| 1593 { | 1601 { |
| 1594 float zoom = renderer.style()->effectiveZoom(); | 1602 float zoom = renderer.style()->effectiveZoom(); |
| 1595 if (zoom != 1) | 1603 if (zoom != 1) |
| 1596 rect.scale(1 / zoom, 1 / zoom); | 1604 rect.scale(1 / zoom, 1 / zoom); |
| 1597 } | 1605 } |
| 1598 | 1606 |
| 1599 inline double adjustScrollForAbsoluteZoom(double value, RenderObject& renderer) | 1607 inline double adjustScrollForAbsoluteZoom(double value, LayoutObject& renderer) |
| 1600 { | 1608 { |
| 1601 ASSERT(renderer.style()); | 1609 ASSERT(renderer.style()); |
| 1602 return adjustScrollForAbsoluteZoom(value, *renderer.style()); | 1610 return adjustScrollForAbsoluteZoom(value, *renderer.style()); |
| 1603 } | 1611 } |
| 1604 | 1612 |
| 1605 #define DEFINE_RENDER_OBJECT_TYPE_CASTS(thisType, predicate) \ | 1613 #define DEFINE_LAYOUT_OBJECT_TYPE_CASTS(thisType, predicate) \ |
| 1606 DEFINE_TYPE_CASTS(thisType, RenderObject, object, object->predicate, object.
predicate) | 1614 DEFINE_TYPE_CASTS(thisType, LayoutObject, object, object->predicate, object.
predicate) |
| 1607 | 1615 |
| 1608 } // namespace blink | 1616 } // namespace blink |
| 1609 | 1617 |
| 1610 #ifndef NDEBUG | 1618 #ifndef NDEBUG |
| 1611 // Outside the WebCore namespace for ease of invocation from gdb. | 1619 // Outside the WebCore namespace for ease of invocation from gdb. |
| 1612 void showTree(const blink::RenderObject*); | 1620 void showTree(const blink::LayoutObject*); |
| 1613 void showLineTree(const blink::RenderObject*); | 1621 void showLineTree(const blink::LayoutObject*); |
| 1614 void showRenderTree(const blink::RenderObject* object1); | 1622 void showRenderTree(const blink::LayoutObject* object1); |
| 1615 // We don't make object2 an optional parameter so that showRenderTree | 1623 // We don't make object2 an optional parameter so that showRenderTree |
| 1616 // can be called from gdb easily. | 1624 // can be called from gdb easily. |
| 1617 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec
t* object2); | 1625 void showRenderTree(const blink::LayoutObject* object1, const blink::LayoutObjec
t* object2); |
| 1618 | 1626 |
| 1619 #endif | 1627 #endif |
| 1620 | 1628 |
| 1621 #endif // RenderObject_h | 1629 #endif // LayoutObject_h |
| OLD | NEW |