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

Unified Diff: Source/core/rendering/style/RenderStyle.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/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))

Powered by Google App Engine
This is Rietveld 408576698