Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved. |
| 4 Copyright (c) 2012, Google Inc. All rights reserved. | 4 Copyright (c) 2012, Google Inc. All rights reserved. |
| 5 | 5 |
| 6 This library is free software; you can redistribute it and/or | 6 This library is free software; you can redistribute it and/or |
| 7 modify it under the terms of the GNU Library General Public | 7 modify it under the terms of the GNU Library General Public |
| 8 License as published by the Free Software Foundation; either | 8 License as published by the Free Software Foundation; either |
| 9 version 2 of the License, or (at your option) any later version. | 9 version 2 of the License, or (at your option) any later version. |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 61 const Length& logicalLeft(WritingMode) const; | 61 const Length& logicalLeft(WritingMode) const; |
| 62 const Length& logicalRight(WritingMode) const; | 62 const Length& logicalRight(WritingMode) const; |
| 63 | 63 |
| 64 const Length& before(WritingMode) const; | 64 const Length& before(WritingMode) const; |
| 65 const Length& after(WritingMode) const; | 65 const Length& after(WritingMode) const; |
| 66 const Length& start(WritingMode, TextDirection) const; | 66 const Length& start(WritingMode, TextDirection) const; |
| 67 const Length& end(WritingMode, TextDirection) const; | 67 const Length& end(WritingMode, TextDirection) const; |
| 68 const Length& over(WritingMode) const; | 68 const Length& over(WritingMode) const; |
| 69 const Length& under(WritingMode) const; | 69 const Length& under(WritingMode) const; |
| 70 | 70 |
| 71 // For use in ComputedStyle.h | |
| 72 // TODO(shend): these are independent of LengthBox, make them nonmember | |
|
nainar
2017/02/21 02:28:37
could that be done in this patch? Having these fun
| |
| 73 // functions. | |
| 74 static const Length& logicalLeft(WritingMode, | |
| 75 const Length& left, | |
| 76 const Length& top); | |
| 77 static const Length& logicalRight(WritingMode, | |
| 78 const Length& right, | |
| 79 const Length& bottom); | |
| 80 static const Length& before(WritingMode, | |
| 81 const Length& top, | |
| 82 const Length& left, | |
| 83 const Length& right); | |
| 84 static const Length& after(WritingMode, | |
| 85 const Length& bottom, | |
| 86 const Length& left, | |
| 87 const Length& right); | |
| 88 | |
| 71 bool operator==(const LengthBox& o) const { | 89 bool operator==(const LengthBox& o) const { |
| 72 return m_left == o.m_left && m_right == o.m_right && m_top == o.m_top && | 90 return m_left == o.m_left && m_right == o.m_right && m_top == o.m_top && |
| 73 m_bottom == o.m_bottom; | 91 m_bottom == o.m_bottom; |
| 74 } | 92 } |
| 75 | 93 |
| 76 bool operator!=(const LengthBox& o) const { return !(*this == o); } | 94 bool operator!=(const LengthBox& o) const { return !(*this == o); } |
| 77 | 95 |
| 78 bool nonZero() const { | 96 bool nonZero() const { |
| 79 return !(m_left.isZero() && m_right.isZero() && m_top.isZero() && | 97 return !(m_left.isZero() && m_right.isZero() && m_top.isZero() && |
| 80 m_bottom.isZero()); | 98 m_bottom.isZero()); |
| 81 } | 99 } |
| 82 | 100 |
| 83 // Must be public for SET_VAR in ComputedStyle.h | 101 // Must be public for SET_VAR in ComputedStyle.h |
| 84 Length m_left; | 102 Length m_left; |
| 85 Length m_right; | 103 Length m_right; |
| 86 Length m_top; | 104 Length m_top; |
| 87 Length m_bottom; | 105 Length m_bottom; |
| 88 }; | 106 }; |
| 89 | 107 |
| 90 } // namespace blink | 108 } // namespace blink |
| 91 | 109 |
| 92 #endif // LengthBox_h | 110 #endif // LengthBox_h |
| OLD | NEW |