Index: Source/core/rendering/style/RenderStyle.cpp |
diff --git a/Source/core/rendering/style/RenderStyle.cpp b/Source/core/rendering/style/RenderStyle.cpp |
index df03fc9af7441639f28075e592f134f39eb5cba9..3920d8f25b8d606b16f953c6beb28dadf42f7738 100644 |
--- a/Source/core/rendering/style/RenderStyle.cpp |
+++ b/Source/core/rendering/style/RenderStyle.cpp |
@@ -377,6 +377,11 @@ StyleDifference RenderStyle::visualInvalidationDiff(const RenderStyle& other, un |
if (m_svgStyle.get() != other.m_svgStyle.get()) |
diff = m_svgStyle->diff(other.m_svgStyle.get()); |
+ if ((!diff.needsFullLayout() || !diff.needsRepaint()) && diffNeedsFullLayoutAndRepaint(other)) { |
+ diff.setNeedsFullLayout(); |
+ diff.setNeedsRepaintObject(); |
+ } |
+ |
if (!diff.needsFullLayout() && diffNeedsFullLayout(other)) |
diff.setNeedsFullLayout(); |
@@ -412,8 +417,14 @@ StyleDifference RenderStyle::visualInvalidationDiff(const RenderStyle& other, un |
return diff; |
} |
-bool RenderStyle::diffNeedsFullLayout(const RenderStyle& other) const |
+bool RenderStyle::diffNeedsFullLayoutAndRepaint(const RenderStyle& other) const |
{ |
+ // FIXME: Not all cases in this method need both full layout and repaint. |
+ // Should move cases into diffNeedsFullLayout() if |
+ // - don't need repaint at all; |
+ // - or the renderer knows how to exactly repaint caused by the layout change |
+ // instead of forced full repaint. |
+ |
if (m_box.get() != other.m_box.get()) { |
if (m_box->width() != other.m_box->width() |
|| m_box->minWidth() != other.m_box->minWidth() |
@@ -604,6 +615,11 @@ bool RenderStyle::diffNeedsFullLayout(const RenderStyle& other) const |
return false; |
} |
+bool RenderStyle::diffNeedsFullLayout(const RenderStyle& other) const |
+{ |
+ return false; |
+} |
+ |
bool RenderStyle::diffNeedsRepaintLayer(const RenderStyle& other) const |
{ |
if (position() != StaticPosition && (visual->clip != other.visual->clip || visual->hasClip != other.visual->hasClip)) |