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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutGrid.h

Issue 2347613003: [css-grid] Refactor intrinsic size computation code (Closed)
Patch Set: Build fix Created 4 years, 3 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 | « no previous file | third_party/WebKit/Source/core/layout/LayoutGrid.cpp » ('j') | 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 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 void placeItemsOnGrid(SizingOperation); 136 void placeItemsOnGrid(SizingOperation);
137 void populateExplicitGridAndOrderIterator(); 137 void populateExplicitGridAndOrderIterator();
138 std::unique_ptr<GridArea> createEmptyGridAreaAtSpecifiedPositionsOutsideGrid (const LayoutBox&, GridTrackSizingDirection, const GridSpan& specifiedPositions) const; 138 std::unique_ptr<GridArea> createEmptyGridAreaAtSpecifiedPositionsOutsideGrid (const LayoutBox&, GridTrackSizingDirection, const GridSpan& specifiedPositions) const;
139 void placeSpecifiedMajorAxisItemsOnGrid(const Vector<LayoutBox*>&); 139 void placeSpecifiedMajorAxisItemsOnGrid(const Vector<LayoutBox*>&);
140 void placeAutoMajorAxisItemsOnGrid(const Vector<LayoutBox*>&); 140 void placeAutoMajorAxisItemsOnGrid(const Vector<LayoutBox*>&);
141 void placeAutoMajorAxisItemOnGrid(LayoutBox&, std::pair<size_t, size_t>& aut oPlacementCursor); 141 void placeAutoMajorAxisItemOnGrid(LayoutBox&, std::pair<size_t, size_t>& aut oPlacementCursor);
142 GridTrackSizingDirection autoPlacementMajorAxisDirection() const; 142 GridTrackSizingDirection autoPlacementMajorAxisDirection() const;
143 GridTrackSizingDirection autoPlacementMinorAxisDirection() const; 143 GridTrackSizingDirection autoPlacementMinorAxisDirection() const;
144 144
145 void computeIntrinsicLogicalHeight(GridSizingData&); 145 void computeTrackSizesForIndefiniteSize(GridTrackSizingDirection, GridSizing Data&, LayoutUnit& minIntrinsicSize, LayoutUnit& maxIntrinsicSize) const;
146 LayoutUnit computeTrackBasedLogicalHeight(const GridSizingData&) const; 146 LayoutUnit computeTrackBasedLogicalHeight(const GridSizingData&) const;
147 void computeTrackSizesForDirection(GridTrackSizingDirection, GridSizingData& , LayoutUnit freeSpace); 147 void computeTrackSizesForDefiniteSize(GridTrackSizingDirection, GridSizingDa ta&, LayoutUnit freeSpace) const;
148 148
149 void repeatTracksSizingIfNeeded(GridSizingData&, LayoutUnit availableSpaceFo rColumns, LayoutUnit availableSpaceForRows); 149 void repeatTracksSizingIfNeeded(GridSizingData&, LayoutUnit availableSpaceFo rColumns, LayoutUnit availableSpaceForRows);
150 150
151 void layoutGridItems(GridSizingData&); 151 void layoutGridItems(GridSizingData&);
152 void prepareChildForPositionedLayout(LayoutBox&); 152 void prepareChildForPositionedLayout(LayoutBox&);
153 void layoutPositionedObjects(bool relayoutChildren, PositionedLayoutBehavior = DefaultLayout); 153 void layoutPositionedObjects(bool relayoutChildren, PositionedLayoutBehavior = DefaultLayout);
154 void offsetAndBreadthForPositionedChild(const LayoutBox&, GridTrackSizingDir ection, LayoutUnit& offset, LayoutUnit& breadth); 154 void offsetAndBreadthForPositionedChild(const LayoutBox&, GridTrackSizingDir ection, LayoutUnit& offset, LayoutUnit& breadth);
155 void populateGridPositionsForDirection(GridSizingData&, GridTrackSizingDirec tion); 155 void populateGridPositionsForDirection(GridSizingData&, GridTrackSizingDirec tion);
156 156
157 typedef struct GridItemsSpanGroupRange GridItemsSpanGroupRange; 157 typedef struct GridItemsSpanGroupRange GridItemsSpanGroupRange;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 bool hasAutoSizeInColumnAxis(const LayoutBox& child) const { return isHorizo ntalWritingMode() ? child.styleRef().height().isAuto() : child.styleRef().width( ).isAuto(); } 198 bool hasAutoSizeInColumnAxis(const LayoutBox& child) const { return isHorizo ntalWritingMode() ? child.styleRef().height().isAuto() : child.styleRef().width( ).isAuto(); }
199 bool hasAutoSizeInRowAxis(const LayoutBox& child) const { return isHorizonta lWritingMode() ? child.styleRef().width().isAuto() : child.styleRef().height().i sAuto(); } 199 bool hasAutoSizeInRowAxis(const LayoutBox& child) const { return isHorizonta lWritingMode() ? child.styleRef().width().isAuto() : child.styleRef().height().i sAuto(); }
200 bool allowedToStretchChildAlongColumnAxis(const LayoutBox& child) const { re turn alignSelfForChild(child).position() == ItemPositionStretch && hasAutoSizeIn ColumnAxis(child) && !hasAutoMarginsInColumnAxis(child); } 200 bool allowedToStretchChildAlongColumnAxis(const LayoutBox& child) const { re turn alignSelfForChild(child).position() == ItemPositionStretch && hasAutoSizeIn ColumnAxis(child) && !hasAutoMarginsInColumnAxis(child); }
201 bool allowedToStretchChildAlongRowAxis(const LayoutBox& child) const { retur n justifySelfForChild(child).position() == ItemPositionStretch && hasAutoSizeInR owAxis(child) && !hasAutoMarginsInRowAxis(child); } 201 bool allowedToStretchChildAlongRowAxis(const LayoutBox& child) const { retur n justifySelfForChild(child).position() == ItemPositionStretch && hasAutoSizeInR owAxis(child) && !hasAutoMarginsInRowAxis(child); }
202 bool hasAutoMarginsInColumnAxis(const LayoutBox&) const; 202 bool hasAutoMarginsInColumnAxis(const LayoutBox&) const;
203 bool hasAutoMarginsInRowAxis(const LayoutBox&) const; 203 bool hasAutoMarginsInRowAxis(const LayoutBox&) const;
204 void updateAutoMarginsInColumnAxisIfNeeded(LayoutBox&); 204 void updateAutoMarginsInColumnAxisIfNeeded(LayoutBox&);
205 void updateAutoMarginsInRowAxisIfNeeded(LayoutBox&); 205 void updateAutoMarginsInRowAxisIfNeeded(LayoutBox&);
206 206
207 #if ENABLE(ASSERT) 207 #if ENABLE(ASSERT)
208 bool tracksAreWiderThanMinTrackBreadth(GridTrackSizingDirection, GridSizingD ata&); 208 bool tracksAreWiderThanMinTrackBreadth(GridTrackSizingDirection, GridSizingD ata&) const;
209 #endif 209 #endif
210 210
211 LayoutUnit gridGapForDirection(GridTrackSizingDirection, SizingOperation) co nst; 211 LayoutUnit gridGapForDirection(GridTrackSizingDirection, SizingOperation) co nst;
212 LayoutUnit guttersSize(GridTrackSizingDirection, size_t startLine, size_t sp an, SizingOperation) const; 212 LayoutUnit guttersSize(GridTrackSizingDirection, size_t startLine, size_t sp an, SizingOperation) const;
213 213
214 size_t gridItemSpan(const LayoutBox&, GridTrackSizingDirection); 214 size_t gridItemSpan(const LayoutBox&, GridTrackSizingDirection);
215 bool spanningItemCrossesFlexibleSizedTracks(const GridSpan&, GridTrackSizing Direction, SizingOperation) const; 215 bool spanningItemCrossesFlexibleSizedTracks(const GridSpan&, GridTrackSizing Direction, SizingOperation) const;
216 216
217 size_t gridColumnCount() const; 217 size_t gridColumnCount() const;
218 size_t gridRowCount() const; 218 size_t gridRowCount() const;
(...skipping 30 matching lines...) Expand all
249 std::unique_ptr<OrderedTrackIndexSet> m_autoRepeatEmptyRows { nullptr }; 249 std::unique_ptr<OrderedTrackIndexSet> m_autoRepeatEmptyRows { nullptr };
250 250
251 Optional<bool> m_hasDefiniteLogicalHeight; 251 Optional<bool> m_hasDefiniteLogicalHeight;
252 }; 252 };
253 253
254 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutGrid, isLayoutGrid()); 254 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutGrid, isLayoutGrid());
255 255
256 } // namespace blink 256 } // namespace blink
257 257
258 #endif // LayoutGrid_h 258 #endif // LayoutGrid_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutGrid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698