Chromium Code Reviews| Index: Source/core/layout/LayoutObject.h |
| diff --git a/Source/core/layout/LayoutObject.h b/Source/core/layout/LayoutObject.h |
| index 06e8d0270fba1af8f836169364b4e2f30ebf0d3b..4c566f0c839c5f8ba382b784d563319547b5277b 100644 |
| --- a/Source/core/layout/LayoutObject.h |
| +++ b/Source/core/layout/LayoutObject.h |
| @@ -117,10 +117,6 @@ const int showTreeCharacterOffset = 39; |
| // Base class for all layout tree objects. |
| class CORE_EXPORT LayoutObject : public ImageResourceClient { |
| - friend class LayoutBlock; |
| - friend class LayoutBlockFlow; |
| - friend class DeprecatedPaintLayerReflectionInfo; // For setParent |
| - friend class DeprecatedPaintLayerScrollableArea; // For setParent. |
| friend class LayoutObjectChildList; |
| WTF_MAKE_NONCOPYABLE(LayoutObject); |
| public: |
| @@ -265,7 +261,23 @@ public: |
| virtual bool createsAnonymousWrapper() const { return false; } |
| ////////////////////////////////////////// |
| -protected: |
| + class DangerousLayoutTreeMutator { |
|
leviw_travelin_and_unemployed
2015/08/21 21:10:42
I'd refactor this out of the other changes since i
|
| + private: |
| + friend class DeprecatedPaintLayerReflectionInfo; |
| + friend class DeprecatedPaintLayerScrollableArea; |
| + friend class LayoutBlock; |
| + |
| + DangerousLayoutTreeMutator(LayoutObject& thisObject) : m_thisObject(thisObject) { } |
| + |
| + void setPreviousSibling(LayoutObject* previous) { m_thisObject.setPreviousSibling(previous); } |
| + void setNextSibling(LayoutObject* next) { m_thisObject.setNextSibling(next); } |
| + void setParent(LayoutObject* parent) { m_thisObject.setParent(parent); } |
| + void removeFromLayoutFlowThread() { m_thisObject.removeFromLayoutFlowThread(); } |
| + |
| + LayoutObject& m_thisObject; |
| + }; |
| + |
| +private: |
| ////////////////////////////////////////// |
| // Helper functions. Dangerous to use! |
| void setPreviousSibling(LayoutObject* previous) { m_previous = previous; } |
| @@ -1053,6 +1065,8 @@ public: |
| // FIXME: should we hook up scrollbar parts in the layout tree? crbug.com/484263. |
| void invalidateDisplayItemClientForNonCompositingDescendantsOf(const LayoutObject&) const; |
| + virtual void updateAnonymousChildStyle(const LayoutObject& child, ComputedStyle& style) const { } |
| + |
| protected: |
| enum LayoutObjectType { |
| LayoutObjectBr, |
| @@ -1133,7 +1147,6 @@ protected: |
| // time this function is called. |
| virtual void styleDidChange(StyleDifference, const ComputedStyle* oldStyle); |
| void propagateStyleToAnonymousChildren(bool blockChildrenOnly = false); |
| - virtual void updateAnonymousChildStyle(const LayoutObject& child, ComputedStyle& style) const { } |
| protected: |
| virtual void willBeDestroyed(); |
| @@ -1183,6 +1196,11 @@ protected: |
| void setIsSlowRepaintObject(bool); |
| + void clearSelfNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setSelfNeedsOverflowRecalcAfterStyleChange(false); } |
| + void clearChildNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setChildNeedsOverflowRecalcAfterStyleChange(false); } |
| + void setShouldInvalidateOverflowForPaint() { m_bitfields.setShouldInvalidateOverflowForPaint(true); } |
| + void setEverHadLayout() { m_bitfields.setEverHadLayout(true); } |
| + |
| private: |
| const LayoutRect& previousPaintInvalidationRect() const { return m_previousPaintInvalidationRect; } |
| @@ -1410,10 +1428,9 @@ private: |
| void setPosChildNeedsLayout(bool b) { m_bitfields.setPosChildNeedsLayout(b); } |
| void setNeedsSimplifiedNormalFlowLayout(bool b) { m_bitfields.setNeedsSimplifiedNormalFlowLayout(b); } |
| void setIsDragging(bool b) { m_bitfields.setIsDragging(b); } |
| - void setEverHadLayout(bool b) { m_bitfields.setEverHadLayout(b); } |
| - void setShouldInvalidateOverflowForPaint(bool b) { m_bitfields.setShouldInvalidateOverflowForPaint(b); } |
| - void setSelfNeedsOverflowRecalcAfterStyleChange(bool b) { m_bitfields.setSelfNeedsOverflowRecalcAfterStyleChange(b); } |
| - void setChildNeedsOverflowRecalcAfterStyleChange(bool b) { m_bitfields.setChildNeedsOverflowRecalcAfterStyleChange(b); } |
| + void clearShouldInvalidateOverflowForPaint() { m_bitfields.setShouldInvalidateOverflowForPaint(false); } |
| + void setSelfNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setSelfNeedsOverflowRecalcAfterStyleChange(true); } |
| + void setChildNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setChildNeedsOverflowRecalcAfterStyleChange(true); } |
| private: |
| // Store state between styleWillChange and styleDidChange |
| @@ -1512,7 +1529,7 @@ inline void LayoutObject::setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidat |
| inline void LayoutObject::clearNeedsLayout() |
| { |
| // Set flags for later stages/cycles. |
| - setEverHadLayout(true); |
| + setEverHadLayout(); |
| setMayNeedPaintInvalidation(); |
| m_bitfields.setNeededLayoutBecauseOfChildren(needsLayoutBecauseOfChildren()); |