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

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

Issue 340513004: Minor Refactor in RenderFlexbox (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 | « no previous file | 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 7cab4eda8558c0e972e2a7fed1a86c3219f8fbe8..109fd34a25c16a1bd6c00dff47271c537acdb380 100644
--- a/Source/core/rendering/RenderFlexibleBox.cpp
+++ b/Source/core/rendering/RenderFlexibleBox.cpp
@@ -316,11 +316,6 @@ void RenderFlexibleBox::repositionLogicalHeightDependentFlexItems(Vector<LineCon
LayoutUnit crossAxisStartEdge = lineContexts.isEmpty() ? LayoutUnit() : lineContexts[0].crossAxisOffset;
alignFlexLines(lineContexts);
- // If we have a single line flexbox or a multiline line flexbox with only one flex line,
- // the line height is all the available space.
- // For flex-direction: row, this means we need to use the height, so we do this after calling updateLogicalHeight.
- if (lineContexts.size() == 1)
- lineContexts[0].crossAxisExtent = crossAxisContentExtent();
alignChildren(lineContexts);
if (style()->flexWrap() == FlexWrapReverse)
@@ -1240,7 +1235,15 @@ static LayoutUnit alignContentSpaceBetweenChildren(LayoutUnit availableFreeSpace
void RenderFlexibleBox::alignFlexLines(Vector<LineContext>& lineContexts)
{
- if (!isMultiline() || style()->alignContent() == AlignContentFlexStart)
+ // If we have a single line flexbox or a multiline line flexbox with only one flex line,
+ // the line height is all the available space.
+ // For flex-direction: row, this means we need to use the height, so we do this after calling updateLogicalHeight.
+ if (lineContexts.size() == 1) {
+ lineContexts[0].crossAxisExtent = crossAxisContentExtent();
+ return;
+ }
+
+ if (style()->alignContent() == AlignContentFlexStart)
return;
LayoutUnit availableCrossAxisSpace = crossAxisContentExtent();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698