| 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 27 matching lines...) Expand all Loading... |
| 38 return isHorizontalWritingMode(writingMode) ? m_left : m_top; | 38 return isHorizontalWritingMode(writingMode) ? m_left : m_top; |
| 39 } | 39 } |
| 40 | 40 |
| 41 const Length& LengthBox::logicalRight(WritingMode writingMode) const | 41 const Length& LengthBox::logicalRight(WritingMode writingMode) const |
| 42 { | 42 { |
| 43 return isHorizontalWritingMode(writingMode) ? m_right : m_bottom; | 43 return isHorizontalWritingMode(writingMode) ? m_right : m_bottom; |
| 44 } | 44 } |
| 45 | 45 |
| 46 const Length& LengthBox::before(WritingMode writingMode) const | 46 const Length& LengthBox::before(WritingMode writingMode) const |
| 47 { | 47 { |
| 48 switch (writingMode) { | 48 // FIXME(sky): Remove |
| 49 case TopToBottomWritingMode: | |
| 50 return m_top; | |
| 51 case BottomToTopWritingMode: | |
| 52 return m_bottom; | |
| 53 case LeftToRightWritingMode: | |
| 54 return m_left; | |
| 55 case RightToLeftWritingMode: | |
| 56 return m_right; | |
| 57 } | |
| 58 ASSERT_NOT_REACHED(); | |
| 59 return m_top; | 49 return m_top; |
| 60 } | 50 } |
| 61 | 51 |
| 62 const Length& LengthBox::after(WritingMode writingMode) const | 52 const Length& LengthBox::after(WritingMode writingMode) const |
| 63 { | 53 { |
| 64 switch (writingMode) { | 54 // FIXME(sky): Remove |
| 65 case TopToBottomWritingMode: | |
| 66 return m_bottom; | |
| 67 case BottomToTopWritingMode: | |
| 68 return m_top; | |
| 69 case LeftToRightWritingMode: | |
| 70 return m_right; | |
| 71 case RightToLeftWritingMode: | |
| 72 return m_left; | |
| 73 } | |
| 74 ASSERT_NOT_REACHED(); | |
| 75 return m_bottom; | 55 return m_bottom; |
| 76 } | 56 } |
| 77 | 57 |
| 78 const Length& LengthBox::start(WritingMode writingMode, TextDirection direction)
const | 58 const Length& LengthBox::start(WritingMode writingMode, TextDirection direction)
const |
| 79 { | 59 { |
| 80 if (isHorizontalWritingMode(writingMode)) | 60 if (isHorizontalWritingMode(writingMode)) |
| 81 return isLeftToRightDirection(direction) ? m_left : m_right; | 61 return isLeftToRightDirection(direction) ? m_left : m_right; |
| 82 return isLeftToRightDirection(direction) ? m_top : m_bottom; | 62 return isLeftToRightDirection(direction) ? m_top : m_bottom; |
| 83 } | 63 } |
| 84 | 64 |
| 85 const Length& LengthBox::end(WritingMode writingMode, TextDirection direction) c
onst | 65 const Length& LengthBox::end(WritingMode writingMode, TextDirection direction) c
onst |
| 86 { | 66 { |
| 87 if (isHorizontalWritingMode(writingMode)) | 67 if (isHorizontalWritingMode(writingMode)) |
| 88 return isLeftToRightDirection(direction) ? m_right : m_left; | 68 return isLeftToRightDirection(direction) ? m_right : m_left; |
| 89 return isLeftToRightDirection(direction) ? m_bottom : m_top; | 69 return isLeftToRightDirection(direction) ? m_bottom : m_top; |
| 90 } | 70 } |
| 91 | 71 |
| 92 } // namespace blink | 72 } // namespace blink |
| OLD | NEW |