OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 ASSERT(!m_layoutStateDisableCount); | 183 ASSERT(!m_layoutStateDisableCount); |
184 ASSERT(!m_layoutState->next()); | 184 ASSERT(!m_layoutState->next()); |
185 } | 185 } |
186 #endif | 186 #endif |
187 | 187 |
188 void RenderView::layout() | 188 void RenderView::layout() |
189 { | 189 { |
190 if (!document().paginated()) | 190 if (!document().paginated()) |
191 setPageLogicalHeight(0); | 191 setPageLogicalHeight(0); |
192 | 192 |
193 if (shouldUsePrintingLayout()) | 193 if (shouldUsePrintingLayout()) { |
194 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = logicalWidth()
; | 194 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = logicalWidth()
; |
| 195 setShouldDoFullRepaintAfterLayout(true); |
| 196 } |
195 | 197 |
196 SubtreeLayoutScope layoutScope(*this); | 198 SubtreeLayoutScope layoutScope(*this); |
197 | 199 |
198 // Use calcWidth/Height to get the new width/height, since this will take th
e full page zoom factor into account. | 200 // Use calcWidth/Height to get the new width/height, since this will take th
e full page zoom factor into account. |
199 bool relayoutChildren = !shouldUsePrintingLayout() && (!m_frameView || width
() != viewWidth() || height() != viewHeight()); | 201 bool relayoutChildren = !shouldUsePrintingLayout() && (!m_frameView || width
() != viewWidth() || height() != viewHeight()); |
200 if (relayoutChildren) { | 202 if (relayoutChildren) { |
| 203 // FIXME: Should not always fully repaint on resize. |
| 204 setShouldDoFullRepaintAfterLayout(true); |
| 205 |
201 layoutScope.setChildNeedsLayout(this); | 206 layoutScope.setChildNeedsLayout(this); |
202 for (RenderObject* child = firstChild(); child; child = child->nextSibli
ng()) { | 207 for (RenderObject* child = firstChild(); child; child = child->nextSibli
ng()) { |
203 if (child->isSVGRoot()) | 208 if (child->isSVGRoot()) |
204 continue; | 209 continue; |
205 | 210 |
206 if ((child->isBox() && toRenderBox(child)->hasRelativeLogicalHeight(
)) | 211 if ((child->isBox() && toRenderBox(child)->hasRelativeLogicalHeight(
)) |
207 || child->style()->logicalHeight().isPercent() | 212 || child->style()->logicalHeight().isPercent() |
208 || child->style()->logicalMinHeight().isPercent() | 213 || child->style()->logicalMinHeight().isPercent() |
209 || child->style()->logicalMaxHeight().isPercent()) | 214 || child->style()->logicalMaxHeight().isPercent()) |
210 layoutScope.setChildNeedsLayout(child); | 215 layoutScope.setChildNeedsLayout(child); |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 return viewWidth(IncludeScrollbars) / scale; | 968 return viewWidth(IncludeScrollbars) / scale; |
964 } | 969 } |
965 | 970 |
966 double RenderView::layoutViewportHeight() const | 971 double RenderView::layoutViewportHeight() const |
967 { | 972 { |
968 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; | 973 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; |
969 return viewHeight(IncludeScrollbars) / scale; | 974 return viewHeight(IncludeScrollbars) / scale; |
970 } | 975 } |
971 | 976 |
972 } // namespace WebCore | 977 } // namespace WebCore |
OLD | NEW |