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

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

Issue 722643002: No need to detect change in size when opting for PositionedMovementLayout (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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/block/positioning/positioned-movement-layout-when-height-changes-expected.html ('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 568ab195c1d6a256b7a170899346daffd40aec32..93be0eacc14fc59250a3770adf2962549a40dd42 100644
--- a/Source/core/rendering/style/RenderStyle.cpp
+++ b/Source/core/rendering/style/RenderStyle.cpp
@@ -353,35 +353,6 @@ bool RenderStyle::inheritedDataShared(const RenderStyle* other) const
&& rareInheritedData.get() == other->rareInheritedData.get();
}
-static bool positionedObjectMovedOnly(const LengthBox& a, const LengthBox& b, const Length& width)
-{
- // If any unit types are different, then we can't guarantee
- // that this was just a movement.
- if (a.left().type() != b.left().type()
- || a.right().type() != b.right().type()
- || a.top().type() != b.top().type()
- || a.bottom().type() != b.bottom().type())
- return false;
-
- // Only one unit can be non-auto in the horizontal direction and
- // in the vertical direction. Otherwise the adjustment of values
- // is changing the size of the box.
- if (!a.left().isIntrinsicOrAuto() && !a.right().isIntrinsicOrAuto())
- return false;
- if (!a.top().isIntrinsicOrAuto() && !a.bottom().isIntrinsicOrAuto())
- return false;
- // If our width is auto and left or right is specified and changed then this
- // is not just a movement - we need to resize to our container.
- if (width.isIntrinsicOrAuto()
- && ((!a.left().isIntrinsicOrAuto() && a.left() != b.left())
- || (!a.right().isIntrinsicOrAuto() && a.right() != b.right())))
- return false;
-
- // One of the units is fixed or percent in both directions and stayed
- // that way in the new style. Therefore all we are doing is moving.
- return true;
-}
-
StyleDifference RenderStyle::visualInvalidationDiff(const RenderStyle& other) const
{
// Note, we use .get() on each DataRef below because DataRef::operator== will do a deep
@@ -410,10 +381,7 @@ StyleDifference RenderStyle::visualInvalidationDiff(const RenderStyle& other) co
if (!diff.needsFullLayout() && position() != StaticPosition && surround->offset != other.surround->offset) {
// Optimize for the case where a positioned layer is moving but not changing size.
pdr. 2014/12/01 21:03:05 This comment needs updating, no?
- if (positionedObjectMovedOnly(surround->offset, other.surround->offset, m_box->width()))
- diff.setNeedsPositionedMovementLayout();
- else
- diff.setNeedsFullLayout();
+ diff.setNeedsPositionedMovementLayout();
}
if (diffNeedsPaintInvalidationLayer(other))
« no previous file with comments | « LayoutTests/fast/block/positioning/positioned-movement-layout-when-height-changes-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698