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 29 matching lines...) Expand all Loading... |
40 m_paginationStateChanged(false), | 40 m_paginationStateChanged(false), |
41 m_flowThread(nullptr), | 41 m_flowThread(nullptr), |
42 m_next(nullptr), | 42 m_next(nullptr), |
43 m_pageLogicalHeight(pageLogicalHeight), | 43 m_pageLogicalHeight(pageLogicalHeight), |
44 m_layoutObject(view) { | 44 m_layoutObject(view) { |
45 ASSERT(!view.layoutState()); | 45 ASSERT(!view.layoutState()); |
46 view.pushLayoutState(*this); | 46 view.pushLayoutState(*this); |
47 } | 47 } |
48 | 48 |
49 LayoutState::LayoutState(LayoutBox& layoutObject, | 49 LayoutState::LayoutState(LayoutBox& layoutObject, |
50 const LayoutSize& offset, | |
51 LayoutUnit pageLogicalHeight, | 50 LayoutUnit pageLogicalHeight, |
52 bool pageLogicalHeightChanged, | 51 bool pageLogicalHeightChanged, |
53 bool containingBlockLogicalWidthChanged) | 52 bool containingBlockLogicalWidthChanged) |
54 : m_containingBlockLogicalWidthChanged(containingBlockLogicalWidthChanged), | 53 : m_containingBlockLogicalWidthChanged(containingBlockLogicalWidthChanged), |
55 m_next(layoutObject.view()->layoutState()), | 54 m_next(layoutObject.view()->layoutState()), |
56 m_layoutObject(layoutObject) { | 55 m_layoutObject(layoutObject) { |
57 if (layoutObject.isLayoutFlowThread()) | 56 if (layoutObject.isLayoutFlowThread()) |
58 m_flowThread = toLayoutFlowThread(&layoutObject); | 57 m_flowThread = toLayoutFlowThread(&layoutObject); |
59 else if (!layoutObject.isOutOfFlowPositioned()) | 58 else if (!layoutObject.isOutOfFlowPositioned()) |
60 m_flowThread = m_next->flowThread(); | 59 m_flowThread = m_next->flowThread(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 if (!m_isPaginated) | 92 if (!m_isPaginated) |
94 return; | 93 return; |
95 | 94 |
96 // Now adjust the pagination offset, so that we can easily figure out how far | 95 // Now adjust the pagination offset, so that we can easily figure out how far |
97 // away we are from the start of the pagination context. | 96 // away we are from the start of the pagination context. |
98 m_paginationOffset = m_next->m_paginationOffset; | 97 m_paginationOffset = m_next->m_paginationOffset; |
99 bool fixed = layoutObject.isOutOfFlowPositioned() && | 98 bool fixed = layoutObject.isOutOfFlowPositioned() && |
100 layoutObject.style()->position() == FixedPosition; | 99 layoutObject.style()->position() == FixedPosition; |
101 if (fixed) | 100 if (fixed) |
102 return; | 101 return; |
103 m_paginationOffset = m_next->m_paginationOffset + offset; | 102 m_paginationOffset = |
| 103 m_next->m_paginationOffset + layoutObject.locationOffset(); |
104 if (!layoutObject.isOutOfFlowPositioned()) | 104 if (!layoutObject.isOutOfFlowPositioned()) |
105 return; | 105 return; |
106 if (LayoutObject* container = layoutObject.container()) { | 106 if (LayoutObject* container = layoutObject.container()) { |
107 if (container->style()->hasInFlowPosition() && | 107 if (container->style()->hasInFlowPosition() && |
108 container->isLayoutInline()) { | 108 container->isLayoutInline()) { |
109 m_paginationOffset += | 109 m_paginationOffset += |
110 toLayoutInline(container)->offsetForInFlowPositionedInline( | 110 toLayoutInline(container)->offsetForInFlowPositionedInline( |
111 layoutObject); | 111 layoutObject); |
112 } | 112 } |
113 } | 113 } |
(...skipping 27 matching lines...) Expand all Loading... |
141 | 141 |
142 LayoutUnit LayoutState::pageLogicalOffset( | 142 LayoutUnit LayoutState::pageLogicalOffset( |
143 const LayoutBox& child, | 143 const LayoutBox& child, |
144 const LayoutUnit& childLogicalOffset) const { | 144 const LayoutUnit& childLogicalOffset) const { |
145 if (child.isHorizontalWritingMode()) | 145 if (child.isHorizontalWritingMode()) |
146 return m_paginationOffset.height() + childLogicalOffset; | 146 return m_paginationOffset.height() + childLogicalOffset; |
147 return m_paginationOffset.width() + childLogicalOffset; | 147 return m_paginationOffset.width() + childLogicalOffset; |
148 } | 148 } |
149 | 149 |
150 } // namespace blink | 150 } // namespace blink |
OLD | NEW |