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

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

Issue 1306993002: Cleanup friends of LayoutObject (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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..e32d547a951980bd788bb94d1379e1e5249fc7e1 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,10 @@ public:
virtual bool createsAnonymousWrapper() const { return false; }
//////////////////////////////////////////
-protected:
+ // Sets the parent of this object but doesn't add it as a child of the parent.
+ void setDangerousOneWayParent(LayoutObject*);
+
+private:
//////////////////////////////////////////
// Helper functions. Dangerous to use!
void setPreviousSibling(LayoutObject* previous) { m_previous = previous; }
@@ -1053,6 +1052,9 @@ public:
// FIXME: should we hook up scrollbar parts in the layout tree? crbug.com/484263.
void invalidateDisplayItemClientForNonCompositingDescendantsOf(const LayoutObject&) const;
+ // Called before anonymousChild.setStyle(). Override to set custom styles for the child.
+ virtual void updateAnonymousChildStyle(const LayoutObject& anonymousChild, ComputedStyle& style) const { }
+
protected:
enum LayoutObjectType {
LayoutObjectBr,
@@ -1133,7 +1135,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 +1184,14 @@ 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); }
+
+ // Remove this object and all descendants from the containing LayoutFlowThread.
+ void removeFromLayoutFlowThread();
+
private:
const LayoutRect& previousPaintInvalidationRect() const { return m_previousPaintInvalidationRect; }
@@ -1222,7 +1231,6 @@ private:
const LayoutBoxModelObject* enclosingCompositedContainer() const;
LayoutFlowThread* locateFlowThreadContainingBlock() const;
- void removeFromLayoutFlowThread();
void removeFromLayoutFlowThreadRecursive(LayoutFlowThread*);
ComputedStyle* cachedFirstLineStyle() const;
@@ -1410,10 +1418,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 +1519,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