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

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

Issue 265703012: Separate repaint and layout requirements of StyleDifference (Step 4) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 7 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/core/rendering/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index 5daa08d05501720a19a09f72b93a337bfaa1b601..96e08930defba9640a5cc047b5fb2f120fcb006d 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -1910,7 +1910,7 @@ StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff, unsign
diff.setNeedsFullLayout();
// If transform changed, and the layer does not paint into its own separate backing, then we need to repaint.
- if (contextSensitiveProperties & ContextSensitivePropertyTransform && !diff.needsLayout()) {
+ if (contextSensitiveProperties & ContextSensitivePropertyTransform) {
// Text nodes share style with their parents but transforms don't apply to them,
// hence the !isText() check.
if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer()->hasDirectReasonsForCompositing()))
@@ -2057,7 +2057,7 @@ void RenderObject::setStyle(PassRefPtr<RenderStyle> style)
if (!diff.needsFullLayout()) {
if (updatedDiff.needsFullLayout())
- setNeedsLayoutAndPrefWidthsRecalcAndFullRepaint();
+ setNeedsLayoutAndPrefWidthsRecalc();
else if (updatedDiff.needsPositionedMovementLayout())
setNeedsPositionedMovementLayout();
}
@@ -2069,14 +2069,13 @@ void RenderObject::setStyle(PassRefPtr<RenderStyle> style)
toRenderBox(this)->updateLayerTransform();
}
- // FIXME: The !needsFullLayout() check is temporary to keep the original StyleDifference
- // behavior that we did't repaint here on StyleDifferenceLayout.
- // In the next steps we will not always repaint on selfNeedsLayout(), and should force
- // repaint here if needsRepaint is set.
- if (updatedDiff.needsRepaint() && !updatedDiff.needsFullLayout()) {
- // Do a repaint with the new style now, e.g., for example if we go from
- // not having an outline to having an outline.
- repaint();
+ if (updatedDiff.needsRepaint()) {
+ // Repaint with the new style, e.g., for example if we go from not having
+ // an outline to having an outline.
+ if (needsLayout())
+ setShouldDoFullRepaintAfterLayout(true);
+ else
+ repaint();
}
}
@@ -2113,12 +2112,12 @@ void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle& newS
}
}
- // FIXME: The !needsFullLayout() check is temporary to keep the original StyleDifference
- // behavior that we did't repaint here on StyleDifferenceLayout.
- // In the next steps we will not always repaint on selfNeedsLayout(), and should force
- // repaint here if needsRepaintObject is set.
- if (m_parent && diff.needsRepaintObject() && !diff.needsFullLayout())
- repaint();
+ if (m_parent && diff.needsRepaintObject()) {
+ if (diff.needsLayout() || needsLayout())
+ setShouldDoFullRepaintAfterLayout(true);
+ else
+ repaint();
+ }
if (isFloating() && (m_style->floating() != newStyle.floating()))
// For changes in float styles, we need to conceivably remove ourselves
@@ -2225,7 +2224,7 @@ void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
markContainingBlocksForOverflowRecalc();
if (diff.needsFullLayout())
- setNeedsLayoutAndPrefWidthsRecalcAndFullRepaint();
+ setNeedsLayoutAndPrefWidthsRecalc();
} else if (diff.needsPositionedMovementLayout())
setNeedsPositionedMovementLayout();

Powered by Google App Engine
This is Rietveld 408576698