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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 ContentAlignmentData(){}; | 46 ContentAlignmentData(){}; |
47 ContentAlignmentData(LayoutUnit position, LayoutUnit distribution) | 47 ContentAlignmentData(LayoutUnit position, LayoutUnit distribution) |
48 : positionOffset(position), distributionOffset(distribution) {} | 48 : positionOffset(position), distributionOffset(distribution) {} |
49 | 49 |
50 bool isValid() { return positionOffset >= 0 && distributionOffset >= 0; } | 50 bool isValid() { return positionOffset >= 0 && distributionOffset >= 0; } |
51 | 51 |
52 LayoutUnit positionOffset = LayoutUnit(-1); | 52 LayoutUnit positionOffset = LayoutUnit(-1); |
53 LayoutUnit distributionOffset = LayoutUnit(-1); | 53 LayoutUnit distributionOffset = LayoutUnit(-1); |
54 }; | 54 }; |
55 | 55 |
56 enum TrackSizeRestriction { | |
57 AllowInfinity, | |
58 ForbidInfinity, | |
59 }; | |
60 | |
61 LayoutGrid::LayoutGrid(Element* element) | 56 LayoutGrid::LayoutGrid(Element* element) |
62 : LayoutBlock(element), m_grid(this), m_trackSizingAlgorithm(this, m_grid) { | 57 : LayoutBlock(element), m_grid(this), m_trackSizingAlgorithm(this, m_grid) { |
63 ASSERT(!childrenInline()); | 58 ASSERT(!childrenInline()); |
64 if (!isAnonymous()) | 59 if (!isAnonymous()) |
65 UseCounter::count(document(), UseCounter::CSSGridLayout); | 60 UseCounter::count(document(), UseCounter::CSSGridLayout); |
66 } | 61 } |
67 | 62 |
68 LayoutGrid::~LayoutGrid() {} | 63 LayoutGrid::~LayoutGrid() {} |
69 | 64 |
70 LayoutGrid* LayoutGrid::createAnonymous(Document* document) { | 65 LayoutGrid* LayoutGrid::createAnonymous(Document* document) { |
(...skipping 2020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2091 if (direction == ForRows) | 2086 if (direction == ForRows) |
2092 return grid.numTracks(ForRows); | 2087 return grid.numTracks(ForRows); |
2093 | 2088 |
2094 return grid.numTracks(ForRows) | 2089 return grid.numTracks(ForRows) |
2095 ? grid.numTracks(ForColumns) | 2090 ? grid.numTracks(ForColumns) |
2096 : GridPositionsResolver::explicitGridColumnCount( | 2091 : GridPositionsResolver::explicitGridColumnCount( |
2097 styleRef(), grid.autoRepeatTracks(ForColumns)); | 2092 styleRef(), grid.autoRepeatTracks(ForColumns)); |
2098 } | 2093 } |
2099 | 2094 |
2100 } // namespace blink | 2095 } // namespace blink |
OLD | NEW |