| 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 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "platform/LengthBox.h" | 32 #include "platform/LengthBox.h" |
| 33 | 33 |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 const Length& LengthBox::logicalLeft() const | 36 const Length& LengthBox::logicalLeft() const |
| 37 { | 37 { |
| 38 return isHorizontalWritingMode() ? m_left : m_top; | 38 return m_left; |
| 39 } | 39 } |
| 40 | 40 |
| 41 const Length& LengthBox::logicalRight() const | 41 const Length& LengthBox::logicalRight() const |
| 42 { | 42 { |
| 43 return isHorizontalWritingMode() ? m_right : m_bottom; | 43 return m_right; |
| 44 } | 44 } |
| 45 | 45 |
| 46 const Length& LengthBox::before() const | 46 const Length& LengthBox::before() const |
| 47 { | 47 { |
| 48 // FIXME(sky): Remove | 48 // FIXME(sky): Remove |
| 49 return m_top; | 49 return m_top; |
| 50 } | 50 } |
| 51 | 51 |
| 52 const Length& LengthBox::after() const | 52 const Length& LengthBox::after() const |
| 53 { | 53 { |
| 54 // FIXME(sky): Remove | 54 // FIXME(sky): Remove |
| 55 return m_bottom; | 55 return m_bottom; |
| 56 } | 56 } |
| 57 | 57 |
| 58 const Length& LengthBox::start(TextDirection direction) const | 58 const Length& LengthBox::start(TextDirection direction) const |
| 59 { | 59 { |
| 60 if (isHorizontalWritingMode()) | 60 return isLeftToRightDirection(direction) ? m_left : m_right; |
| 61 return isLeftToRightDirection(direction) ? m_left : m_right; | |
| 62 return isLeftToRightDirection(direction) ? m_top : m_bottom; | |
| 63 } | 61 } |
| 64 | 62 |
| 65 const Length& LengthBox::end(TextDirection direction) const | 63 const Length& LengthBox::end(TextDirection direction) const |
| 66 { | 64 { |
| 67 if (isHorizontalWritingMode()) | 65 return isLeftToRightDirection(direction) ? m_right : m_left; |
| 68 return isLeftToRightDirection(direction) ? m_right : m_left; | |
| 69 return isLeftToRightDirection(direction) ? m_bottom : m_top; | |
| 70 } | 66 } |
| 71 | 67 |
| 72 } // namespace blink | 68 } // namespace blink |
| OLD | NEW |