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

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

Issue 236203020: Separate repaint and layout requirements of StyleDifference (Step 1) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase; Renaming of some methods and small changes in StyleDifference 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/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index 25d3c276d7a174195d5c1fd7afa8a0c64db2cb6b..9595e53fa91b86cd2d280a3819290cef4f0f3b8f 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -143,10 +143,10 @@ void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle& newStyl
if (oldStyle) {
// The background of the root element or the body element could propagate up to
// the canvas. Just dirty the entire canvas when our style changes substantially.
- if (diff >= StyleDifferenceRepaint && node() &&
- (isHTMLHtmlElement(*node()) || isHTMLBodyElement(*node()))) {
+ if ((diff.needsRepaint() || diff.needsLayout()) && node()
+ && (isHTMLHtmlElement(*node()) || isHTMLBodyElement(*node()))) {
- if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled() || diff != StyleDifferenceLayout)
+ if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled() || !diff.needsFullLayout())
view()->repaint();
if (oldStyle->hasEntirelyFixedBackground() != newStyle.hasEntirelyFixedBackground())
@@ -155,7 +155,7 @@ void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle& newStyl
// When a layout hint happens and an object's position style changes, we have to do a layout
// to dirty the render tree using the old position value now.
- if (diff == StyleDifferenceLayout && parent() && oldStyle->position() != newStyle.position()) {
+ if (diff.needsFullLayout() && parent() && oldStyle->position() != newStyle.position()) {
markContainingBlocksForLayout();
if (oldStyle->position() == StaticPosition)
repaint();
@@ -211,7 +211,7 @@ void RenderBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle
}
// Our opaqueness might have changed without triggering layout.
- if (diff == StyleDifferenceRepaint || diff == StyleDifferenceRepaintLayer) {
+ if (diff.needsRepaint()) {
RenderObject* parentToInvalidate = parent();
for (unsigned i = 0; i < backgroundObscurationTestMaxDepth && parentToInvalidate; ++i) {
parentToInvalidate->invalidateBackgroundObscurationStatus();

Powered by Google App Engine
This is Rietveld 408576698