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

Unified Diff: Source/WebCore/rendering/RenderObject.h

Issue 13679002: Add StyleChangeState to get rid of a bunch of static state in the render tree. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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
Index: Source/WebCore/rendering/RenderObject.h
diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h
index b5a7da4b667b5d9996a882dfb94f864869f65353..f30d9f08114b379929c4efaadf4bc7b77a6ce4df 100644
--- a/Source/WebCore/rendering/RenderObject.h
+++ b/Source/WebCore/rendering/RenderObject.h
@@ -148,6 +148,34 @@ typedef WTF::HashSet<const RenderObject*> RenderObjectAncestorLineboxDirtySet;
const int showTreeCharacterOffset = 39;
#endif
+struct StyleChangeState {
+ // RenderObject
+ unsigned affectsParentBlock : 1;
+
+ // RenderLayerModelObject
+ unsigned wasFloating : 1;
+ unsigned hadLayer : 1;
+ unsigned hadTransform : 1;
+ unsigned layerWasSelfPainting : 1;
+
+ // RenderBox
+ unsigned hadOverflowClip : 1;
+
+ // RenderBlock
+ unsigned couldPropagateFloatIntoSibling : 1;
+
+ StyleChangeState() :
+ affectsParentBlock(0),
eseidel 2013/04/05 01:50:36 I take it the compiler doesn't like "false"?
esprehn 2013/04/17 03:29:01 Nah, I was just moving fast. I'll change to false.
+ wasFloating(0),
+ hadLayer(0),
+ hadTransform(0),
+ layerWasSelfPainting(0),
+ hadOverflowClip(0),
+ couldPropagateFloatIntoSibling(0)
+ {
+ }
+};
+
// Base class for all rendering tree objects.
class RenderObject : public CachedImageClient {
friend class RenderBlock;
@@ -999,9 +1027,9 @@ protected:
inline bool layerCreationAllowedForSubtree() const;
// Overrides should call the superclass at the end
- virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
+ virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle, StyleChangeState&);
// Overrides should call the superclass at the start
- virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
+ virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle, const StyleChangeState&);
void propagateStyleToAnonymousChildren(bool blockChildrenOnly = false);
void drawLineForBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, BoxSide,
@@ -1169,10 +1197,6 @@ private:
void setNeedsSimplifiedNormalFlowLayout(bool b) { m_bitfields.setNeedsSimplifiedNormalFlowLayout(b); }
void setIsDragging(bool b) { m_bitfields.setIsDragging(b); }
void setEverHadLayout(bool b) { m_bitfields.setEverHadLayout(b); }
-
-private:
- // Store state between styleWillChange and styleDidChange
- static bool s_affectsParentBlock;
};
inline bool RenderObject::documentBeingDestroyed() const

Powered by Google App Engine
This is Rietveld 408576698