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

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

Issue 129633004: Avoid unnecessary forced layout of flex items when stretching (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 | « Source/core/rendering/RenderFlexibleBox.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderFlexibleBox.cpp
diff --git a/Source/core/rendering/RenderFlexibleBox.cpp b/Source/core/rendering/RenderFlexibleBox.cpp
index 6fec4ff1add1a2298a3171ec1fd520d4cdbaa820..d8dfa98834e550388609261a09d348f2df5d60f6 100644
--- a/Source/core/rendering/RenderFlexibleBox.cpp
+++ b/Source/core/rendering/RenderFlexibleBox.cpp
@@ -1044,15 +1044,6 @@ size_t RenderFlexibleBox::numberOfInFlowPositionedChildren(const OrderedFlexItem
return count;
}
-bool RenderFlexibleBox::needToStretchChild(RenderBox* child)
-{
- if (alignmentForChild(child) != AlignStretch)
- return false;
-
- Length crossAxisLength = isHorizontalFlow() ? child->style()->height() : child->style()->width();
- return crossAxisLength.isAuto();
-}
-
void RenderFlexibleBox::resetAutoMarginsAndLogicalTopInCrossAxis(RenderBox* child)
{
if (hasAutoMarginsInCrossAxis(child))
@@ -1084,10 +1075,9 @@ void RenderFlexibleBox::layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, cons
LayoutUnit childPreferredSize = childSizes[i] + mainAxisBorderAndPaddingExtentForChild(child);
setLogicalOverrideSize(child, childPreferredSize);
- // FIXME: Can avoid laying out here in some cases. See https://webkit.org/b/87905.
- if (needToStretchChild(child) || childPreferredSize != mainAxisExtentForChild(child))
+ if (childPreferredSize != mainAxisExtentForChild(child)) {
child->setChildNeedsLayout(MarkOnlyThis);
- else {
+ } else {
// To avoid double applying margin changes in updateAutoMarginsInCrossAxis, we reset the margins here.
resetAutoMarginsAndLogicalTopInCrossAxis(child);
}
« no previous file with comments | « Source/core/rendering/RenderFlexibleBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698