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

Unified Diff: Source/WebCore/rendering/RenderBox.cpp

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/RenderBox.cpp
diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp
index f93b1474b8a07a98d633f50a3e118ec98b8473d5..dbcbf4f8030a1ac7134f1b79e9b101ba85e65b13 100644
--- a/Source/WebCore/rendering/RenderBox.cpp
+++ b/Source/WebCore/rendering/RenderBox.cpp
@@ -91,8 +91,6 @@ static OverrideSizeMap* gOverrideContainingBlockLogicalWidthMap = 0;
static const int autoscrollBeltSize = 20;
static const unsigned backgroundObscurationTestMaxDepth = 4;
-bool RenderBox::s_hadOverflowClip = false;
-
static bool skipBodyBackground(const RenderBox* bodyElementRenderer)
{
ASSERT(bodyElementRenderer->isBody());
@@ -210,9 +208,9 @@ void RenderBox::removeFloatingOrPositionedChildFromBlockLists()
RenderBlock::removePositionedObject(this);
}
-void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
+void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle* newStyle, StyleChangeState& state)
{
- s_hadOverflowClip = hasOverflowClip();
+ state.hadOverflowClip = hasOverflowClip();
RenderStyle* oldStyle = style();
if (oldStyle) {
@@ -242,17 +240,17 @@ void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle* newStyl
} else if (newStyle && isBody())
view()->repaint();
- RenderBoxModelObject::styleWillChange(diff, newStyle);
+ RenderBoxModelObject::styleWillChange(diff, newStyle, state);
}
-void RenderBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
+void RenderBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle, const StyleChangeState& state)
{
// Horizontal writing mode definition is updated in RenderBoxModelObject::updateFromStyle,
// (as part of the RenderBoxModelObject::styleDidChange call below). So, we can safely cache the horizontal
// writing mode value before style change here.
bool oldHorizontalWritingMode = isHorizontalWritingMode();
- RenderBoxModelObject::styleDidChange(diff, oldStyle);
+ RenderBoxModelObject::styleDidChange(diff, oldStyle, state);
RenderStyle* newStyle = style();
if (needsLayout() && oldStyle) {
@@ -344,9 +342,9 @@ void RenderBox::updateExclusionShapeOutsideInfoAfterStyleChange(const ExclusionS
}
#endif
-void RenderBox::updateFromStyle()
+void RenderBox::updateFromStyle(const StyleChangeState& state)
{
- RenderBoxModelObject::updateFromStyle();
+ RenderBoxModelObject::updateFromStyle(state);
RenderStyle* styleToUse = style();
bool isRootObject = isRoot();
@@ -375,7 +373,7 @@ void RenderBox::updateFromStyle()
// Check for overflow clip.
// It's sufficient to just check one direction, since it's illegal to have visible on only one overflow value.
if (boxHasOverflowClip) {
- if (!s_hadOverflowClip)
+ if (!state.hadOverflowClip)
eseidel 2013/04/05 01:50:36 Hopefully the repaint tests will catch if we got t
// Erase the overflow
repaint();
setHasOverflowClip();

Powered by Google App Engine
This is Rietveld 408576698