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

Unified Diff: Source/core/rendering/style/RenderStyle.cpp

Issue 580533002: Use PositionedMovementLayout for changes to positioned elements' margins (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated test Created 6 years, 2 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
« no previous file with comments | « LayoutTests/fast/repaint/relative-margin-change-repaint-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/style/RenderStyle.cpp
diff --git a/Source/core/rendering/style/RenderStyle.cpp b/Source/core/rendering/style/RenderStyle.cpp
index e06cff5000b76ae6bdd6d1c0e078d5bf34d21cb4..b28acc9e5e761b018b9edd720c32b41aa2c3e093 100644
--- a/Source/core/rendering/style/RenderStyle.cpp
+++ b/Source/core/rendering/style/RenderStyle.cpp
@@ -395,6 +395,14 @@ StyleDifference RenderStyle::visualInvalidationDiff(const RenderStyle& other) co
if (!diff.needsFullLayout() && diffNeedsFullLayout(other))
diff.setNeedsFullLayout();
+ if (!diff.needsFullLayout() && surround->margin != other.surround->margin) {
+ // Relative-positioned elements collapse their margins so need a full layout.
+ if (position() == AbsolutePosition || position() == FixedPosition)
+ diff.setNeedsPositionedMovementLayout();
+ else
+ diff.setNeedsFullLayout();
+ }
+
if (!diff.needsFullLayout() && position() != StaticPosition && surround->offset != other.surround->offset) {
// Optimize for the case where a positioned layer is moving but not changing size.
if (positionedObjectMovedOnly(surround->offset, other.surround->offset, m_box->width()))
@@ -613,9 +621,6 @@ bool RenderStyle::diffNeedsFullLayout(const RenderStyle& other) const
return true;
if (surround.get() != other.surround.get()) {
- if (surround->margin != other.surround->margin)
- return true;
-
if (surround->padding != other.surround->padding)
return true;
}
« no previous file with comments | « LayoutTests/fast/repaint/relative-margin-change-repaint-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698