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

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: Created 6 years, 8 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 dfeb3bed61f5b2ce8ec111e0e8193140b5c768cd..2256f16c678904a309d2c7082d38b7aeba2504d3 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,13 @@ 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 repaint caused by layout change.
Julien - ping for review 2014/05/12 15:08:46 I don't understand this sentence: when do we *not*
Xianzhu 2014/05/12 21:31:51 I mean the renderer knows how to repaint optimally
+
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 +613,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