| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 bool operator==(const GridLength& o) const { | 69 bool operator==(const GridLength& o) const { |
| 70 return m_length == o.m_length && m_flex == o.m_flex && m_type == o.m_type; | 70 return m_length == o.m_length && m_flex == o.m_flex && m_type == o.m_type; |
| 71 } | 71 } |
| 72 | 72 |
| 73 bool isContentSized() const { | 73 bool isContentSized() const { |
| 74 return m_type == LengthType && | 74 return m_type == LengthType && |
| 75 (m_length.isAuto() || m_length.isMinContent() || | 75 (m_length.isAuto() || m_length.isMinContent() || |
| 76 m_length.isMaxContent()); | 76 m_length.isMaxContent()); |
| 77 } | 77 } |
| 78 | 78 |
| 79 bool isAuto() const { return m_type == LengthType && m_length.isAuto(); } |
| 80 |
| 79 private: | 81 private: |
| 80 // Ideally we would put the 2 following fields in a union, but Length has a | 82 // Ideally we would put the 2 following fields in a union, but Length has a |
| 81 // constructor, a destructor and a copy assignment which isn't allowed. | 83 // constructor, a destructor and a copy assignment which isn't allowed. |
| 82 Length m_length; | 84 Length m_length; |
| 83 double m_flex; | 85 double m_flex; |
| 84 enum GridLengthType { LengthType, FlexType }; | 86 enum GridLengthType { LengthType, FlexType }; |
| 85 GridLengthType m_type; | 87 GridLengthType m_type; |
| 86 }; | 88 }; |
| 87 | 89 |
| 88 } // namespace blink | 90 } // namespace blink |
| 89 | 91 |
| 90 #endif // GridLength_h | 92 #endif // GridLength_h |
| OLD | NEW |