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

Unified Diff: Source/WebCore/rendering/RenderBlock.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/RenderBlock.cpp
diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp
index 4bed6e0f78aeff01608812eaab7d2ecda08a92e3..99dcc26440faf40133a54e5e96e0a38931fc95f4 100644
--- a/Source/WebCore/rendering/RenderBlock.cpp
+++ b/Source/WebCore/rendering/RenderBlock.cpp
@@ -122,8 +122,6 @@ static DelayedUpdateScrollInfoSet* gDelayedUpdateScrollInfoSet = 0;
static bool gColumnFlowSplitEnabled = true;
-bool RenderBlock::s_canPropagateFloatIntoSibling = false;
eseidel 2013/04/05 01:50:36 Makes me wonder where this was ever cleared....
esprehn 2013/04/17 03:29:01 It never was, we just always call styleWillChange
-
// This class helps dispatching the 'overflow' event on layout change. overflow can be set on RenderBoxes, yet the existing code
// only works on RenderBlocks. If this change, this class should be shared with other RenderBoxes.
class OverflowEventDispatcher {
@@ -303,10 +301,11 @@ void RenderBlock::willBeDestroyed()
RenderBox::willBeDestroyed();
}
-void RenderBlock::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
+void RenderBlock::styleWillChange(StyleDifference diff, const RenderStyle* newStyle, StyleChangeState& state)
{
RenderStyle* oldStyle = style();
- s_canPropagateFloatIntoSibling = oldStyle ? !isFloatingOrOutOfFlowPositioned() && !avoidsFloats() : false;
+ if (oldStyle)
+ state.couldPropagateFloatIntoSibling = !isFloatingOrOutOfFlowPositioned() && !avoidsFloats();
setReplaced(newStyle->isDisplayInlineType());
@@ -335,7 +334,7 @@ void RenderBlock::styleWillChange(StyleDifference diff, const RenderStyle* newSt
markAllDescendantsWithFloatsForLayout();
}
- RenderBox::styleWillChange(diff, newStyle);
+ RenderBox::styleWillChange(diff, newStyle, state);
}
static bool borderOrPaddingLogicalWidthChanged(const RenderStyle* oldStyle, const RenderStyle* newStyle)
@@ -352,10 +351,10 @@ static bool borderOrPaddingLogicalWidthChanged(const RenderStyle* oldStyle, cons
|| oldStyle->paddingBottom() != newStyle->paddingBottom();
}
-void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
+void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle, const StyleChangeState& state)
{
- RenderBox::styleDidChange(diff, oldStyle);
-
+ RenderBox::styleDidChange(diff, oldStyle, state);
+
RenderStyle* newStyle = style();
#if ENABLE(CSS_EXCLUSIONS)
@@ -382,7 +381,7 @@ void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldSty
// then mark its descendants with floats for layout and clear all floats from its next
// sibling blocks that exist in our floating objects list. See bug 56299 and 62875.
bool canPropagateFloatIntoSibling = !isFloatingOrOutOfFlowPositioned() && !avoidsFloats();
- if (diff == StyleDifferenceLayout && s_canPropagateFloatIntoSibling && !canPropagateFloatIntoSibling && hasOverhangingFloats()) {
+ if (diff == StyleDifferenceLayout && state.couldPropagateFloatIntoSibling && !canPropagateFloatIntoSibling && hasOverhangingFloats()) {
RenderBlock* parentBlock = this;
const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
FloatingObjectSetIterator end = floatingObjectSet.end();

Powered by Google App Engine
This is Rietveld 408576698