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

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

Issue 2589143002: [css-grid] Isolate intrinsic size computation from layout (Closed)
Patch Set: Patch for landing Created 3 years, 12 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 GridSizingData&) const; 142 GridSizingData&) const;
143 143
144 size_t computeAutoRepeatTracksCount(GridTrackSizingDirection, 144 size_t computeAutoRepeatTracksCount(GridTrackSizingDirection,
145 SizingOperation) const; 145 SizingOperation) const;
146 146
147 typedef ListHashSet<size_t> OrderedTrackIndexSet; 147 typedef ListHashSet<size_t> OrderedTrackIndexSet;
148 std::unique_ptr<OrderedTrackIndexSet> computeEmptyTracksForAutoRepeat( 148 std::unique_ptr<OrderedTrackIndexSet> computeEmptyTracksForAutoRepeat(
149 Grid&, 149 Grid&,
150 GridTrackSizingDirection) const; 150 GridTrackSizingDirection) const;
151 151
152 void placeItemsOnGrid(Grid&, SizingOperation); 152 void placeItemsOnGrid(Grid&, SizingOperation) const;
153 void populateExplicitGridAndOrderIterator(Grid&) const; 153 void populateExplicitGridAndOrderIterator(Grid&) const;
154 std::unique_ptr<GridArea> createEmptyGridAreaAtSpecifiedPositionsOutsideGrid( 154 std::unique_ptr<GridArea> createEmptyGridAreaAtSpecifiedPositionsOutsideGrid(
155 const Grid&, 155 const Grid&,
156 const LayoutBox&, 156 const LayoutBox&,
157 GridTrackSizingDirection, 157 GridTrackSizingDirection,
158 const GridSpan& specifiedPositions) const; 158 const GridSpan& specifiedPositions) const;
159 void placeSpecifiedMajorAxisItemsOnGrid(Grid&, 159 void placeSpecifiedMajorAxisItemsOnGrid(Grid&,
160 const Vector<LayoutBox*>&) const; 160 const Vector<LayoutBox*>&) const;
161 void placeAutoMajorAxisItemsOnGrid(Grid&, const Vector<LayoutBox*>&) const; 161 void placeAutoMajorAxisItemsOnGrid(Grid&, const Vector<LayoutBox*>&) const;
162 void placeAutoMajorAxisItemOnGrid( 162 void placeAutoMajorAxisItemOnGrid(
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 GridTrackSizingDirection) const; 344 GridTrackSizingDirection) const;
345 345
346 bool cachedHasDefiniteLogicalHeight() const; 346 bool cachedHasDefiniteLogicalHeight() const;
347 347
348 size_t numTracks(GridTrackSizingDirection, const Grid&) const; 348 size_t numTracks(GridTrackSizingDirection, const Grid&) const;
349 349
350 // TODO(svillar): move into this class once GridIterator is added. 350 // TODO(svillar): move into this class once GridIterator is added.
351 typedef Vector<Vector<GridCell>> GridAsMatrix; 351 typedef Vector<Vector<GridCell>> GridAsMatrix;
352 class Grid final { 352 class Grid final {
353 public: 353 public:
354 Grid(LayoutGrid* grid) : m_orderIterator(grid) {} 354 Grid(const LayoutGrid* grid) : m_orderIterator(grid) {}
355 355
356 size_t numTracks(GridTrackSizingDirection) const; 356 size_t numTracks(GridTrackSizingDirection) const;
357 357
358 void ensureGridSize(size_t maximumRowSize, size_t maximumColumnSize); 358 void ensureGridSize(size_t maximumRowSize, size_t maximumColumnSize);
359 void insert(LayoutBox&, const GridArea&); 359 void insert(LayoutBox&, const GridArea&);
360 360
361 // Note that out of flow children are not grid items. 361 // Note that out of flow children are not grid items.
362 bool hasGridItems() const { return !m_gridItemArea.isEmpty(); } 362 bool hasGridItems() const { return !m_gridItemArea.isEmpty(); }
363 363
364 // TODO(svillar): move this to SizingData once it's passed to 364 // TODO(svillar): move this to SizingData once it's passed to
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 LayoutUnit m_maxContentHeight{-1}; 436 LayoutUnit m_maxContentHeight{-1};
437 437
438 Optional<bool> m_hasDefiniteLogicalHeight; 438 Optional<bool> m_hasDefiniteLogicalHeight;
439 }; 439 };
440 440
441 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutGrid, isLayoutGrid()); 441 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutGrid, isLayoutGrid());
442 442
443 } // namespace blink 443 } // namespace blink
444 444
445 #endif // LayoutGrid_h 445 #endif // LayoutGrid_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698