| 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 |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 // DisplayItemClient methods. | 238 // DisplayItemClient methods. |
| 239 LayoutRect visualRect() const override; | 239 LayoutRect visualRect() const override; |
| 240 String debugName() const final; | 240 String debugName() const final; |
| 241 | 241 |
| 242 LayoutObject* parent() const { return m_parent; } | 242 LayoutObject* parent() const { return m_parent; } |
| 243 bool isDescendantOf(const LayoutObject*) const; | 243 bool isDescendantOf(const LayoutObject*) const; |
| 244 | 244 |
| 245 LayoutObject* previousSibling() const { return m_previous; } | 245 LayoutObject* previousSibling() const { return m_previous; } |
| 246 LayoutObject* nextSibling() const { return m_next; } | 246 LayoutObject* nextSibling() const { return m_next; } |
| 247 | 247 |
| 248 DISABLE_CFI_PERF |
| 248 LayoutObject* slowFirstChild() const | 249 LayoutObject* slowFirstChild() const |
| 249 { | 250 { |
| 250 if (const LayoutObjectChildList* children = virtualChildren()) | 251 if (const LayoutObjectChildList* children = virtualChildren()) |
| 251 return children->firstChild(); | 252 return children->firstChild(); |
| 252 return nullptr; | 253 return nullptr; |
| 253 } | 254 } |
| 254 LayoutObject* slowLastChild() const | 255 LayoutObject* slowLastChild() const |
| 255 { | 256 { |
| 256 if (const LayoutObjectChildList* children = virtualChildren()) | 257 if (const LayoutObjectChildList* children = virtualChildren()) |
| 257 return children->lastChild(); | 258 return children->lastChild(); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 void assertSubtreeClearedPaintInvalidationFlags() const | 351 void assertSubtreeClearedPaintInvalidationFlags() const |
| 351 { | 352 { |
| 352 for (const LayoutObject* layoutObject = this; layoutObject; layoutObject
= layoutObject->nextInPreOrder()) | 353 for (const LayoutObject* layoutObject = this; layoutObject; layoutObject
= layoutObject->nextInPreOrder()) |
| 353 layoutObject->assertClearedPaintInvalidationFlags(); | 354 layoutObject->assertClearedPaintInvalidationFlags(); |
| 354 } | 355 } |
| 355 | 356 |
| 356 #endif | 357 #endif |
| 357 | 358 |
| 358 // LayoutObject tree manipulation | 359 // LayoutObject tree manipulation |
| 359 ////////////////////////////////////////// | 360 ////////////////////////////////////////// |
| 360 virtual bool canHaveChildren() const { return virtualChildren(); } | 361 DISABLE_CFI_PERF virtual bool canHaveChildren() const { return virtualChildr
en(); } |
| 361 virtual bool isChildAllowed(LayoutObject*, const ComputedStyle&) const { ret
urn true; } | 362 virtual bool isChildAllowed(LayoutObject*, const ComputedStyle&) const { ret
urn true; } |
| 362 | 363 |
| 363 // This function is called whenever a child is inserted under |this|. | 364 // This function is called whenever a child is inserted under |this|. |
| 364 // | 365 // |
| 365 // The main purpose of this function is to generate a consistent layout | 366 // The main purpose of this function is to generate a consistent layout |
| 366 // tree, which means generating the missing anonymous objects. Most of the | 367 // tree, which means generating the missing anonymous objects. Most of the |
| 367 // time there'll be no anonymous objects to generate. | 368 // time there'll be no anonymous objects to generate. |
| 368 // | 369 // |
| 369 // The following invariants are true on the input: | 370 // The following invariants are true on the input: |
| 370 // - |newChild->node()| is a child of |this->node()|, if |this| is not | 371 // - |newChild->node()| is a child of |this->node()|, if |this| is not |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 void notifyOfSubtreeChange(); | 879 void notifyOfSubtreeChange(); |
| 879 void notifyAncestorsOfSubtreeChange(); | 880 void notifyAncestorsOfSubtreeChange(); |
| 880 bool wasNotifiedOfSubtreeChange() const { return m_bitfields.notifiedOfSubtr
eeChange(); } | 881 bool wasNotifiedOfSubtreeChange() const { return m_bitfields.notifiedOfSubtr
eeChange(); } |
| 881 | 882 |
| 882 // Flags used to signify that a layoutObject needs to be notified by its des
cendants that they have | 883 // Flags used to signify that a layoutObject needs to be notified by its des
cendants that they have |
| 883 // had their child subtree changed. | 884 // had their child subtree changed. |
| 884 void registerSubtreeChangeListenerOnDescendants(bool); | 885 void registerSubtreeChangeListenerOnDescendants(bool); |
| 885 bool hasSubtreeChangeListenerRegistered() const { return m_bitfields.subtree
ChangeListenerRegistered(); } | 886 bool hasSubtreeChangeListenerRegistered() const { return m_bitfields.subtree
ChangeListenerRegistered(); } |
| 886 | 887 |
| 887 /* This function performs a layout only if one is needed. */ | 888 /* This function performs a layout only if one is needed. */ |
| 888 void layoutIfNeeded() | 889 DISABLE_CFI_PERF void layoutIfNeeded() |
| 889 { | 890 { |
| 890 if (needsLayout()) | 891 if (needsLayout()) |
| 891 layout(); | 892 layout(); |
| 892 } | 893 } |
| 893 | 894 |
| 894 void forceLayout(); | 895 void forceLayout(); |
| 895 void forceChildLayout(); | 896 void forceChildLayout(); |
| 896 | 897 |
| 897 // Used for element state updates that cannot be fixed with a | 898 // Used for element state updates that cannot be fixed with a |
| 898 // paint invalidation and do not need a relayout. | 899 // paint invalidation and do not need a relayout. |
| (...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2080 | 2081 |
| 2081 m_bitfields.setHasBoxDecorationBackground(b); | 2082 m_bitfields.setHasBoxDecorationBackground(b); |
| 2082 invalidateBackgroundObscurationStatus(); | 2083 invalidateBackgroundObscurationStatus(); |
| 2083 } | 2084 } |
| 2084 | 2085 |
| 2085 inline void LayoutObject::invalidateBackgroundObscurationStatus() | 2086 inline void LayoutObject::invalidateBackgroundObscurationStatus() |
| 2086 { | 2087 { |
| 2087 m_bitfields.setBackgroundObscurationState(BackgroundObscurationStatusInvalid
); | 2088 m_bitfields.setBackgroundObscurationState(BackgroundObscurationStatusInvalid
); |
| 2088 } | 2089 } |
| 2089 | 2090 |
| 2091 DISABLE_CFI_PERF |
| 2090 inline bool LayoutObject::backgroundIsKnownToBeObscured() const | 2092 inline bool LayoutObject::backgroundIsKnownToBeObscured() const |
| 2091 { | 2093 { |
| 2092 if (m_bitfields.getBackgroundObscurationState() == BackgroundObscurationStat
usInvalid) { | 2094 if (m_bitfields.getBackgroundObscurationState() == BackgroundObscurationStat
usInvalid) { |
| 2093 BackgroundObscurationState state = computeBackgroundIsKnownToBeObscured(
) ? BackgroundKnownToBeObscured : BackgroundMayBeVisible; | 2095 BackgroundObscurationState state = computeBackgroundIsKnownToBeObscured(
) ? BackgroundKnownToBeObscured : BackgroundMayBeVisible; |
| 2094 m_bitfields.setBackgroundObscurationState(state); | 2096 m_bitfields.setBackgroundObscurationState(state); |
| 2095 } | 2097 } |
| 2096 return m_bitfields.getBackgroundObscurationState() == BackgroundKnownToBeObs
cured; | 2098 return m_bitfields.getBackgroundObscurationState() == BackgroundKnownToBeObs
cured; |
| 2097 } | 2099 } |
| 2098 | 2100 |
| 2099 inline void makeMatrixRenderable(TransformationMatrix& matrix, bool has3DRenderi
ng) | 2101 inline void makeMatrixRenderable(TransformationMatrix& matrix, bool has3DRenderi
ng) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2143 void showTree(const blink::LayoutObject*); | 2145 void showTree(const blink::LayoutObject*); |
| 2144 void showLineTree(const blink::LayoutObject*); | 2146 void showLineTree(const blink::LayoutObject*); |
| 2145 void showLayoutTree(const blink::LayoutObject* object1); | 2147 void showLayoutTree(const blink::LayoutObject* object1); |
| 2146 // We don't make object2 an optional parameter so that showLayoutTree | 2148 // We don't make object2 an optional parameter so that showLayoutTree |
| 2147 // can be called from gdb easily. | 2149 // can be called from gdb easily. |
| 2148 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec
t* object2); | 2150 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec
t* object2); |
| 2149 | 2151 |
| 2150 #endif | 2152 #endif |
| 2151 | 2153 |
| 2152 #endif // LayoutObject_h | 2154 #endif // LayoutObject_h |
| OLD | NEW |