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

Side by Side Diff: Source/core/layout/LayoutGrid.cpp

Issue 1070143002: [Alignment] Single class for holding the alignment data. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Using the StyleConverter. Created 5 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 LayoutUnit availableSpaceForRows = availableLogicalHeight(IncludeMarginBorde rPadding); 1125 LayoutUnit availableSpaceForRows = availableLogicalHeight(IncludeMarginBorde rPadding);
1126 GridSizingData sizingData(gridColumnCount(), gridRowCount()); 1126 GridSizingData sizingData(gridColumnCount(), gridRowCount());
1127 computeUsedBreadthOfGridTracks(ForColumns, sizingData, availableSpaceForColu mns); 1127 computeUsedBreadthOfGridTracks(ForColumns, sizingData, availableSpaceForColu mns);
1128 ASSERT(tracksAreWiderThanMinTrackBreadth(ForColumns, sizingData.columnTracks )); 1128 ASSERT(tracksAreWiderThanMinTrackBreadth(ForColumns, sizingData.columnTracks ));
1129 computeUsedBreadthOfGridTracks(ForRows, sizingData, availableSpaceForRows); 1129 computeUsedBreadthOfGridTracks(ForRows, sizingData, availableSpaceForRows);
1130 ASSERT(tracksAreWiderThanMinTrackBreadth(ForRows, sizingData.rowTracks)); 1130 ASSERT(tracksAreWiderThanMinTrackBreadth(ForRows, sizingData.rowTracks));
1131 1131
1132 populateGridPositions(sizingData); 1132 populateGridPositions(sizingData);
1133 m_gridItemsOverflowingGridArea.resize(0); 1133 m_gridItemsOverflowingGridArea.resize(0);
1134 1134
1135 LayoutUnit columnOffset = contentPositionAndDistributionColumnOffset(availab leSpaceForColumns, style()->justifyContent(), style()->justifyContentDistributio n(), style()->justifyContentOverflowAlignment(), m_columnPositions.size() - 1); 1135 LayoutUnit columnOffset = contentPositionAndDistributionColumnOffset(availab leSpaceForColumns, style()->justifyContentPosition(), style()->justifyContentDis tribution(), style()->justifyContentOverflowAlignment(), m_columnPositions.size( ) - 1);
1136 LayoutUnit rowOffset = contentPositionAndDistributionRowOffset(availableSpac eForRows, style()->alignContent(), style()->alignContentDistribution(), style()- >alignContentOverflowAlignment(), m_rowPositions.size() - 1); 1136 LayoutUnit rowOffset = contentPositionAndDistributionRowOffset(availableSpac eForRows, style()->alignContentPosition(), style()->alignContentDistribution(), style()->alignContentOverflowAlignment(), m_rowPositions.size() - 1);
1137 LayoutSize contentPositionOffset(columnOffset, rowOffset); 1137 LayoutSize contentPositionOffset(columnOffset, rowOffset);
1138 1138
1139 for (LayoutBox* child = firstChildBox(); child; child = child->nextSiblingBo x()) { 1139 for (LayoutBox* child = firstChildBox(); child; child = child->nextSiblingBo x()) {
1140 if (child->isOutOfFlowPositioned()) { 1140 if (child->isOutOfFlowPositioned()) {
1141 child->containingBlock()->insertPositionedObject(child); 1141 child->containingBlock()->insertPositionedObject(child);
1142 continue; 1142 continue;
1143 } 1143 }
1144 1144
1145 // Because the grid area cannot be styled, we don't need to adjust 1145 // Because the grid area cannot be styled, we don't need to adjust
1146 // the grid breadth to account for 'box-sizing'. 1146 // the grid breadth to account for 'box-sizing'.
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
1767 if (isFloating()) 1767 if (isFloating())
1768 return "LayoutGrid (floating)"; 1768 return "LayoutGrid (floating)";
1769 if (isAnonymous()) 1769 if (isAnonymous())
1770 return "LayoutGrid (anonymous)"; 1770 return "LayoutGrid (anonymous)";
1771 if (isRelPositioned()) 1771 if (isRelPositioned())
1772 return "LayoutGrid (relative positioned)"; 1772 return "LayoutGrid (relative positioned)";
1773 return "LayoutGrid"; 1773 return "LayoutGrid";
1774 } 1774 }
1775 1775
1776 } // namespace blink 1776 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698