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

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: Created 6 years, 3 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/fixed-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 b6db98ebcf328be94f64c9ecfebe286c9a719587..5bc10a9b66565f176cd14ab56e9b68093e850b85 100644
--- a/Source/core/rendering/style/RenderStyle.cpp
+++ b/Source/core/rendering/style/RenderStyle.cpp
@@ -385,6 +385,13 @@ StyleDifference RenderStyle::visualInvalidationDiff(const RenderStyle& other) co
if (!diff.needsFullLayout() && diffNeedsFullLayout(other))
diff.setNeedsFullLayout();
+ if (!diff.needsFullLayout() && surround->margin != other.surround->margin) {
+ if (position() == AbsolutePosition || position() == FixedPosition)
Julien - ping for review 2014/09/23 19:53:51 Shouldn't we use position() != StaticPosition here
rhogan 2014/09/23 20:08:27 We can't include RelativePosition here because the
+ 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()))
@@ -603,9 +610,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/fixed-margin-change-repaint-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698