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

Unified Diff: sky/engine/core/rendering/RenderBlock.cpp

Issue 945003002: Remove LayoutState. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: improve test Created 5 years, 10 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 | « sky/engine/core/rendering/RenderBlock.h ('k') | sky/engine/core/rendering/RenderBlockFlow.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/RenderBlock.cpp
diff --git a/sky/engine/core/rendering/RenderBlock.cpp b/sky/engine/core/rendering/RenderBlock.cpp
index 94b779b3f36bb2922b1a96854795ed6cfa21d4e3..e88fe5f79e3e1ae04cf8a986e95545851bf4f675 100644
--- a/sky/engine/core/rendering/RenderBlock.cpp
+++ b/sky/engine/core/rendering/RenderBlock.cpp
@@ -261,7 +261,7 @@ bool RenderBlock::widthAvailableToChildrenHasChanged()
// If we use border-box sizing, have percentage padding, and our parent has changed width then the width available to our children has changed even
// though our own width has remained the same.
- widthAvailableToChildrenHasChanged |= style()->boxSizing() == BORDER_BOX && needsPreferredWidthsRecalculation() && view()->layoutState()->containingBlockLogicalWidthChanged();
ojan 2015/02/20 20:14:32 This is the potential change in behavior that's in
+ widthAvailableToChildrenHasChanged |= style()->boxSizing() == BORDER_BOX && needsPreferredWidthsRecalculation();
return widthAvailableToChildrenHasChanged;
}
@@ -350,31 +350,25 @@ bool RenderBlock::simplifiedLayout()
if (!posChildNeedsLayout() && !(needsSimplifiedNormalFlowLayout() || needsPositionedMovementLayout()))
return false;
+ if (needsPositionedMovementLayout() && !tryLayoutDoingPositionedMovementOnly())
+ return false;
- {
- // LayoutState needs this deliberate scope to pop before paint invalidation.
- LayoutState state(*this, locationOffset());
+ // Lay out positioned descendants or objects that just need to recompute overflow.
+ if (needsSimplifiedNormalFlowLayout())
+ simplifiedNormalFlowLayout();
- if (needsPositionedMovementLayout() && !tryLayoutDoingPositionedMovementOnly())
- return false;
+ if (posChildNeedsLayout() || needsPositionedMovementLayout())
+ layoutPositionedObjects(false, needsPositionedMovementLayout() ? ForcedLayoutAfterContainingBlockMoved : DefaultLayout);
- // Lay out positioned descendants or objects that just need to recompute overflow.
- if (needsSimplifiedNormalFlowLayout())
- simplifiedNormalFlowLayout();
-
- if (posChildNeedsLayout() || needsPositionedMovementLayout())
- layoutPositionedObjects(false, needsPositionedMovementLayout() ? ForcedLayoutAfterContainingBlockMoved : DefaultLayout);
-
- // Recompute our overflow information.
- // FIXME: We could do better here by computing a temporary overflow object from layoutPositionedObjects and only
- // updating our overflow if we either used to have overflow or if the new temporary object has overflow.
- // For now just always recompute overflow. This is no worse performance-wise than the old code that called rightmostPosition and
- // lowestPosition on every relayout so it's not a regression.
- // computeOverflow expects the bottom edge before we clamp our height. Since this information isn't available during
- // simplifiedLayout, we cache the value in m_overflow.
- LayoutUnit oldClientAfterEdge = hasRenderOverflow() ? m_overflow->layoutClientAfterEdge() : clientLogicalBottom();
- computeOverflow(oldClientAfterEdge, true);
- }
+ // Recompute our overflow information.
+ // FIXME: We could do better here by computing a temporary overflow object from layoutPositionedObjects and only
+ // updating our overflow if we either used to have overflow or if the new temporary object has overflow.
+ // For now just always recompute overflow. This is no worse performance-wise than the old code that called rightmostPosition and
+ // lowestPosition on every relayout so it's not a regression.
+ // computeOverflow expects the bottom edge before we clamp our height. Since this information isn't available during
+ // simplifiedLayout, we cache the value in m_overflow.
+ LayoutUnit oldClientAfterEdge = hasRenderOverflow() ? m_overflow->layoutClientAfterEdge() : clientLogicalBottom();
+ computeOverflow(oldClientAfterEdge, true);
updateLayerTransformAfterLayout();
« no previous file with comments | « sky/engine/core/rendering/RenderBlock.h ('k') | sky/engine/core/rendering/RenderBlockFlow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698