| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 m_flowThread(nullptr), | 106 m_flowThread(nullptr), |
| 107 m_next(root.view()->layoutState()), | 107 m_next(root.view()->layoutState()), |
| 108 m_layoutObject(root) { | 108 m_layoutObject(root) { |
| 109 DCHECK(!m_next); | 109 DCHECK(!m_next); |
| 110 DCHECK(!root.isLayoutView()); | 110 DCHECK(!root.isLayoutView()); |
| 111 root.view()->pushLayoutState(*this); | 111 root.view()->pushLayoutState(*this); |
| 112 } | 112 } |
| 113 | 113 |
| 114 LayoutState::~LayoutState() { | 114 LayoutState::~LayoutState() { |
| 115 if (m_layoutObject.view()->layoutState()) { | 115 if (m_layoutObject.view()->layoutState()) { |
| 116 DCHECK(m_layoutObject.view()->layoutState() == this); | 116 DCHECK_EQ(m_layoutObject.view()->layoutState(), this); |
| 117 m_layoutObject.view()->popLayoutState(); | 117 m_layoutObject.view()->popLayoutState(); |
| 118 } | 118 } |
| 119 } | 119 } |
| 120 | 120 |
| 121 LayoutUnit LayoutState::pageLogicalOffset( | 121 LayoutUnit LayoutState::pageLogicalOffset( |
| 122 const LayoutBox& child, | 122 const LayoutBox& child, |
| 123 const LayoutUnit& childLogicalOffset) const { | 123 const LayoutUnit& childLogicalOffset) const { |
| 124 if (child.isHorizontalWritingMode()) | 124 if (child.isHorizontalWritingMode()) |
| 125 return m_paginationOffset.height() + childLogicalOffset; | 125 return m_paginationOffset.height() + childLogicalOffset; |
| 126 return m_paginationOffset.width() + childLogicalOffset; | 126 return m_paginationOffset.width() + childLogicalOffset; |
| 127 } | 127 } |
| 128 | 128 |
| 129 } // namespace blink | 129 } // namespace blink |
| OLD | NEW |