| OLD | NEW |
| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 LayoutUnit computeTrackBasedLogicalHeight(const GridSizingData&) const; | 130 LayoutUnit computeTrackBasedLogicalHeight(const GridSizingData&) const; |
| 131 void computeTrackSizesForDirection(GridTrackSizingDirection, GridSizingData&
, LayoutUnit freeSpace); | 131 void computeTrackSizesForDirection(GridTrackSizingDirection, GridSizingData&
, LayoutUnit freeSpace); |
| 132 | 132 |
| 133 void layoutGridItems(GridSizingData&); | 133 void layoutGridItems(GridSizingData&); |
| 134 void prepareChildForPositionedLayout(LayoutBox&); | 134 void prepareChildForPositionedLayout(LayoutBox&); |
| 135 void layoutPositionedObjects(bool relayoutChildren, PositionedLayoutBehavior
= DefaultLayout); | 135 void layoutPositionedObjects(bool relayoutChildren, PositionedLayoutBehavior
= DefaultLayout); |
| 136 void offsetAndBreadthForPositionedChild(const LayoutBox&, GridTrackSizingDir
ection, LayoutUnit& offset, LayoutUnit& breadth); | 136 void offsetAndBreadthForPositionedChild(const LayoutBox&, GridTrackSizingDir
ection, LayoutUnit& offset, LayoutUnit& breadth); |
| 137 void populateGridPositions(GridSizingData&); | 137 void populateGridPositions(GridSizingData&); |
| 138 | 138 |
| 139 typedef struct GridItemsSpanGroupRange GridItemsSpanGroupRange; | 139 typedef struct GridItemsSpanGroupRange GridItemsSpanGroupRange; |
| 140 LayoutUnit currentItemSizeForTrackSizeComputationPhase(TrackSizeComputationP
hase, LayoutBox&, GridTrackSizingDirection, Vector<GridTrack>& columnTracks); | 140 LayoutUnit currentItemSizeForTrackSizeComputationPhase(TrackSizeComputationP
hase, LayoutBox&, GridTrackSizingDirection, const GridSizingData&); |
| 141 void resolveContentBasedTrackSizingFunctionsForNonSpanningItems(GridTrackSiz
ingDirection, const GridSpan&, LayoutBox& gridItem, GridTrack&, Vector<GridTrack
>& columnTracks); | 141 void resolveContentBasedTrackSizingFunctionsForNonSpanningItems(GridTrackSiz
ingDirection, const GridSpan&, LayoutBox& gridItem, GridTrack&, const GridSizing
Data&); |
| 142 template <TrackSizeComputationPhase> void resolveContentBasedTrackSizingFunc
tionsForItems(GridTrackSizingDirection, GridSizingData&, const GridItemsSpanGrou
pRange&); | 142 template <TrackSizeComputationPhase> void resolveContentBasedTrackSizingFunc
tionsForItems(GridTrackSizingDirection, GridSizingData&, const GridItemsSpanGrou
pRange&); |
| 143 template <TrackSizeComputationPhase> void distributeSpaceToTracks(Vector<Gri
dTrack*>&, const Vector<GridTrack*>* growBeyondGrowthLimitsTracks, GridSizingDat
a&, LayoutUnit& availableLogicalSpace); | 143 template <TrackSizeComputationPhase> void distributeSpaceToTracks(Vector<Gri
dTrack*>&, const Vector<GridTrack*>* growBeyondGrowthLimitsTracks, GridSizingDat
a&, LayoutUnit& availableLogicalSpace); |
| 144 | 144 |
| 145 typedef HashSet<size_t, DefaultHash<size_t>::Hash, WTF::UnsignedWithZeroKeyH
ashTraits<size_t>> TrackIndexSet; | 145 typedef HashSet<size_t, DefaultHash<size_t>::Hash, WTF::UnsignedWithZeroKeyH
ashTraits<size_t>> TrackIndexSet; |
| 146 double computeFlexFactorUnitSize(const Vector<GridTrack>&, GridTrackSizingDi
rection, double flexFactorSum, LayoutUnit& leftOverSpace, const Vector<size_t, 8
>& flexibleTracksIndexes, PassOwnPtr<TrackIndexSet> tracksToTreatAsInflexible =
nullptr) const; | 146 double computeFlexFactorUnitSize(const Vector<GridTrack>&, GridTrackSizingDi
rection, double flexFactorSum, LayoutUnit& leftOverSpace, const Vector<size_t, 8
>& flexibleTracksIndexes, PassOwnPtr<TrackIndexSet> tracksToTreatAsInflexible =
nullptr) const; |
| 147 double findFlexFactorUnitSize(const Vector<GridTrack>&, const GridSpan&, Gri
dTrackSizingDirection, LayoutUnit leftOverSpace) const; | 147 double findFlexFactorUnitSize(const Vector<GridTrack>&, const GridSpan&, Gri
dTrackSizingDirection, LayoutUnit leftOverSpace) const; |
| 148 | 148 |
| 149 GridTrackSize gridTrackSize(GridTrackSizingDirection, size_t) const; | 149 GridTrackSize gridTrackSize(GridTrackSizingDirection, size_t) const; |
| 150 | 150 |
| 151 LayoutUnit logicalHeightForChild(LayoutBox&, Vector<GridTrack>&); | 151 LayoutUnit logicalHeightForChild(LayoutBox&, const GridSizingData&); |
| 152 LayoutUnit minSizeForChild(LayoutBox&, GridTrackSizingDirection, Vector<Grid
Track>& columnTracks); | 152 LayoutUnit minSizeForChild(LayoutBox&, GridTrackSizingDirection, const GridS
izingData&); |
| 153 LayoutUnit minContentForChild(LayoutBox&, GridTrackSizingDirection, Vector<G
ridTrack>& columnTracks); | 153 LayoutUnit minContentForChild(LayoutBox&, GridTrackSizingDirection, const Gr
idSizingData&); |
| 154 LayoutUnit maxContentForChild(LayoutBox&, GridTrackSizingDirection, Vector<G
ridTrack>& columnTracks); | 154 LayoutUnit maxContentForChild(LayoutBox&, GridTrackSizingDirection, const Gr
idSizingData&); |
| 155 GridAxisPosition columnAxisPositionForChild(const LayoutBox&) const; | 155 GridAxisPosition columnAxisPositionForChild(const LayoutBox&) const; |
| 156 GridAxisPosition rowAxisPositionForChild(const LayoutBox&) const; | 156 GridAxisPosition rowAxisPositionForChild(const LayoutBox&) const; |
| 157 LayoutUnit rowAxisOffsetForChild(const LayoutBox&) const; | 157 LayoutUnit rowAxisOffsetForChild(const LayoutBox&) const; |
| 158 LayoutUnit columnAxisOffsetForChild(const LayoutBox&) const; | 158 LayoutUnit columnAxisOffsetForChild(const LayoutBox&) const; |
| 159 ContentAlignmentData computeContentPositionAndDistributionOffset(GridTrackSi
zingDirection, const LayoutUnit& availableFreeSpace, unsigned numberOfGridTracks
) const; | 159 ContentAlignmentData computeContentPositionAndDistributionOffset(GridTrackSi
zingDirection, const LayoutUnit& availableFreeSpace, unsigned numberOfGridTracks
) const; |
| 160 LayoutPoint findChildLogicalPosition(const LayoutBox&, GridSizingData&) cons
t; | 160 LayoutPoint findChildLogicalPosition(const LayoutBox&, GridSizingData&) cons
t; |
| 161 GridCoordinate cachedGridCoordinate(const LayoutBox&) const; | 161 GridCoordinate cachedGridCoordinate(const LayoutBox&) const; |
| 162 GridSpan cachedGridSpan(const LayoutBox&, GridTrackSizingDirection) const; | 162 GridSpan cachedGridSpan(const LayoutBox&, GridTrackSizingDirection) const; |
| 163 | 163 |
| 164 LayoutUnit gridAreaBreadthForChild(const LayoutBox& child, GridTrackSizingDi
rection, const Vector<GridTrack>&) const; | 164 LayoutUnit gridAreaBreadthForChild(const LayoutBox& child, GridTrackSizingDi
rection, const GridSizingData&) const; |
| 165 LayoutUnit gridAreaBreadthForChildIncludingAlignmentOffsets(const LayoutBox&
, GridTrackSizingDirection, const GridSizingData&) const; | 165 LayoutUnit gridAreaBreadthForChildIncludingAlignmentOffsets(const LayoutBox&
, GridTrackSizingDirection, const GridSizingData&) const; |
| 166 LayoutUnit assumedRowsBreadthForOrthogonalChild(const LayoutBox&) const; |
| 166 | 167 |
| 167 void applyStretchAlignmentToTracksIfNeeded(GridTrackSizingDirection, GridSiz
ingData&); | 168 void applyStretchAlignmentToTracksIfNeeded(GridTrackSizingDirection, GridSiz
ingData&); |
| 168 | 169 |
| 169 void paintChildren(const PaintInfo&, const LayoutPoint&) const override; | 170 void paintChildren(const PaintInfo&, const LayoutPoint&) const override; |
| 170 | 171 |
| 171 bool needToStretchChildLogicalHeight(const LayoutBox&) const; | 172 bool needToStretchChildLogicalHeight(const LayoutBox&) const; |
| 172 LayoutUnit childIntrinsicHeight(const LayoutBox&) const; | 173 LayoutUnit childIntrinsicHeight(const LayoutBox&) const; |
| 173 LayoutUnit childIntrinsicWidth(const LayoutBox&) const; | 174 LayoutUnit childIntrinsicWidth(const LayoutBox&) const; |
| 174 LayoutUnit intrinsicLogicalHeightForChild(const LayoutBox&) const; | 175 LayoutUnit intrinsicLogicalHeightForChild(const LayoutBox&) const; |
| 175 LayoutUnit marginLogicalHeightForChild(const LayoutBox&) const; | 176 LayoutUnit marginLogicalHeightForChild(const LayoutBox&) const; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 193 ASSERT(!m_gridIsDirty); | 194 ASSERT(!m_gridIsDirty); |
| 194 return m_grid[0].size(); | 195 return m_grid[0].size(); |
| 195 } | 196 } |
| 196 size_t gridRowCount() const | 197 size_t gridRowCount() const |
| 197 { | 198 { |
| 198 ASSERT(!m_gridIsDirty); | 199 ASSERT(!m_gridIsDirty); |
| 199 return m_grid.size(); | 200 return m_grid.size(); |
| 200 } | 201 } |
| 201 | 202 |
| 202 bool hasDefiniteLogicalSize(GridTrackSizingDirection) const; | 203 bool hasDefiniteLogicalSize(GridTrackSizingDirection) const; |
| 204 bool hasAnyOrthogonalChild() const; |
| 205 bool gridLengthIsIndefinite(const GridLength&, GridTrackSizingDirection) con
st; |
| 206 LayoutUnit overrideContainingBlockBreadthForChild(const LayoutBox&, GridTrac
kSizingDirection); |
| 207 void setOverrideContainingBlockBreadthForChild(LayoutBox&, GridTrackSizingDi
rection, LayoutUnit breadth); |
| 203 | 208 |
| 204 typedef Vector<Vector<GridCell>> GridRepresentation; | 209 typedef Vector<Vector<GridCell>> GridRepresentation; |
| 205 GridRepresentation m_grid; | 210 GridRepresentation m_grid; |
| 206 bool m_gridIsDirty; | 211 bool m_gridIsDirty; |
| 207 Vector<LayoutUnit> m_rowPositions; | 212 Vector<LayoutUnit> m_rowPositions; |
| 208 Vector<LayoutUnit> m_columnPositions; | 213 Vector<LayoutUnit> m_columnPositions; |
| 209 HashMap<const LayoutBox*, GridCoordinate> m_gridItemCoordinate; | 214 HashMap<const LayoutBox*, GridCoordinate> m_gridItemCoordinate; |
| 210 OrderIterator m_orderIterator; | 215 OrderIterator m_orderIterator; |
| 211 Vector<LayoutBox*> m_gridItemsOverflowingGridArea; | 216 Vector<LayoutBox*> m_gridItemsOverflowingGridArea; |
| 212 HashMap<const LayoutBox*, size_t> m_gridItemsIndexesMap; | 217 HashMap<const LayoutBox*, size_t> m_gridItemsIndexesMap; |
| 213 | 218 |
| 214 LayoutUnit m_minContentHeight { -1 }; | 219 LayoutUnit m_minContentHeight { -1 }; |
| 215 LayoutUnit m_maxContentHeight { -1 }; | 220 LayoutUnit m_maxContentHeight { -1 }; |
| 216 }; | 221 }; |
| 217 | 222 |
| 218 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutGrid, isLayoutGrid()); | 223 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutGrid, isLayoutGrid()); |
| 219 | 224 |
| 220 } // namespace blink | 225 } // namespace blink |
| 221 | 226 |
| 222 #endif // LayoutGrid_h | 227 #endif // LayoutGrid_h |
| OLD | NEW |