OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 void setMinMax(const GridLength& minTrackBreadth, const GridLength& maxTrack
Breadth) | 88 void setMinMax(const GridLength& minTrackBreadth, const GridLength& maxTrack
Breadth) |
89 { | 89 { |
90 m_type = MinMaxTrackSizing; | 90 m_type = MinMaxTrackSizing; |
91 m_minTrackBreadth = minTrackBreadth; | 91 m_minTrackBreadth = minTrackBreadth; |
92 m_maxTrackBreadth = maxTrackBreadth; | 92 m_maxTrackBreadth = maxTrackBreadth; |
93 } | 93 } |
94 | 94 |
95 GridTrackSizeType type() const { return m_type; } | 95 GridTrackSizeType type() const { return m_type; } |
96 | 96 |
| 97 bool isContentSized() const { return m_minTrackBreadth.isContentSized() || m
_maxTrackBreadth.isContentSized(); } |
| 98 |
97 bool operator==(const GridTrackSize& other) const | 99 bool operator==(const GridTrackSize& other) const |
98 { | 100 { |
99 return m_type == other.m_type && m_minTrackBreadth == other.m_minTrackBr
eadth && m_maxTrackBreadth == other.m_maxTrackBreadth; | 101 return m_type == other.m_type && m_minTrackBreadth == other.m_minTrackBr
eadth && m_maxTrackBreadth == other.m_maxTrackBreadth; |
100 } | 102 } |
101 | 103 |
102 bool hasMinOrMaxContentMinTrackBreadth() const { return minTrackBreadth().is
Length() && (minTrackBreadth().length().isMinContent() || minTrackBreadth().leng
th().isMaxContent()); } | 104 bool hasMinOrMaxContentMinTrackBreadth() const { return minTrackBreadth().is
Length() && (minTrackBreadth().length().isMinContent() || minTrackBreadth().leng
th().isMaxContent()); } |
103 bool hasMaxContentMinTrackBreadth() const { return minTrackBreadth().isLengt
h() && minTrackBreadth().length().isMaxContent(); } | 105 bool hasMaxContentMinTrackBreadth() const { return minTrackBreadth().isLengt
h() && minTrackBreadth().length().isMaxContent(); } |
104 bool hasMinOrMaxContentMaxTrackBreadth() const { return maxTrackBreadth().is
Length() && (maxTrackBreadth().length().isMinContent() || maxTrackBreadth().leng
th().isMaxContent()); } | 106 bool hasMinOrMaxContentMaxTrackBreadth() const { return maxTrackBreadth().is
Length() && (maxTrackBreadth().length().isMinContent() || maxTrackBreadth().leng
th().isMaxContent()); } |
105 bool hasMaxContentMaxTrackBreadth() const { return maxTrackBreadth().isLengt
h() && maxTrackBreadth().length().isMaxContent(); } | 107 bool hasMaxContentMaxTrackBreadth() const { return maxTrackBreadth().isLengt
h() && maxTrackBreadth().length().isMaxContent(); } |
106 | 108 |
107 private: | 109 private: |
108 GridTrackSizeType m_type; | 110 GridTrackSizeType m_type; |
109 GridLength m_minTrackBreadth; | 111 GridLength m_minTrackBreadth; |
110 GridLength m_maxTrackBreadth; | 112 GridLength m_maxTrackBreadth; |
111 }; | 113 }; |
112 | 114 |
113 } // namespace WebCore | 115 } // namespace WebCore |
114 | 116 |
115 #endif // GridTrackSize_h | 117 #endif // GridTrackSize_h |
OLD | NEW |