Chromium Code Reviews| Index: Source/core/rendering/RenderObject.cpp |
| diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp |
| index ae4ff3f494dee88d0c320c3a728fbeaddda6dd3f..be2db5e0756a456b6c0471a404d900ea5c18efe3 100644 |
| --- a/Source/core/rendering/RenderObject.cpp |
| +++ b/Source/core/rendering/RenderObject.cpp |
| @@ -1878,7 +1878,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())) |
| @@ -2025,7 +2025,7 @@ void RenderObject::setStyle(PassRefPtr<RenderStyle> style) |
| if (!diff.needsFullLayout()) { |
| if (updatedDiff.needsFullLayout()) |
| - setNeedsLayoutAndPrefWidthsRecalc(); |
| + setNeedsLayoutAndPrefWidthsRecalcWithoutForcingFullRepaint(); |
| else if (updatedDiff.needsPositionedMovementLayout()) |
| setNeedsPositionedMovementLayout(); |
| } |
| @@ -2037,14 +2037,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 (RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && needsLayout()) |
|
Julien - ping for review
2014/05/12 15:08:46
Ideally we would want any direct repaint calls to
Xianzhu
2014/05/12 21:31:51
Don't we still need repaint() on repaint-only (no
Julien - ping for review
2014/05/20 16:33:30
We do indeed. However we could make those use repa
|
| + setShouldDoFullRepaintAfterLayout(true); |
| + else |
| + repaint(); |
| } |
| } |
| @@ -2081,12 +2080,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 (RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && diff.needsLayout()) |
|
Julien - ping for review
2014/05/12 15:08:46
Same comment.
|
| + setShouldDoFullRepaintAfterLayout(true); |
| + else |
| + repaint(); |
| + } |
| if (isFloating() && (m_style->floating() != newStyle.floating())) |
| // For changes in float styles, we need to conceivably remove ourselves |
| @@ -2193,7 +2192,7 @@ void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldSt |
| markContainingBlocksForOverflowRecalc(); |
| if (diff.needsFullLayout()) |
| - setNeedsLayoutAndPrefWidthsRecalc(); |
| + setNeedsLayoutAndPrefWidthsRecalcWithoutForcingFullRepaint(); |
| } else if (diff.needsPositionedMovementLayout()) |
| setNeedsPositionedMovementLayout(); |