OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 #endif | 197 #endif |
198 Widget::trace(visitor); | 198 Widget::trace(visitor); |
199 ScrollableArea::trace(visitor); | 199 ScrollableArea::trace(visitor); |
200 } | 200 } |
201 | 201 |
202 void FrameView::reset() | 202 void FrameView::reset() |
203 { | 203 { |
204 m_hasPendingLayout = false; | 204 m_hasPendingLayout = false; |
205 m_doFullPaintInvalidation = false; | 205 m_doFullPaintInvalidation = false; |
206 m_layoutSchedulingEnabled = true; | 206 m_layoutSchedulingEnabled = true; |
207 m_inPerformLayout = false; | |
208 m_inSynchronousPostLayout = false; | 207 m_inSynchronousPostLayout = false; |
209 m_layoutCount = 0; | 208 m_layoutCount = 0; |
210 m_nestedLayoutCount = 0; | 209 m_nestedLayoutCount = 0; |
211 m_postLayoutTasksTimer.stop(); | 210 m_postLayoutTasksTimer.stop(); |
212 m_updateWidgetsTimer.stop(); | 211 m_updateWidgetsTimer.stop(); |
213 m_firstLayout = true; | 212 m_firstLayout = true; |
214 m_safeToPropagateScrollToParent = true; | 213 m_safeToPropagateScrollToParent = true; |
215 m_lastViewportSize = IntSize(); | 214 m_lastViewportSize = IntSize(); |
216 m_lastZoomFactor = 1.0f; | 215 m_lastZoomFactor = 1.0f; |
217 m_isTrackingPaintInvalidations = s_initialTrackAllPaintInvalidations; | 216 m_isTrackingPaintInvalidations = s_initialTrackAllPaintInvalidations; |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 ASSERT(inSubtreeLayout || m_layoutSubtreeRootList.isEmpty()); | 817 ASSERT(inSubtreeLayout || m_layoutSubtreeRootList.isEmpty()); |
819 | 818 |
820 TRACE_EVENT_BEGIN0(PERFORM_LAYOUT_TRACE_CATEGORIES, "FrameView::performLayou
t"); | 819 TRACE_EVENT_BEGIN0(PERFORM_LAYOUT_TRACE_CATEGORIES, "FrameView::performLayou
t"); |
821 prepareLayoutAnalyzer(); | 820 prepareLayoutAnalyzer(); |
822 | 821 |
823 ScriptForbiddenScope forbidScript; | 822 ScriptForbiddenScope forbidScript; |
824 | 823 |
825 ASSERT(!isInPerformLayout()); | 824 ASSERT(!isInPerformLayout()); |
826 lifecycle().advanceTo(DocumentLifecycle::InPerformLayout); | 825 lifecycle().advanceTo(DocumentLifecycle::InPerformLayout); |
827 | 826 |
828 TemporaryChange<bool> changeInPerformLayout(m_inPerformLayout, true); | |
829 | |
830 // performLayout is the actual guts of layout(). | 827 // performLayout is the actual guts of layout(). |
831 // FIXME: The 300 other lines in layout() probably belong in other helper fu
nctions | 828 // FIXME: The 300 other lines in layout() probably belong in other helper fu
nctions |
832 // so that a single human could understand what layout() is actually doing. | 829 // so that a single human could understand what layout() is actually doing. |
833 | 830 |
834 forceLayoutParentViewIfNeeded(); | 831 forceLayoutParentViewIfNeeded(); |
835 | 832 |
836 if (inSubtreeLayout) { | 833 if (inSubtreeLayout) { |
837 if (m_analyzer) | 834 if (m_analyzer) |
838 m_analyzer->increment(LayoutAnalyzer::PerformLayoutRootLayoutObjects
, m_layoutSubtreeRootList.size()); | 835 m_analyzer->increment(LayoutAnalyzer::PerformLayoutRootLayoutObjects
, m_layoutSubtreeRootList.size()); |
839 while (LayoutObject* root = m_layoutSubtreeRootList.takeDeepestRoot()) { | 836 while (LayoutObject* root = m_layoutSubtreeRootList.takeDeepestRoot()) { |
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1759 } | 1756 } |
1760 | 1757 |
1761 bool FrameView::layoutPending() const | 1758 bool FrameView::layoutPending() const |
1762 { | 1759 { |
1763 // FIXME: This should check Document::lifecycle instead. | 1760 // FIXME: This should check Document::lifecycle instead. |
1764 return m_hasPendingLayout; | 1761 return m_hasPendingLayout; |
1765 } | 1762 } |
1766 | 1763 |
1767 bool FrameView::isInPerformLayout() const | 1764 bool FrameView::isInPerformLayout() const |
1768 { | 1765 { |
1769 ASSERT(m_inPerformLayout == (lifecycle().state() == DocumentLifecycle::InPer
formLayout)); | 1766 return lifecycle().state() == DocumentLifecycle::InPerformLayout; |
1770 return m_inPerformLayout; | |
1771 } | 1767 } |
1772 | 1768 |
1773 bool FrameView::needsLayout() const | 1769 bool FrameView::needsLayout() const |
1774 { | 1770 { |
1775 // This can return true in cases where the document does not have a body yet
. | 1771 // This can return true in cases where the document does not have a body yet
. |
1776 // Document::shouldScheduleLayout takes care of preventing us from schedulin
g | 1772 // Document::shouldScheduleLayout takes care of preventing us from schedulin
g |
1777 // layout in that case. | 1773 // layout in that case. |
1778 | 1774 |
1779 LayoutView* layoutView = this->layoutView(); | 1775 LayoutView* layoutView = this->layoutView(); |
1780 return layoutPending() | 1776 return layoutPending() |
(...skipping 2231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4012 return m_hiddenForThrottling && m_crossOriginForThrottling; | 4008 return m_hiddenForThrottling && m_crossOriginForThrottling; |
4013 } | 4009 } |
4014 | 4010 |
4015 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const | 4011 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const |
4016 { | 4012 { |
4017 ASSERT(layoutView()); | 4013 ASSERT(layoutView()); |
4018 return *layoutView(); | 4014 return *layoutView(); |
4019 } | 4015 } |
4020 | 4016 |
4021 } // namespace blink | 4017 } // namespace blink |
OLD | NEW |