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

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

Issue 217563003: Turn styleWillChange |newStyle| into a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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/rendering/RenderBox.h ('k') | Source/core/rendering/RenderButton.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index c6b40102f36b736d24fc1ddb468ddc148e97d010..0087bae6a56fc67c6cf695ade40f3dce271da8a2 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -137,7 +137,7 @@ void RenderBox::removeFloatingOrPositionedChildFromBlockLists()
RenderBlock::removePositionedObject(this);
}
-void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
+void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle& newStyle)
{
RenderStyle* oldStyle = style();
if (oldStyle) {
@@ -149,22 +149,24 @@ void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle* newStyl
if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled() || diff != StyleDifferenceLayout)
view()->repaint();
- if (oldStyle->hasEntirelyFixedBackground() != newStyle->hasEntirelyFixedBackground())
+ if (oldStyle->hasEntirelyFixedBackground() != newStyle.hasEntirelyFixedBackground())
view()->compositor()->rootFixedBackgroundsChanged();
}
// When a layout hint happens and an object's position style changes, we have to do a layout
// to dirty the render tree using the old position value now.
- if (diff == StyleDifferenceLayout && parent() && oldStyle->position() != newStyle->position()) {
+ if (diff == StyleDifferenceLayout && parent() && oldStyle->position() != newStyle.position()) {
markContainingBlocksForLayout();
if (oldStyle->position() == StaticPosition)
repaint();
- else if (newStyle->hasOutOfFlowPosition())
+ else if (newStyle.hasOutOfFlowPosition())
parent()->setChildNeedsLayout();
- if (isFloating() && !isOutOfFlowPositioned() && newStyle->hasOutOfFlowPosition())
+ if (isFloating() && !isOutOfFlowPositioned() && newStyle.hasOutOfFlowPosition())
removeFloatingOrPositionedChildFromBlockLists();
}
- } else if (newStyle && isBody())
+ // FIXME: This branch runs when !oldStyle, which means that layout was never called
+ // so what's the point in invalidating the whole view that we never painted?
esprehn 2014/03/31 20:07:51 yeah this code doesn't make any sense, you should
Julien - ping for review 2014/03/31 20:20:27 I will post a follow-up patch for that to keep thi
+ } else if (isBody())
view()->repaint();
RenderBoxModelObject::styleWillChange(diff, newStyle);
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderButton.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698