Index: Source/core/rendering/style/RenderStyle.cpp |
diff --git a/Source/core/rendering/style/RenderStyle.cpp b/Source/core/rendering/style/RenderStyle.cpp |
index d13cd51ed88794433ff0e651db142a3f52cf07ca..9853249c8048f650f98f2e0ff507d00de1a09581 100644 |
--- a/Source/core/rendering/style/RenderStyle.cpp |
+++ b/Source/core/rendering/style/RenderStyle.cpp |
@@ -376,6 +376,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(); |
@@ -411,8 +416,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() |
@@ -603,6 +614,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)) |