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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 bool fixed = renderer.isOutOfFlowPositioned() && renderer.style()->position(
) == FixedPosition; | 59 bool fixed = renderer.isOutOfFlowPositioned() && renderer.style()->position(
) == FixedPosition; |
60 if (fixed) { | 60 if (fixed) { |
61 // FIXME: This doesn't work correctly with transforms. | 61 // FIXME: This doesn't work correctly with transforms. |
62 FloatPoint fixedOffset = renderer.view()->localToAbsolute(FloatPoint(),
IsFixed); | 62 FloatPoint fixedOffset = renderer.view()->localToAbsolute(FloatPoint(),
IsFixed); |
63 m_layoutOffset = LayoutSize(fixedOffset.x(), fixedOffset.y()) + offset; | 63 m_layoutOffset = LayoutSize(fixedOffset.x(), fixedOffset.y()) + offset; |
64 } else { | 64 } else { |
65 m_layoutOffset = m_next->m_layoutOffset + offset; | 65 m_layoutOffset = m_next->m_layoutOffset + offset; |
66 } | 66 } |
67 | 67 |
68 if (renderer.isOutOfFlowPositioned() && !fixed) { | 68 if (renderer.isOutOfFlowPositioned() && !fixed) { |
69 if (RenderObject* container = renderer.container()) { | 69 if (LayoutObject* container = renderer.container()) { |
70 if (container->style()->hasInFlowPosition() && container->isRenderIn
line()) | 70 if (container->style()->hasInFlowPosition() && container->isRenderIn
line()) |
71 m_layoutOffset += toRenderInline(container)->offsetForInFlowPosi
tionedInline(renderer); | 71 m_layoutOffset += toRenderInline(container)->offsetForInFlowPosi
tionedInline(renderer); |
72 } | 72 } |
73 } | 73 } |
74 // If we establish a new page height, then cache the offset to the top of th
e first page. | 74 // If we establish a new page height, then cache the offset to the top of th
e first page. |
75 // We can compare this later on to figure out what part of the page we're ac
tually on, | 75 // We can compare this later on to figure out what part of the page we're ac
tually on, |
76 if (pageLogicalHeight || m_columnInfo || renderer.isRenderFlowThread()) { | 76 if (pageLogicalHeight || m_columnInfo || renderer.isRenderFlowThread()) { |
77 m_pageLogicalHeight = pageLogicalHeight; | 77 m_pageLogicalHeight = pageLogicalHeight; |
78 bool isFlipped = renderer.style()->isFlippedBlocksWritingMode(); | 78 bool isFlipped = renderer.style()->isFlippedBlocksWritingMode(); |
79 m_pageOffset = LayoutSize(m_layoutOffset.width() + (!isFlipped ? rendere
r.borderLeft() + renderer.paddingLeft() : renderer.borderRight() + renderer.padd
ingRight()), | 79 m_pageOffset = LayoutSize(m_layoutOffset.width() + (!isFlipped ? rendere
r.borderLeft() + renderer.paddingLeft() : renderer.borderRight() + renderer.padd
ingRight()), |
(...skipping 15 matching lines...) Expand all Loading... |
95 m_isPaginated = m_pageLogicalHeight || m_next->m_columnInfo || rende
rer.flowThreadContainingBlock(); | 95 m_isPaginated = m_pageLogicalHeight || m_next->m_columnInfo || rende
rer.flowThreadContainingBlock(); |
96 } | 96 } |
97 } | 97 } |
98 | 98 |
99 if (!m_columnInfo) | 99 if (!m_columnInfo) |
100 m_columnInfo = m_next->m_columnInfo; | 100 m_columnInfo = m_next->m_columnInfo; |
101 | 101 |
102 // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip
if present. | 102 // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip
if present. |
103 } | 103 } |
104 | 104 |
105 LayoutState::LayoutState(RenderObject& root) | 105 LayoutState::LayoutState(LayoutObject& root) |
106 : m_isPaginated(false) | 106 : m_isPaginated(false) |
107 , m_pageLogicalHeightChanged(false) | 107 , m_pageLogicalHeightChanged(false) |
108 , m_containingBlockLogicalWidthChanged(false) | 108 , m_containingBlockLogicalWidthChanged(false) |
109 , m_flowThread(0) | 109 , m_flowThread(0) |
110 , m_columnInfo(0) | 110 , m_columnInfo(0) |
111 , m_next(root.view()->layoutState()) | 111 , m_next(root.view()->layoutState()) |
112 , m_pageLogicalHeight(0) | 112 , m_pageLogicalHeight(0) |
113 , m_renderer(root) | 113 , m_renderer(root) |
114 { | 114 { |
115 ASSERT(!m_next); | 115 ASSERT(!m_next); |
116 // We'll end up pushing in RenderView itself, so don't bother adding it. | 116 // We'll end up pushing in RenderView itself, so don't bother adding it. |
117 if (root.isRenderView()) | 117 if (root.isRenderView()) |
118 return; | 118 return; |
119 | 119 |
120 root.view()->pushLayoutState(*this); | 120 root.view()->pushLayoutState(*this); |
121 | 121 |
122 RenderObject* container = root.container(); | 122 LayoutObject* container = root.container(); |
123 FloatPoint absContentPoint = container->localToAbsolute(FloatPoint(), UseTra
nsforms); | 123 FloatPoint absContentPoint = container->localToAbsolute(FloatPoint(), UseTra
nsforms); |
124 m_layoutOffset = LayoutSize(absContentPoint.x(), absContentPoint.y()); | 124 m_layoutOffset = LayoutSize(absContentPoint.x(), absContentPoint.y()); |
125 } | 125 } |
126 | 126 |
127 LayoutState::~LayoutState() | 127 LayoutState::~LayoutState() |
128 { | 128 { |
129 if (m_renderer.view()->layoutState()) { | 129 if (m_renderer.view()->layoutState()) { |
130 ASSERT(m_renderer.view()->layoutState() == this); | 130 ASSERT(m_renderer.view()->layoutState() == this); |
131 m_renderer.view()->popLayoutState(); | 131 m_renderer.view()->popLayoutState(); |
132 } | 132 } |
(...skipping 14 matching lines...) Expand all Loading... |
147 } | 147 } |
148 | 148 |
149 void LayoutState::addForcedColumnBreak(const RenderBox& child, const LayoutUnit&
childLogicalOffset) | 149 void LayoutState::addForcedColumnBreak(const RenderBox& child, const LayoutUnit&
childLogicalOffset) |
150 { | 150 { |
151 if (!m_columnInfo || m_columnInfo->columnHeight()) | 151 if (!m_columnInfo || m_columnInfo->columnHeight()) |
152 return; | 152 return; |
153 m_columnInfo->addForcedBreak(pageLogicalOffset(child, childLogicalOffset)); | 153 m_columnInfo->addForcedBreak(pageLogicalOffset(child, childLogicalOffset)); |
154 } | 154 } |
155 | 155 |
156 } // namespace blink | 156 } // namespace blink |
OLD | NEW |