Chromium Code Reviews| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 public: | 119 public: |
| 120 template <typename T> | 120 template <typename T> |
| 121 NonLayoutObjectDisplayItemClientWrapper(const T& client) | 121 NonLayoutObjectDisplayItemClientWrapper(const T& client) |
| 122 : DisplayItemClientWrapper(client) { } | 122 : DisplayItemClientWrapper(client) { } |
| 123 | 123 |
| 124 NonLayoutObjectDisplayItemClientWrapper(const LayoutObject&) = delete; | 124 NonLayoutObjectDisplayItemClientWrapper(const LayoutObject&) = delete; |
| 125 }; | 125 }; |
| 126 | 126 |
| 127 // Base class for all layout tree objects. | 127 // Base class for all layout tree objects. |
| 128 class CORE_EXPORT LayoutObject : public ImageResourceClient { | 128 class CORE_EXPORT LayoutObject : public ImageResourceClient { |
| 129 // For layout tree hierarchy mutation methods, e.g. setParent. | |
| 129 friend class LayoutBlock; | 130 friend class LayoutBlock; |
| 130 friend class LayoutBlockFlow; | 131 friend class DeprecatedPaintLayerReflectionInfo; |
| 131 friend class DeprecatedPaintLayerReflectionInfo; // For setParent | 132 friend class DeprecatedPaintLayerScrollableArea; |
| 132 friend class DeprecatedPaintLayerScrollableArea; // For setParent. | |
| 133 friend class LayoutObjectChildList; | 133 friend class LayoutObjectChildList; |
| 134 | |
| 134 WTF_MAKE_NONCOPYABLE(LayoutObject); | 135 WTF_MAKE_NONCOPYABLE(LayoutObject); |
| 135 public: | 136 public: |
| 136 // 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 |
| 137 // marked as anonymous in the constructor. | 138 // marked as anonymous in the constructor. |
| 138 explicit LayoutObject(Node*); | 139 explicit LayoutObject(Node*); |
| 139 ~LayoutObject() override; | 140 ~LayoutObject() override; |
| 140 | 141 |
| 141 // Returns the name of the layout object. | 142 // Returns the name of the layout object. |
| 142 virtual const char* name() const = 0; | 143 virtual const char* name() const = 0; |
| 143 | 144 |
| (...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1019 | 1020 |
| 1020 PaintInvalidationReason fullPaintInvalidationReason() const { return m_bitfi elds.fullPaintInvalidationReason(); } | 1021 PaintInvalidationReason fullPaintInvalidationReason() const { return m_bitfi elds.fullPaintInvalidationReason(); } |
| 1021 bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInv alidationReason() != PaintInvalidationNone; } | 1022 bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInv alidationReason() != PaintInvalidationNone; } |
| 1022 void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalid ationFull); | 1023 void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalid ationFull); |
| 1023 void clearShouldDoFullPaintInvalidation() { m_bitfields.setFullPaintInvalida tionReason(PaintInvalidationNone); } | 1024 void clearShouldDoFullPaintInvalidation() { m_bitfields.setFullPaintInvalida tionReason(PaintInvalidationNone); } |
| 1024 | 1025 |
| 1025 bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInv alidateOverflowForPaint(); } | 1026 bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInv alidateOverflowForPaint(); } |
| 1026 | 1027 |
| 1027 virtual void clearPaintInvalidationState(const PaintInvalidationState&); | 1028 virtual void clearPaintInvalidationState(const PaintInvalidationState&); |
| 1028 | 1029 |
| 1029 // Indicates whether this layout object was re-laid-out since the last frame . | |
| 1030 // The flag will be cleared during invalidateTreeIfNeeded. | |
| 1031 bool layoutDidGetCalledSinceLastFrame() const { return m_bitfields.layoutDid GetCalledSinceLastFrame(); } | |
| 1032 | |
| 1033 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval idation(); } | 1030 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval idation(); } |
| 1034 void setMayNeedPaintInvalidation(); | 1031 void setMayNeedPaintInvalidation(); |
| 1035 | 1032 |
| 1036 bool shouldInvalidateSelection() const { return m_bitfields.shouldInvalidate Selection(); } | 1033 bool shouldInvalidateSelection() const { return m_bitfields.shouldInvalidate Selection(); } |
| 1037 void setShouldInvalidateSelection(); | 1034 void setShouldInvalidateSelection(); |
| 1038 void clearShouldInvalidateSelection() { m_bitfields.setShouldInvalidateSelec tion(false); } | |
| 1039 | |
| 1040 bool neededLayoutBecauseOfChildren() const { return m_bitfields.neededLayout BecauseOfChildren(); } | |
| 1041 void setNeededLayoutBecauseOfChildren(bool b) { m_bitfields.setNeededLayoutB ecauseOfChildren(b); } | |
| 1042 | 1035 |
| 1043 bool shouldCheckForPaintInvalidation(const PaintInvalidationState& paintInva lidationState) const | 1036 bool shouldCheckForPaintInvalidation(const PaintInvalidationState& paintInva lidationState) const |
| 1044 { | 1037 { |
| 1045 // Should check for paint invalidation if some ancestor changed location , because this object | 1038 // Should check for paint invalidation if some ancestor changed location , because this object |
| 1046 // may also change paint offset or location in paint invalidation contai ner, even if there is | 1039 // may also change paint offset or location in paint invalidation contai ner, even if there is |
| 1047 // no paint invalidation flag set. | 1040 // no paint invalidation flag set. |
| 1048 return paintInvalidationState.ancestorHadPaintInvalidationForLocationCha nge() || shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState(); | 1041 return paintInvalidationState.ancestorHadPaintInvalidationForLocationCha nge() || shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState(); |
| 1049 } | 1042 } |
| 1050 | 1043 |
| 1051 bool shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() con st | 1044 bool shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() con st |
| 1052 { | 1045 { |
| 1053 return layoutDidGetCalledSinceLastFrame() || mayNeedPaintInvalidation() || shouldDoFullPaintInvalidation() || shouldInvalidateSelection(); | 1046 return mayNeedPaintInvalidation() || shouldDoFullPaintInvalidation() || shouldInvalidateSelection() || m_bitfields.childShouldCheckForPaintInvalidation( ); |
| 1054 } | 1047 } |
| 1055 | 1048 |
| 1056 virtual bool supportsPaintInvalidationStateCachedOffsets() const { return !h asTransformRelatedProperty() && !hasReflection() && !style()->isFlippedBlocksWri tingMode(); } | 1049 virtual bool supportsPaintInvalidationStateCachedOffsets() const { return !h asTransformRelatedProperty() && !hasReflection() && !style()->isFlippedBlocksWri tingMode(); } |
| 1057 | 1050 |
| 1058 virtual LayoutRect viewRect() const; | 1051 virtual LayoutRect viewRect() const; |
| 1059 | 1052 |
| 1060 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); } | 1053 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); } |
| 1061 | 1054 |
| 1062 void invalidateDisplayItemClient(const NonLayoutObjectDisplayItemClientWrapp er&); | 1055 void invalidateDisplayItemClient(const NonLayoutObjectDisplayItemClientWrapp er&); |
| 1063 void invalidateDisplayItemClient(LayoutObject&); | 1056 void invalidateDisplayItemClient(LayoutObject&); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1154 // Overrides should call the superclass at the end. m_style will be 0 the fi rst time | 1147 // Overrides should call the superclass at the end. m_style will be 0 the fi rst time |
| 1155 // this function will be called. | 1148 // this function will be called. |
| 1156 virtual void styleWillChange(StyleDifference, const ComputedStyle& newStyle) ; | 1149 virtual void styleWillChange(StyleDifference, const ComputedStyle& newStyle) ; |
| 1157 // Overrides should call the superclass at the start. |oldStyle| will be 0 t he first | 1150 // Overrides should call the superclass at the start. |oldStyle| will be 0 t he first |
| 1158 // time this function is called. | 1151 // time this function is called. |
| 1159 virtual void styleDidChange(StyleDifference, const ComputedStyle* oldStyle); | 1152 virtual void styleDidChange(StyleDifference, const ComputedStyle* oldStyle); |
| 1160 void propagateStyleToAnonymousChildren(bool blockChildrenOnly = false); | 1153 void propagateStyleToAnonymousChildren(bool blockChildrenOnly = false); |
| 1161 virtual void updateAnonymousChildStyle(const LayoutObject& child, ComputedSt yle& style) const { } | 1154 virtual void updateAnonymousChildStyle(const LayoutObject& child, ComputedSt yle& style) const { } |
| 1162 | 1155 |
| 1163 protected: | 1156 protected: |
| 1164 void setSelfMayNeedPaintInvalidation(); | |
| 1165 | |
| 1166 virtual void willBeDestroyed(); | 1157 virtual void willBeDestroyed(); |
| 1167 | 1158 |
| 1168 virtual void insertedIntoTree(); | 1159 virtual void insertedIntoTree(); |
| 1169 virtual void willBeRemovedFromTree(); | 1160 virtual void willBeRemovedFromTree(); |
| 1170 | 1161 |
| 1171 void setDocumentForAnonymous(Document* document) { ASSERT(isAnonymous()); m_ node = document; } | 1162 void setDocumentForAnonymous(Document* document) { ASSERT(isAnonymous()); m_ node = document; } |
| 1172 | 1163 |
| 1173 // Add hit-test rects for the layout tree rooted at this node to the provide d collection on a | 1164 // Add hit-test rects for the layout tree rooted at this node to the provide d collection on a |
| 1174 // per-Layer basis. | 1165 // per-Layer basis. |
| 1175 // currentLayer must be the enclosing layer, and layerOffset is the current offset within | 1166 // currentLayer must be the enclosing layer, and layerOffset is the current offset within |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 1188 const LayoutRect& oldPaintInvalidationRect, const LayoutPoint& oldPositi onFromPaintInvalidationBacking, | 1179 const LayoutRect& oldPaintInvalidationRect, const LayoutPoint& oldPositi onFromPaintInvalidationBacking, |
| 1189 const LayoutRect& newPaintInvalidationRect, const LayoutPoint& newPositi onFromPaintInvalidationBacking) const; | 1180 const LayoutRect& newPaintInvalidationRect, const LayoutPoint& newPositi onFromPaintInvalidationBacking) const; |
| 1190 virtual void incrementallyInvalidatePaint(const LayoutBoxModelObject& paintI nvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds, const LayoutPoint& positionFromPaintInvalidationBacking); | 1181 virtual void incrementallyInvalidatePaint(const LayoutBoxModelObject& paintI nvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds, const LayoutPoint& positionFromPaintInvalidationBacking); |
| 1191 void fullyInvalidatePaint(const LayoutBoxModelObject& paintInvalidationConta iner, PaintInvalidationReason, const LayoutRect& oldBounds, const LayoutRect& ne wBounds); | 1182 void fullyInvalidatePaint(const LayoutBoxModelObject& paintInvalidationConta iner, PaintInvalidationReason, const LayoutRect& oldBounds, const LayoutRect& ne wBounds); |
| 1192 | 1183 |
| 1193 virtual bool hasNonCompositedScrollbars() const { return false; } | 1184 virtual bool hasNonCompositedScrollbars() const { return false; } |
| 1194 | 1185 |
| 1195 #if ENABLE(ASSERT) | 1186 #if ENABLE(ASSERT) |
| 1196 virtual bool paintInvalidationStateIsDirty() const | 1187 virtual bool paintInvalidationStateIsDirty() const |
| 1197 { | 1188 { |
| 1198 return neededLayoutBecauseOfChildren() || shouldCheckForPaintInvalidatio nRegardlessOfPaintInvalidationState(); | 1189 return m_bitfields.neededLayoutBecauseOfChildren() || shouldCheckForPain tInvalidationRegardlessOfPaintInvalidationState(); |
| 1199 } | 1190 } |
| 1200 #endif | 1191 #endif |
| 1201 | 1192 |
| 1202 virtual void invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& child PaintInvalidationState); | 1193 virtual void invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& child PaintInvalidationState); |
| 1203 virtual PaintInvalidationReason invalidatePaintIfNeeded(PaintInvalidationSta te&, const LayoutBoxModelObject& paintInvalidationContainer); | 1194 virtual PaintInvalidationReason invalidatePaintIfNeeded(PaintInvalidationSta te&, const LayoutBoxModelObject& paintInvalidationContainer); |
| 1204 | 1195 |
| 1205 // When this object is invalidated for paint, this method is called to inval idate any DisplayItemClients | 1196 // When this object is invalidated for paint, this method is called to inval idate any DisplayItemClients |
| 1206 // owned by this object, including the object itself, LayoutText/LayoutInlin e line boxes, etc., | 1197 // owned by this object, including the object itself, LayoutText/LayoutInlin e line boxes, etc., |
| 1207 // not including children which will be invalidated normally during invalida teTreeIfNeeded() and | 1198 // not including children which will be invalidated normally during invalida teTreeIfNeeded() and |
| 1208 // parts which are invalidated separately (e.g. scrollbars). | 1199 // parts which are invalidated separately (e.g. scrollbars). |
| 1209 virtual void invalidateDisplayItemClients(const LayoutBoxModelObject& paintI nvalidationContainer); | 1200 virtual void invalidateDisplayItemClients(const LayoutBoxModelObject& paintI nvalidationContainer); |
| 1210 | 1201 |
| 1211 virtual bool clearRepaintFlagsOfSubtrees(); | 1202 virtual bool clearRepaintFlagsOfSubtrees(); |
| 1212 | 1203 |
| 1213 void setIsSlowRepaintObject(bool); | 1204 void setIsSlowRepaintObject(bool); |
| 1214 | 1205 |
| 1206 void clearSelfNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setSelfNee dsOverflowRecalcAfterStyleChange(false); } | |
| 1207 void clearChildNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setChildN eedsOverflowRecalcAfterStyleChange(false); } | |
| 1208 | |
| 1209 void setShouldInvalidateOverflowForPaint() { m_bitfields.setShouldInvalidate OverflowForPaint(true); } | |
| 1210 void setEverHadLayout() { m_bitfields.setEverHadLayout(true); } | |
| 1211 | |
| 1215 private: | 1212 private: |
| 1216 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP aintInvalidationRect; } | 1213 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP aintInvalidationRect; } |
| 1217 | 1214 |
| 1218 // Adjusts a paint invalidation rect in the space of |m_previousPaintInvalid ationRect| and |m_previousPositionFromPaintInvalidationBacking| | 1215 // Adjusts a paint invalidation rect in the space of |m_previousPaintInvalid ationRect| and |m_previousPositionFromPaintInvalidationBacking| |
| 1219 // to be in the space of the |paintInvalidationContainer|, | 1216 // to be in the space of the |paintInvalidationContainer|, |
| 1220 // if needed. They can be different only if |paintInvalidationContainer| is a composited scroller. | 1217 // if needed. They can be different only if |paintInvalidationContainer| is a composited scroller. |
| 1221 void adjustInvalidationRectForCompositedScrolling(LayoutRect&, const LayoutB oxModelObject& paintInvalidationContainer) const; | 1218 void adjustInvalidationRectForCompositedScrolling(LayoutRect&, const LayoutB oxModelObject& paintInvalidationContainer) const; |
| 1222 | 1219 |
| 1223 void clearLayoutRootIfNeeded() const; | 1220 void clearLayoutRootIfNeeded() const; |
| 1224 | 1221 |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 1239 | 1236 |
| 1240 inline void markContainerChainForPaintInvalidation(); | 1237 inline void markContainerChainForPaintInvalidation(); |
| 1241 | 1238 |
| 1242 void markContainerChainForRepaint(); | 1239 void markContainerChainForRepaint(); |
| 1243 void setChildNeedsRepaint(); | 1240 void setChildNeedsRepaint(); |
| 1244 | 1241 |
| 1245 inline void invalidateSelectionIfNeeded(const LayoutBoxModelObject&, PaintIn validationReason); | 1242 inline void invalidateSelectionIfNeeded(const LayoutBoxModelObject&, PaintIn validationReason); |
| 1246 | 1243 |
| 1247 inline void invalidateContainerPreferredLogicalWidths(); | 1244 inline void invalidateContainerPreferredLogicalWidths(); |
| 1248 | 1245 |
| 1249 void clearMayNeedPaintInvalidation(); | |
| 1250 | |
| 1251 void setLayoutDidGetCalledSinceLastFrame(); | |
| 1252 void clearLayoutDidGetCalledSinceLastFrame() { m_bitfields.setLayoutDidGetCa lledSinceLastFrame(false); } | |
| 1253 | |
| 1254 void invalidatePaintIncludingNonCompositingDescendantsInternal(const LayoutB oxModelObject& repaintContainer); | 1246 void invalidatePaintIncludingNonCompositingDescendantsInternal(const LayoutB oxModelObject& repaintContainer); |
| 1255 | 1247 |
| 1256 LayoutRect previousSelectionRectForPaintInvalidation() const; | 1248 LayoutRect previousSelectionRectForPaintInvalidation() const; |
| 1257 void setPreviousSelectionRectForPaintInvalidation(const LayoutRect&); | 1249 void setPreviousSelectionRectForPaintInvalidation(const LayoutRect&); |
| 1258 | 1250 |
| 1259 const LayoutBoxModelObject* enclosingCompositedContainer() const; | 1251 const LayoutBoxModelObject* enclosingCompositedContainer() const; |
| 1260 | 1252 |
| 1261 LayoutFlowThread* locateFlowThreadContainingBlock() const; | 1253 LayoutFlowThread* locateFlowThreadContainingBlock() const; |
| 1262 void removeFromLayoutFlowThread(); | 1254 void removeFromLayoutFlowThread(); |
| 1263 void removeFromLayoutFlowThreadRecursive(LayoutFlowThread*); | 1255 void removeFromLayoutFlowThreadRecursive(LayoutFlowThread*); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1308 IsStaticallyPositioned = 0, | 1300 IsStaticallyPositioned = 0, |
| 1309 IsRelativelyPositioned = 1, | 1301 IsRelativelyPositioned = 1, |
| 1310 IsOutOfFlowPositioned = 2, | 1302 IsOutOfFlowPositioned = 2, |
| 1311 IsStickyPositioned = 3, | 1303 IsStickyPositioned = 3, |
| 1312 }; | 1304 }; |
| 1313 | 1305 |
| 1314 public: | 1306 public: |
| 1315 LayoutObjectBitfields(Node* node) | 1307 LayoutObjectBitfields(Node* node) |
| 1316 : m_selfNeedsLayout(false) | 1308 : m_selfNeedsLayout(false) |
| 1317 , m_shouldInvalidateOverflowForPaint(false) | 1309 , m_shouldInvalidateOverflowForPaint(false) |
| 1318 // FIXME: We should remove mayNeedPaintInvalidation once we are able to | 1310 , m_childShouldCheckForPaintInvalidation(false) |
| 1319 // use the other layout flags to detect the same cases. crbug.com/37 0118 | |
| 1320 , m_mayNeedPaintInvalidation(false) | 1311 , m_mayNeedPaintInvalidation(false) |
| 1321 , m_shouldInvalidateSelection(false) | 1312 , m_shouldInvalidateSelection(false) |
| 1322 , m_neededLayoutBecauseOfChildren(false) | 1313 , m_neededLayoutBecauseOfChildren(false) |
| 1323 , m_needsPositionedMovementLayout(false) | 1314 , m_needsPositionedMovementLayout(false) |
| 1324 , m_normalChildNeedsLayout(false) | 1315 , m_normalChildNeedsLayout(false) |
| 1325 , m_posChildNeedsLayout(false) | 1316 , m_posChildNeedsLayout(false) |
| 1326 , m_needsSimplifiedNormalFlowLayout(false) | 1317 , m_needsSimplifiedNormalFlowLayout(false) |
| 1327 , m_preferredLogicalWidthsDirty(false) | 1318 , m_preferredLogicalWidthsDirty(false) |
| 1328 , m_floating(false) | 1319 , m_floating(false) |
| 1329 , m_selfNeedsOverflowRecalcAfterStyleChange(false) | 1320 , m_selfNeedsOverflowRecalcAfterStyleChange(false) |
| 1330 , m_childNeedsOverflowRecalcAfterStyleChange(false) | 1321 , m_childNeedsOverflowRecalcAfterStyleChange(false) |
| 1331 , m_isAnonymous(!node) | 1322 , m_isAnonymous(!node) |
| 1332 , m_isText(false) | 1323 , m_isText(false) |
| 1333 , m_isBox(false) | 1324 , m_isBox(false) |
| 1334 , m_isInline(true) | 1325 , m_isInline(true) |
| 1335 , m_isReplaced(false) | 1326 , m_isReplaced(false) |
| 1336 , m_horizontalWritingMode(true) | 1327 , m_horizontalWritingMode(true) |
| 1337 , m_isDragging(false) | 1328 , m_isDragging(false) |
| 1338 , m_hasLayer(false) | 1329 , m_hasLayer(false) |
| 1339 , m_hasOverflowClip(false) | 1330 , m_hasOverflowClip(false) |
| 1340 , m_hasTransformRelatedProperty(false) | 1331 , m_hasTransformRelatedProperty(false) |
| 1341 , m_hasReflection(false) | 1332 , m_hasReflection(false) |
| 1342 , m_hasCounterNodeMap(false) | 1333 , m_hasCounterNodeMap(false) |
| 1343 , m_everHadLayout(false) | 1334 , m_everHadLayout(false) |
| 1344 , m_ancestorLineBoxDirty(false) | 1335 , m_ancestorLineBoxDirty(false) |
| 1345 , m_layoutDidGetCalledSinceLastFrame(false) | |
| 1346 , m_hasPendingResourceUpdate(false) | 1336 , m_hasPendingResourceUpdate(false) |
| 1347 , m_isInsideFlowThread(false) | 1337 , m_isInsideFlowThread(false) |
| 1348 , m_subtreeChangeListenerRegistered(false) | 1338 , m_subtreeChangeListenerRegistered(false) |
| 1349 , m_notifiedOfSubtreeChange(false) | 1339 , m_notifiedOfSubtreeChange(false) |
| 1350 , m_consumesSubtreeChangeNotification(false) | 1340 , m_consumesSubtreeChangeNotification(false) |
| 1351 , m_childrenInline(false) | 1341 , m_childrenInline(false) |
| 1352 , m_alwaysCreateLineBoxesForLayoutInline(false) | 1342 , m_alwaysCreateLineBoxesForLayoutInline(false) |
| 1353 , m_lastBoxDecorationBackgroundObscured(false) | 1343 , m_lastBoxDecorationBackgroundObscured(false) |
| 1354 , m_isSlowRepaintObject(false) | 1344 , m_isSlowRepaintObject(false) |
| 1355 , m_selfNeedsRepaint(false) | 1345 , m_selfNeedsRepaint(false) |
| 1356 , m_childNeedsRepaint(false) | 1346 , m_childNeedsRepaint(false) |
| 1357 , m_positionedState(IsStaticallyPositioned) | 1347 , m_positionedState(IsStaticallyPositioned) |
| 1358 , m_selectionState(SelectionNone) | 1348 , m_selectionState(SelectionNone) |
| 1359 , m_boxDecorationBackgroundState(NoBoxDecorationBackground) | 1349 , m_boxDecorationBackgroundState(NoBoxDecorationBackground) |
| 1360 , m_fullPaintInvalidationReason(PaintInvalidationNone) | 1350 , m_fullPaintInvalidationReason(PaintInvalidationNone) |
| 1361 { | 1351 { |
| 1362 } | 1352 } |
| 1363 | 1353 |
| 1364 // 32 bits have been used in the first word, and 18 in the second. | 1354 // 32 bits have been used in the first word, and 18 in the second. |
| 1365 ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout); | 1355 ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout); |
| 1366 ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateO verflowForPaint); | 1356 ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateO verflowForPaint); // TODO: Remove for slimming paint v2. |
|
leviw_travelin_and_unemployed
2015/08/20 22:52:02
Nit: TODO's should have your username.
| |
| 1357 ADD_BOOLEAN_BITFIELD(childShouldCheckForPaintInvalidation, ChildShouldCh eckForPaintInvalidation); | |
| 1367 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation) ; | 1358 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation) ; |
| 1368 ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelectio n); | 1359 ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelectio n); // TODO: Remove for slimming paint v2. |
| 1369 ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseO fChildren); | 1360 ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseO fChildren); // TODO: Remove for slimming paint v2. |
| 1370 ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovem entLayout); | 1361 ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovem entLayout); |
| 1371 ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout); | 1362 ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout); |
| 1372 ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout); | 1363 ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout); |
| 1373 ADD_BOOLEAN_BITFIELD(needsSimplifiedNormalFlowLayout, NeedsSimplifiedNor malFlowLayout); | 1364 ADD_BOOLEAN_BITFIELD(needsSimplifiedNormalFlowLayout, NeedsSimplifiedNor malFlowLayout); |
| 1374 ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, PreferredLogicalWidths Dirty); | 1365 ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, PreferredLogicalWidths Dirty); |
| 1375 ADD_BOOLEAN_BITFIELD(floating, Floating); | 1366 ADD_BOOLEAN_BITFIELD(floating, Floating); |
| 1376 ADD_BOOLEAN_BITFIELD(selfNeedsOverflowRecalcAfterStyleChange, SelfNeedsO verflowRecalcAfterStyleChange); | 1367 ADD_BOOLEAN_BITFIELD(selfNeedsOverflowRecalcAfterStyleChange, SelfNeedsO verflowRecalcAfterStyleChange); |
| 1377 ADD_BOOLEAN_BITFIELD(childNeedsOverflowRecalcAfterStyleChange, ChildNeed sOverflowRecalcAfterStyleChange); | 1368 ADD_BOOLEAN_BITFIELD(childNeedsOverflowRecalcAfterStyleChange, ChildNeed sOverflowRecalcAfterStyleChange); |
| 1378 | 1369 |
| 1379 ADD_BOOLEAN_BITFIELD(isAnonymous, IsAnonymous); | 1370 ADD_BOOLEAN_BITFIELD(isAnonymous, IsAnonymous); |
| 1380 ADD_BOOLEAN_BITFIELD(isText, IsText); | 1371 ADD_BOOLEAN_BITFIELD(isText, IsText); |
| 1381 ADD_BOOLEAN_BITFIELD(isBox, IsBox); | 1372 ADD_BOOLEAN_BITFIELD(isBox, IsBox); |
| 1382 ADD_BOOLEAN_BITFIELD(isInline, IsInline); | 1373 ADD_BOOLEAN_BITFIELD(isInline, IsInline); |
| 1383 ADD_BOOLEAN_BITFIELD(isReplaced, IsReplaced); | 1374 ADD_BOOLEAN_BITFIELD(isReplaced, IsReplaced); |
| 1384 ADD_BOOLEAN_BITFIELD(horizontalWritingMode, HorizontalWritingMode); | 1375 ADD_BOOLEAN_BITFIELD(horizontalWritingMode, HorizontalWritingMode); |
| 1385 ADD_BOOLEAN_BITFIELD(isDragging, IsDragging); | 1376 ADD_BOOLEAN_BITFIELD(isDragging, IsDragging); |
| 1386 | 1377 |
| 1387 ADD_BOOLEAN_BITFIELD(hasLayer, HasLayer); | 1378 ADD_BOOLEAN_BITFIELD(hasLayer, HasLayer); |
| 1388 ADD_BOOLEAN_BITFIELD(hasOverflowClip, HasOverflowClip); // Set in the ca se of overflow:auto/scroll/hidden | 1379 ADD_BOOLEAN_BITFIELD(hasOverflowClip, HasOverflowClip); // Set in the ca se of overflow:auto/scroll/hidden |
| 1389 ADD_BOOLEAN_BITFIELD(hasTransformRelatedProperty, HasTransformRelatedPro perty); | 1380 ADD_BOOLEAN_BITFIELD(hasTransformRelatedProperty, HasTransformRelatedPro perty); |
| 1390 ADD_BOOLEAN_BITFIELD(hasReflection, HasReflection); | 1381 ADD_BOOLEAN_BITFIELD(hasReflection, HasReflection); |
| 1391 | 1382 |
| 1392 ADD_BOOLEAN_BITFIELD(hasCounterNodeMap, HasCounterNodeMap); | 1383 ADD_BOOLEAN_BITFIELD(hasCounterNodeMap, HasCounterNodeMap); |
| 1393 ADD_BOOLEAN_BITFIELD(everHadLayout, EverHadLayout); | 1384 ADD_BOOLEAN_BITFIELD(everHadLayout, EverHadLayout); |
| 1394 ADD_BOOLEAN_BITFIELD(ancestorLineBoxDirty, AncestorLineBoxDirty); | 1385 ADD_BOOLEAN_BITFIELD(ancestorLineBoxDirty, AncestorLineBoxDirty); |
| 1395 | 1386 |
| 1396 ADD_BOOLEAN_BITFIELD(layoutDidGetCalledSinceLastFrame, LayoutDidGetCalle dSinceLastFrame); | |
| 1397 | |
| 1398 ADD_BOOLEAN_BITFIELD(hasPendingResourceUpdate, HasPendingResourceUpdate) ; | 1387 ADD_BOOLEAN_BITFIELD(hasPendingResourceUpdate, HasPendingResourceUpdate) ; |
| 1399 | 1388 |
| 1400 ADD_BOOLEAN_BITFIELD(isInsideFlowThread, IsInsideFlowThread); | 1389 ADD_BOOLEAN_BITFIELD(isInsideFlowThread, IsInsideFlowThread); |
| 1401 | 1390 |
| 1402 ADD_BOOLEAN_BITFIELD(subtreeChangeListenerRegistered, SubtreeChangeListe nerRegistered); | 1391 ADD_BOOLEAN_BITFIELD(subtreeChangeListenerRegistered, SubtreeChangeListe nerRegistered); |
| 1403 ADD_BOOLEAN_BITFIELD(notifiedOfSubtreeChange, NotifiedOfSubtreeChange); | 1392 ADD_BOOLEAN_BITFIELD(notifiedOfSubtreeChange, NotifiedOfSubtreeChange); |
| 1404 ADD_BOOLEAN_BITFIELD(consumesSubtreeChangeNotification, ConsumesSubtreeC hangeNotification); | 1393 ADD_BOOLEAN_BITFIELD(consumesSubtreeChangeNotification, ConsumesSubtreeC hangeNotification); |
| 1405 | 1394 |
| 1406 // from LayoutBlock | 1395 // from LayoutBlock |
| 1407 ADD_BOOLEAN_BITFIELD(childrenInline, ChildrenInline); | 1396 ADD_BOOLEAN_BITFIELD(childrenInline, ChildrenInline); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1447 ALWAYS_INLINE void setBoxDecorationBackgroundState(BoxDecorationBackgrou ndState s) { m_boxDecorationBackgroundState = s; } | 1436 ALWAYS_INLINE void setBoxDecorationBackgroundState(BoxDecorationBackgrou ndState s) { m_boxDecorationBackgroundState = s; } |
| 1448 | 1437 |
| 1449 PaintInvalidationReason fullPaintInvalidationReason() const { return sta tic_cast<PaintInvalidationReason>(m_fullPaintInvalidationReason); } | 1438 PaintInvalidationReason fullPaintInvalidationReason() const { return sta tic_cast<PaintInvalidationReason>(m_fullPaintInvalidationReason); } |
| 1450 void setFullPaintInvalidationReason(PaintInvalidationReason reason) { m_ fullPaintInvalidationReason = reason; } | 1439 void setFullPaintInvalidationReason(PaintInvalidationReason reason) { m_ fullPaintInvalidationReason = reason; } |
| 1451 }; | 1440 }; |
| 1452 | 1441 |
| 1453 #undef ADD_BOOLEAN_BITFIELD | 1442 #undef ADD_BOOLEAN_BITFIELD |
| 1454 | 1443 |
| 1455 LayoutObjectBitfields m_bitfields; | 1444 LayoutObjectBitfields m_bitfields; |
| 1456 | 1445 |
| 1457 void setSelfNeedsLayout(bool b) { m_bitfields.setSelfNeedsLayout(b); } | |
| 1458 void setNeedsPositionedMovementLayout(bool b) { m_bitfields.setNeedsPosition edMovementLayout(b); } | |
| 1459 void setNormalChildNeedsLayout(bool b) { m_bitfields.setNormalChildNeedsLayo ut(b); } | |
| 1460 void setPosChildNeedsLayout(bool b) { m_bitfields.setPosChildNeedsLayout(b); } | |
| 1461 void setNeedsSimplifiedNormalFlowLayout(bool b) { m_bitfields.setNeedsSimpli fiedNormalFlowLayout(b); } | |
| 1462 void setIsDragging(bool b) { m_bitfields.setIsDragging(b); } | |
| 1463 void setEverHadLayout(bool b) { m_bitfields.setEverHadLayout(b); } | |
| 1464 void setShouldInvalidateOverflowForPaint(bool b) { m_bitfields.setShouldInva lidateOverflowForPaint(b); } | |
| 1465 void setSelfNeedsOverflowRecalcAfterStyleChange(bool b) { m_bitfields.setSel fNeedsOverflowRecalcAfterStyleChange(b); } | |
| 1466 void setChildNeedsOverflowRecalcAfterStyleChange(bool b) { m_bitfields.setCh ildNeedsOverflowRecalcAfterStyleChange(b); } | |
| 1467 | |
| 1468 private: | 1446 private: |
| 1469 // Store state between styleWillChange and styleDidChange | 1447 // Store state between styleWillChange and styleDidChange |
| 1470 static bool s_affectsParentBlock; | 1448 static bool s_affectsParentBlock; |
| 1471 | 1449 |
| 1472 // This stores the paint invalidation rect from the previous frame. This rec t does *not* account for composited scrolling. See | 1450 // This stores the paint invalidation rect from the previous frame. This rec t does *not* account for composited scrolling. See |
| 1473 // adjustInvalidationRectForCompositedScrolling(). | 1451 // adjustInvalidationRectForCompositedScrolling(). |
| 1474 LayoutRect m_previousPaintInvalidationRect; | 1452 LayoutRect m_previousPaintInvalidationRect; |
| 1475 | 1453 |
| 1476 // This stores the position in the paint invalidation backing's coordinate. | 1454 // This stores the position in the paint invalidation backing's coordinate. |
| 1477 // It is used to detect layoutObject shifts that forces a full invalidation. | 1455 // It is used to detect layoutObject shifts that forces a full invalidation. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1533 { | 1511 { |
| 1534 return isBeforeContent() || isAfterContent(); | 1512 return isBeforeContent() || isAfterContent(); |
| 1535 } | 1513 } |
| 1536 | 1514 |
| 1537 // setNeedsLayout() won't cause full paint invalidations as | 1515 // setNeedsLayout() won't cause full paint invalidations as |
| 1538 // setNeedsLayoutAndFullPaintInvalidation() does. Otherwise the two methods are identical. | 1516 // setNeedsLayoutAndFullPaintInvalidation() does. Otherwise the two methods are identical. |
| 1539 inline void LayoutObject::setNeedsLayout(LayoutInvalidationReasonForTracing reas on, MarkingBehavior markParents, SubtreeLayoutScope* layouter) | 1517 inline void LayoutObject::setNeedsLayout(LayoutInvalidationReasonForTracing reas on, MarkingBehavior markParents, SubtreeLayoutScope* layouter) |
| 1540 { | 1518 { |
| 1541 ASSERT(!isSetNeedsLayoutForbidden()); | 1519 ASSERT(!isSetNeedsLayoutForbidden()); |
| 1542 bool alreadyNeededLayout = m_bitfields.selfNeedsLayout(); | 1520 bool alreadyNeededLayout = m_bitfields.selfNeedsLayout(); |
| 1543 setSelfNeedsLayout(true); | 1521 m_bitfields.setSelfNeedsLayout(true); |
| 1544 if (!alreadyNeededLayout) { | 1522 if (!alreadyNeededLayout) { |
| 1545 TRACE_EVENT_INSTANT1( | 1523 TRACE_EVENT_INSTANT1( |
| 1546 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidationTracking"), | 1524 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidationTracking"), |
| 1547 "LayoutInvalidationTracking", | 1525 "LayoutInvalidationTracking", |
| 1548 TRACE_EVENT_SCOPE_THREAD, | 1526 TRACE_EVENT_SCOPE_THREAD, |
| 1549 "data", | 1527 "data", |
| 1550 InspectorLayoutInvalidationTrackingEvent::data(this, reason)); | 1528 InspectorLayoutInvalidationTrackingEvent::data(this, reason)); |
| 1551 if (markParents == MarkContainerChain && (!layouter || layouter->root() != this)) | 1529 if (markParents == MarkContainerChain && (!layouter || layouter->root() != this)) |
| 1552 markContainerChainForLayout(true, layouter); | 1530 markContainerChainForLayout(true, layouter); |
| 1553 } | 1531 } |
| 1554 } | 1532 } |
| 1555 | 1533 |
| 1556 inline void LayoutObject::setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidat ionReasonForTracing reason, MarkingBehavior markParents, SubtreeLayoutScope* lay outer) | 1534 inline void LayoutObject::setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidat ionReasonForTracing reason, MarkingBehavior markParents, SubtreeLayoutScope* lay outer) |
| 1557 { | 1535 { |
| 1558 setNeedsLayout(reason, markParents, layouter); | 1536 setNeedsLayout(reason, markParents, layouter); |
| 1559 setShouldDoFullPaintInvalidation(); | 1537 setShouldDoFullPaintInvalidation(); |
| 1560 } | 1538 } |
| 1561 | 1539 |
| 1562 inline void LayoutObject::clearNeedsLayout() | 1540 inline void LayoutObject::clearNeedsLayout() |
| 1563 { | 1541 { |
| 1564 setNeededLayoutBecauseOfChildren(needsLayoutBecauseOfChildren()); | 1542 m_bitfields.setNeededLayoutBecauseOfChildren(needsLayoutBecauseOfChildren()) ; |
| 1565 setLayoutDidGetCalledSinceLastFrame(); | 1543 m_bitfields.setSelfNeedsLayout(false); |
| 1566 setSelfNeedsLayout(false); | 1544 m_bitfields.setPosChildNeedsLayout(false); |
| 1567 setEverHadLayout(true); | 1545 m_bitfields.setNeedsSimplifiedNormalFlowLayout(false); |
| 1568 setPosChildNeedsLayout(false); | 1546 m_bitfields.setNormalChildNeedsLayout(false); |
| 1569 setNeedsSimplifiedNormalFlowLayout(false); | 1547 m_bitfields.setNeedsPositionedMovementLayout(false); |
| 1570 setNormalChildNeedsLayout(false); | 1548 setMayNeedPaintInvalidation(); |
| 1571 setNeedsPositionedMovementLayout(false); | 1549 setEverHadLayout(); |
| 1572 setAncestorLineBoxDirty(false); | 1550 setAncestorLineBoxDirty(false); |
| 1573 #if ENABLE(ASSERT) | 1551 #if ENABLE(ASSERT) |
| 1574 checkBlockPositionedObjectsNeedLayout(); | 1552 checkBlockPositionedObjectsNeedLayout(); |
| 1575 #endif | 1553 #endif |
| 1576 } | 1554 } |
| 1577 | 1555 |
| 1578 inline void LayoutObject::setChildNeedsLayout(MarkingBehavior markParents, Subtr eeLayoutScope* layouter) | 1556 inline void LayoutObject::setChildNeedsLayout(MarkingBehavior markParents, Subtr eeLayoutScope* layouter) |
| 1579 { | 1557 { |
| 1580 ASSERT(!isSetNeedsLayoutForbidden()); | 1558 ASSERT(!isSetNeedsLayoutForbidden()); |
| 1581 bool alreadyNeededLayout = normalChildNeedsLayout(); | 1559 bool alreadyNeededLayout = normalChildNeedsLayout(); |
| 1582 setNormalChildNeedsLayout(true); | 1560 m_bitfields.setNormalChildNeedsLayout(true); |
| 1583 // FIXME: Replace MarkOnlyThis with the SubtreeLayoutScope code path and rem ove the MarkingBehavior argument entirely. | 1561 // FIXME: Replace MarkOnlyThis with the SubtreeLayoutScope code path and rem ove the MarkingBehavior argument entirely. |
| 1584 if (!alreadyNeededLayout && markParents == MarkContainerChain && (!layouter || layouter->root() != this)) | 1562 if (!alreadyNeededLayout && markParents == MarkContainerChain && (!layouter || layouter->root() != this)) |
| 1585 markContainerChainForLayout(true, layouter); | 1563 markContainerChainForLayout(true, layouter); |
| 1586 } | 1564 } |
| 1587 | 1565 |
| 1588 inline void LayoutObject::setNeedsPositionedMovementLayout() | 1566 inline void LayoutObject::setNeedsPositionedMovementLayout() |
| 1589 { | 1567 { |
| 1590 bool alreadyNeededLayout = needsPositionedMovementLayout(); | 1568 bool alreadyNeededLayout = needsPositionedMovementLayout(); |
| 1591 setNeedsPositionedMovementLayout(true); | 1569 m_bitfields.setNeedsPositionedMovementLayout(true); |
| 1592 ASSERT(!isSetNeedsLayoutForbidden()); | 1570 ASSERT(!isSetNeedsLayoutForbidden()); |
| 1593 if (!alreadyNeededLayout) | 1571 if (!alreadyNeededLayout) |
| 1594 markContainerChainForLayout(); | 1572 markContainerChainForLayout(); |
| 1595 } | 1573 } |
| 1596 | 1574 |
| 1597 inline bool LayoutObject::preservesNewline() const | 1575 inline bool LayoutObject::preservesNewline() const |
| 1598 { | 1576 { |
| 1599 if (isSVGInlineText()) | 1577 if (isSVGInlineText()) |
| 1600 return false; | 1578 return false; |
| 1601 | 1579 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1702 void showTree(const blink::LayoutObject*); | 1680 void showTree(const blink::LayoutObject*); |
| 1703 void showLineTree(const blink::LayoutObject*); | 1681 void showLineTree(const blink::LayoutObject*); |
| 1704 void showLayoutTree(const blink::LayoutObject* object1); | 1682 void showLayoutTree(const blink::LayoutObject* object1); |
| 1705 // We don't make object2 an optional parameter so that showLayoutTree | 1683 // We don't make object2 an optional parameter so that showLayoutTree |
| 1706 // can be called from gdb easily. | 1684 // can be called from gdb easily. |
| 1707 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); | 1685 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); |
| 1708 | 1686 |
| 1709 #endif | 1687 #endif |
| 1710 | 1688 |
| 1711 #endif // LayoutObject_h | 1689 #endif // LayoutObject_h |
| OLD | NEW |