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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp

Issue 2697623003: [css-flexbox] Don't add extra space-between space at the end (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/css3/flexbox/justify-content-space-between.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1836 matching lines...) Expand 10 before | Expand all | Expand 10 after
1847 LayoutUnit childMainExtent = mainAxisExtentForChild(*child); 1847 LayoutUnit childMainExtent = mainAxisExtentForChild(*child);
1848 // In an RTL column situation, this will apply the margin-right/margin-end 1848 // In an RTL column situation, this will apply the margin-right/margin-end
1849 // on the left. This will be fixed later in flipForRightToLeftColumn. 1849 // on the left. This will be fixed later in flipForRightToLeftColumn.
1850 LayoutPoint childLocation( 1850 LayoutPoint childLocation(
1851 shouldFlipMainAxis ? totalMainExtent - mainAxisOffset - childMainExtent 1851 shouldFlipMainAxis ? totalMainExtent - mainAxisOffset - childMainExtent
1852 : mainAxisOffset, 1852 : mainAxisOffset,
1853 crossAxisOffset + flowAwareMarginBeforeForChild(*child)); 1853 crossAxisOffset + flowAwareMarginBeforeForChild(*child));
1854 setFlowAwareLocationForChild(*child, childLocation); 1854 setFlowAwareLocationForChild(*child, childLocation);
1855 mainAxisOffset += childMainExtent + flowAwareMarginEndForChild(*child); 1855 mainAxisOffset += childMainExtent + flowAwareMarginEndForChild(*child);
1856 1856
1857 mainAxisOffset += justifyContentSpaceBetweenChildren( 1857 if (i != children.size() - 1) {
1858 availableFreeSpace, distribution, children.size()); 1858 // The last item does not get extra space added.
1859 mainAxisOffset += justifyContentSpaceBetweenChildren(
1860 availableFreeSpace, distribution, children.size());
1861 }
1859 1862
1860 if (isPaginated) 1863 if (isPaginated)
1861 updateFragmentationInfoForChild(*child); 1864 updateFragmentationInfoForChild(*child);
1862 } 1865 }
1863 1866
1864 if (isColumnFlow()) 1867 if (isColumnFlow())
1865 setLogicalHeight(std::max( 1868 setLogicalHeight(std::max(
1866 logicalHeight(), mainAxisOffset + flowAwareBorderEnd() + 1869 logicalHeight(), mainAxisOffset + flowAwareBorderEnd() +
1867 flowAwarePaddingEnd() + scrollbarLogicalHeight())); 1870 flowAwarePaddingEnd() + scrollbarLogicalHeight()));
1868 1871
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
2163 LayoutUnit originalOffset = 2166 LayoutUnit originalOffset =
2164 lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; 2167 lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge;
2165 LayoutUnit newOffset = 2168 LayoutUnit newOffset =
2166 contentExtent - originalOffset - lineCrossAxisExtent; 2169 contentExtent - originalOffset - lineCrossAxisExtent;
2167 adjustAlignmentForChild(*flexItem.box, newOffset - originalOffset); 2170 adjustAlignmentForChild(*flexItem.box, newOffset - originalOffset);
2168 } 2171 }
2169 } 2172 }
2170 } 2173 }
2171 2174
2172 } // namespace blink 2175 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/css3/flexbox/justify-content-space-between.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698