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

Unified Diff: Source/core/rendering/LayoutRepainter.cpp

Issue 204843002: Reduce invalidation on children-needs-layout containers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated after Levi's review. Created 6 years, 9 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/LayoutRepainter.cpp
diff --git a/Source/core/rendering/LayoutRepainter.cpp b/Source/core/rendering/LayoutRepainter.cpp
index 0e1f7791ce75f65c0d9aed0d2a2077bdb2f42991..14d59aff3494348cbdefa1c83561364ca4c5e03d 100644
--- a/Source/core/rendering/LayoutRepainter.cpp
+++ b/Source/core/rendering/LayoutRepainter.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "core/rendering/LayoutRepainter.h"
+#include "core/rendering/RenderBlock.h"
#include "core/rendering/RenderLayer.h"
#include "core/rendering/RenderObject.h"
@@ -50,11 +51,27 @@ LayoutRepainter::LayoutRepainter(RenderObject& object, bool checkForRepaint)
}
}
+bool LayoutRepainter::skipInvalidationWhenLayingOutChildren() const
eseidel 2014/03/21 00:37:09 I would have pushed this check onto the RenderObje
Julien - ping for review 2014/03/24 18:00:01 That wouldn't work currently as changing size trig
+{
+ if (!m_object.needsLayoutBecauseOfChildren())
+ return false;
+
+ // FIXME: We don't skip invalidations for SVG renderers for now.
pdr. 2014/03/21 00:25:06 This is fine, we'll never need this.
Julien - ping for review 2014/03/24 18:00:01 Done.
+ // RenderBlock with line boxes are responsible to invalidate them so we can't ignore them.
+ if (m_object.isSVG() || (m_object.isRenderBlock() && toRenderBlock(&m_object)->firstLineBox()))
+ return false;
+
+ return !m_object.style()->hasVisualOverflowingEffect() && !m_object.style()->hasBorder() && !m_object.style()->hasBackground();
+}
+
bool LayoutRepainter::repaintAfterLayout()
{
if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
return false;
+ if (skipInvalidationWhenLayingOutChildren())
+ return false;
+
// Hits in compositing/video/video-controls-layer-creation.html
DisableCompositingQueryAsserts disabler;

Powered by Google App Engine
This is Rietveld 408576698