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

Side by Side Diff: Source/core/layout/style/GridResolvedPosition.h

Issue 1033943002: Rename LayoutStyle to papayawhip (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ensureComputedStyle 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/style/FillLayer.h ('k') | Source/core/layout/style/GridResolvedPosition.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef GridResolvedPosition_h 5 #ifndef GridResolvedPosition_h
6 #define GridResolvedPosition_h 6 #define GridResolvedPosition_h
7 7
8 #include "core/layout/style/GridPosition.h" 8 #include "core/layout/style/GridPosition.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 struct GridSpan; 12 struct GridSpan;
13 class LayoutBox; 13 class LayoutBox;
14 class LayoutStyle; 14 class ComputedStyle;
15 15
16 enum GridPositionSide { 16 enum GridPositionSide {
17 ColumnStartSide, 17 ColumnStartSide,
18 ColumnEndSide, 18 ColumnEndSide,
19 RowStartSide, 19 RowStartSide,
20 RowEndSide 20 RowEndSide
21 }; 21 };
22 22
23 enum GridTrackSizingDirection { 23 enum GridTrackSizingDirection {
24 ForColumns, 24 ForColumns,
(...skipping 11 matching lines...) Expand all
36 36
37 static GridResolvedPosition adjustGridPositionForSide(size_t resolvedPositio n, GridPositionSide side) 37 static GridResolvedPosition adjustGridPositionForSide(size_t resolvedPositio n, GridPositionSide side)
38 { 38 {
39 // An item finishing on the N-th line belongs to the N-1-th cell. 39 // An item finishing on the N-th line belongs to the N-1-th cell.
40 if (side == ColumnEndSide || side == RowEndSide) 40 if (side == ColumnEndSide || side == RowEndSide)
41 return adjustGridPositionForAfterEndSide(resolvedPosition); 41 return adjustGridPositionForAfterEndSide(resolvedPosition);
42 42
43 return GridResolvedPosition(resolvedPosition); 43 return GridResolvedPosition(resolvedPosition);
44 } 44 }
45 45
46 static void initialAndFinalPositionsFromStyle(const LayoutStyle&, const Layo utBox&, GridTrackSizingDirection, GridPosition &initialPosition, GridPosition &f inalPosition); 46 static void initialAndFinalPositionsFromStyle(const ComputedStyle&, const La youtBox&, GridTrackSizingDirection, GridPosition &initialPosition, GridPosition &finalPosition);
47 static GridSpan resolveGridPositionsFromAutoPlacementPosition(const LayoutSt yle&, const LayoutBox&, GridTrackSizingDirection, const GridResolvedPosition&); 47 static GridSpan resolveGridPositionsFromAutoPlacementPosition(const Computed Style&, const LayoutBox&, GridTrackSizingDirection, const GridResolvedPosition&) ;
48 static PassOwnPtr<GridSpan> resolveGridPositionsFromStyle(const LayoutStyle& , const LayoutBox&, GridTrackSizingDirection); 48 static PassOwnPtr<GridSpan> resolveGridPositionsFromStyle(const ComputedStyl e&, const LayoutBox&, GridTrackSizingDirection);
49 static GridResolvedPosition resolveNamedGridLinePositionFromStyle(const Layo utStyle&, const GridPosition&, GridPositionSide); 49 static GridResolvedPosition resolveNamedGridLinePositionFromStyle(const Comp utedStyle&, const GridPosition&, GridPositionSide);
50 static GridResolvedPosition resolveGridPositionFromStyle(const LayoutStyle&, const GridPosition&, GridPositionSide); 50 static GridResolvedPosition resolveGridPositionFromStyle(const ComputedStyle &, const GridPosition&, GridPositionSide);
51 static PassOwnPtr<GridSpan> resolveGridPositionAgainstOppositePosition(const LayoutStyle&, const GridResolvedPosition& resolvedOppositePosition, const GridP osition&, GridPositionSide); 51 static PassOwnPtr<GridSpan> resolveGridPositionAgainstOppositePosition(const ComputedStyle&, const GridResolvedPosition& resolvedOppositePosition, const Gri dPosition&, GridPositionSide);
52 static PassOwnPtr<GridSpan> resolveNamedGridLinePositionAgainstOppositePosit ion(const LayoutStyle&, const GridResolvedPosition& resolvedOppositePosition, co nst GridPosition&, GridPositionSide); 52 static PassOwnPtr<GridSpan> resolveNamedGridLinePositionAgainstOppositePosit ion(const ComputedStyle&, const GridResolvedPosition& resolvedOppositePosition, const GridPosition&, GridPositionSide);
53 53
54 GridResolvedPosition(size_t position) 54 GridResolvedPosition(size_t position)
55 : m_integerPosition(position) 55 : m_integerPosition(position)
56 { 56 {
57 } 57 }
58 58
59 GridResolvedPosition(const GridPosition& position, GridPositionSide side) 59 GridResolvedPosition(const GridPosition& position, GridPositionSide side)
60 { 60 {
61 ASSERT(position.integerPosition()); 61 ASSERT(position.integerPosition());
62 size_t integerPosition = position.integerPosition() - 1; 62 size_t integerPosition = position.integerPosition() - 1;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 size_t toInt() const 108 size_t toInt() const
109 { 109 {
110 return m_integerPosition; 110 return m_integerPosition;
111 } 111 }
112 112
113 GridResolvedPosition next() const 113 GridResolvedPosition next() const
114 { 114 {
115 return GridResolvedPosition(m_integerPosition + 1); 115 return GridResolvedPosition(m_integerPosition + 1);
116 } 116 }
117 117
118 static size_t explicitGridColumnCount(const LayoutStyle&); 118 static size_t explicitGridColumnCount(const ComputedStyle&);
119 static size_t explicitGridRowCount(const LayoutStyle&); 119 static size_t explicitGridRowCount(const ComputedStyle&);
120 120
121 private: 121 private:
122 122
123 static size_t explicitGridSizeForSide(const LayoutStyle&, GridPositionSide); 123 static size_t explicitGridSizeForSide(const ComputedStyle&, GridPositionSide );
124 124
125 size_t m_integerPosition; 125 size_t m_integerPosition;
126 }; 126 };
127 127
128 } // namespace blink 128 } // namespace blink
129 129
130 #endif // GridResolvedPosition_h 130 #endif // GridResolvedPosition_h
OLDNEW
« no previous file with comments | « Source/core/layout/style/FillLayer.h ('k') | Source/core/layout/style/GridResolvedPosition.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698