Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(689)

Unified Diff: Source/core/layout/LayoutObject.h

Issue 1306993002: Cleanup friends of LayoutObject (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove LayoutBlock::promoteAllChildrenAndInsertAfter Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/layout/LayoutBlockFlow.cpp ('k') | Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutObject.h
diff --git a/Source/core/layout/LayoutObject.h b/Source/core/layout/LayoutObject.h
index 06e8d0270fba1af8f836169364b4e2f30ebf0d3b..30ff4b2bd28ff1ef1a46482e0aa4fab256b4766a 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,15 @@ public:
virtual bool createsAnonymousWrapper() const { return false; }
//////////////////////////////////////////
-protected:
+ void setDangerousOneWayParent(LayoutObject* parent)
+ {
+ ASSERT(!previousSibling());
+ ASSERT(!nextSibling());
+ ASSERT(!parent || !m_parent);
+ setParent(parent);
+ }
+
+private:
//////////////////////////////////////////
// Helper functions. Dangerous to use!
void setPreviousSibling(LayoutObject* previous) { m_previous = previous; }
@@ -1053,6 +1057,10 @@ public:
// FIXME: should we hook up scrollbar parts in the layout tree? crbug.com/484263.
void invalidateDisplayItemClientForNonCompositingDescendantsOf(const LayoutObject&) const;
+ void removeFromLayoutFlowThread();
chrishtr 2015/08/25 23:27:35 Document.
Xianzhu 2015/08/26 00:23:53 Done.
+
+ virtual void updateAnonymousChildStyle(const LayoutObject& child, ComputedStyle& style) const { }
chrishtr 2015/08/25 23:27:35 Document.
Xianzhu 2015/08/26 00:23:53 Done.
+
protected:
enum LayoutObjectType {
LayoutObjectBr,
@@ -1133,7 +1141,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 +1190,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; }
@@ -1222,7 +1234,6 @@ private:
const LayoutBoxModelObject* enclosingCompositedContainer() const;
LayoutFlowThread* locateFlowThreadContainingBlock() const;
- void removeFromLayoutFlowThread();
void removeFromLayoutFlowThreadRecursive(LayoutFlowThread*);
ComputedStyle* cachedFirstLineStyle() const;
@@ -1410,10 +1421,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 +1522,7 @@ inline void LayoutObject::setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidat
inline void LayoutObject::clearNeedsLayout()
{
// Set flags for later stages/cycles.
- setEverHadLayout(true);
+ setEverHadLayout();
setMayNeedPaintInvalidation();
m_bitfields.setNeededLayoutBecauseOfChildren(needsLayoutBecauseOfChildren());
« no previous file with comments | « Source/core/layout/LayoutBlockFlow.cpp ('k') | Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698