| 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 function(*this); | 239 function(*this); |
| 240 | 240 |
| 241 for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree
().nextSibling()) { | 241 for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree
().nextSibling()) { |
| 242 if (!child->isLocalFrame()) | 242 if (!child->isLocalFrame()) |
| 243 continue; | 243 continue; |
| 244 if (FrameView* childView = toLocalFrame(child)->view()) | 244 if (FrameView* childView = toLocalFrame(child)->view()) |
| 245 childView->forAllNonThrottledFrameViews(function); | 245 childView->forAllNonThrottledFrameViews(function); |
| 246 } | 246 } |
| 247 } | 247 } |
| 248 | 248 |
| 249 void FrameView::showFrameTree(int indent) const |
| 250 { |
| 251 if (indent) { |
| 252 for (int i = 0; i < indent; ++i) |
| 253 fputc(' ', stderr); |
| 254 } else { |
| 255 fprintf(stderr, "Current frame tree:\n"); |
| 256 } |
| 257 fprintf(stderr, "%p throttled: %d\n", this, shouldThrottleRendering()); |
| 258 |
| 259 for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree
().nextSibling()) { |
| 260 if (!child->isLocalFrame()) |
| 261 continue; |
| 262 if (FrameView* childView = toLocalFrame(child)->view()) |
| 263 childView->showFrameTree(indent + 2); |
| 264 } |
| 265 } |
| 266 |
| 249 void FrameView::init() | 267 void FrameView::init() |
| 250 { | 268 { |
| 251 reset(); | 269 reset(); |
| 252 | 270 |
| 253 m_size = LayoutSize(); | 271 m_size = LayoutSize(); |
| 254 | 272 |
| 255 // Propagate the marginwidth/height and scrolling modes to the view. | 273 // Propagate the marginwidth/height and scrolling modes to the view. |
| 256 if (m_frame->owner() && m_frame->owner()->scrollingMode() == ScrollbarAlways
Off) | 274 if (m_frame->owner() && m_frame->owner()->scrollingMode() == ScrollbarAlways
Off) |
| 257 setCanHaveScrollbars(false); | 275 setCanHaveScrollbars(false); |
| 258 } | 276 } |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 return TracedValue::create(); | 855 return TracedValue::create(); |
| 838 OwnPtr<TracedValue> value = m_analyzer->toTracedValue(); | 856 OwnPtr<TracedValue> value = m_analyzer->toTracedValue(); |
| 839 value->setString("host", layoutView()->document().location()->host()); | 857 value->setString("host", layoutView()->document().location()->host()); |
| 840 return value.release(); | 858 return value.release(); |
| 841 } | 859 } |
| 842 | 860 |
| 843 #define PERFORM_LAYOUT_TRACE_CATEGORIES "blink,benchmark," TRACE_DISABLED_BY_DEF
AULT("blink.debug.layout") | 861 #define PERFORM_LAYOUT_TRACE_CATEGORIES "blink,benchmark," TRACE_DISABLED_BY_DEF
AULT("blink.debug.layout") |
| 844 | 862 |
| 845 void FrameView::performLayout(bool inSubtreeLayout) | 863 void FrameView::performLayout(bool inSubtreeLayout) |
| 846 { | 864 { |
| 865 fprintf(stderr, "FrameView %p performLayout\n", this); |
| 847 ASSERT(inSubtreeLayout || m_layoutSubtreeRootList.isEmpty()); | 866 ASSERT(inSubtreeLayout || m_layoutSubtreeRootList.isEmpty()); |
| 848 | 867 |
| 849 TRACE_EVENT_BEGIN0(PERFORM_LAYOUT_TRACE_CATEGORIES, "FrameView::performLayou
t"); | 868 TRACE_EVENT_BEGIN0(PERFORM_LAYOUT_TRACE_CATEGORIES, "FrameView::performLayou
t"); |
| 850 prepareLayoutAnalyzer(); | 869 prepareLayoutAnalyzer(); |
| 851 | 870 |
| 852 ScriptForbiddenScope forbidScript; | 871 ScriptForbiddenScope forbidScript; |
| 853 | 872 |
| 854 ASSERT(!isInPerformLayout()); | 873 ASSERT(!isInPerformLayout()); |
| 855 lifecycle().advanceTo(DocumentLifecycle::InPerformLayout); | 874 lifecycle().advanceTo(DocumentLifecycle::InPerformLayout); |
| 856 | 875 |
| (...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1785 if (!needsLayout()) | 1804 if (!needsLayout()) |
| 1786 return; | 1805 return; |
| 1787 if (!m_frame->document()->shouldScheduleLayout()) | 1806 if (!m_frame->document()->shouldScheduleLayout()) |
| 1788 return; | 1807 return; |
| 1789 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Invali
dateLayout", TRACE_EVENT_SCOPE_THREAD, "data", InspectorInvalidateLayoutEvent::d
ata(m_frame.get())); | 1808 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Invali
dateLayout", TRACE_EVENT_SCOPE_THREAD, "data", InspectorInvalidateLayoutEvent::d
ata(m_frame.get())); |
| 1790 | 1809 |
| 1791 clearLayoutSubtreeRootsAndMarkContainingBlocks(); | 1810 clearLayoutSubtreeRootsAndMarkContainingBlocks(); |
| 1792 | 1811 |
| 1793 if (m_hasPendingLayout) | 1812 if (m_hasPendingLayout) |
| 1794 return; | 1813 return; |
| 1814 fprintf(stderr, "FrameView %p is set hasPendingLayout. throttle: %d\n", this
, shouldThrottleRendering()); |
| 1795 m_hasPendingLayout = true; | 1815 m_hasPendingLayout = true; |
| 1796 | 1816 |
| 1797 if (!shouldThrottleRendering()) | 1817 if (!shouldThrottleRendering()) |
| 1798 page()->animator().scheduleVisualUpdate(m_frame.get()); | 1818 page()->animator().scheduleVisualUpdate(m_frame.get()); |
| 1799 } | 1819 } |
| 1800 | 1820 |
| 1801 void FrameView::scheduleRelayoutOfSubtree(LayoutObject* relayoutRoot) | 1821 void FrameView::scheduleRelayoutOfSubtree(LayoutObject* relayoutRoot) |
| 1802 { | 1822 { |
| 1803 ASSERT(m_frame->view() == this); | 1823 ASSERT(m_frame->view() == this); |
| 1804 | 1824 |
| 1805 // FIXME: Should this call shouldScheduleLayout instead? | 1825 // FIXME: Should this call shouldScheduleLayout instead? |
| 1806 if (!m_frame->document()->isActive()) | 1826 if (!m_frame->document()->isActive()) |
| 1807 return; | 1827 return; |
| 1808 | 1828 |
| 1809 LayoutView* layoutView = this->layoutView(); | 1829 LayoutView* layoutView = this->layoutView(); |
| 1810 if (layoutView && layoutView->needsLayout()) { | 1830 if (layoutView && layoutView->needsLayout()) { |
| 1811 if (relayoutRoot) | 1831 if (relayoutRoot) |
| 1812 relayoutRoot->markContainerChainForLayout(false); | 1832 relayoutRoot->markContainerChainForLayout(false); |
| 1813 return; | 1833 return; |
| 1814 } | 1834 } |
| 1815 | 1835 |
| 1816 if (relayoutRoot == layoutView) | 1836 if (relayoutRoot == layoutView) |
| 1817 m_layoutSubtreeRootList.clearAndMarkContainingBlocksForLayout(); | 1837 m_layoutSubtreeRootList.clearAndMarkContainingBlocksForLayout(); |
| 1818 else | 1838 else |
| 1819 m_layoutSubtreeRootList.add(*relayoutRoot); | 1839 m_layoutSubtreeRootList.add(*relayoutRoot); |
| 1820 | 1840 |
| 1821 if (m_layoutSchedulingEnabled) { | 1841 if (m_layoutSchedulingEnabled) { |
| 1842 fprintf(stderr, "FrameView %p is set hasPendingLayout in scheduleRelayou
tOfSubtree. throttle: %d\n", this, shouldThrottleRendering()); |
| 1822 m_hasPendingLayout = true; | 1843 m_hasPendingLayout = true; |
| 1823 | 1844 |
| 1824 page()->animator().scheduleVisualUpdate(m_frame.get()); | 1845 page()->animator().scheduleVisualUpdate(m_frame.get()); |
| 1825 lifecycle().ensureStateAtMost(DocumentLifecycle::StyleClean); | 1846 lifecycle().ensureStateAtMost(DocumentLifecycle::StyleClean); |
| 1826 } | 1847 } |
| 1827 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Invali
dateLayout", TRACE_EVENT_SCOPE_THREAD, "data", InspectorInvalidateLayoutEvent::d
ata(m_frame.get())); | 1848 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Invali
dateLayout", TRACE_EVENT_SCOPE_THREAD, "data", InspectorInvalidateLayoutEvent::d
ata(m_frame.get())); |
| 1828 } | 1849 } |
| 1829 | 1850 |
| 1830 bool FrameView::layoutPending() const | 1851 bool FrameView::layoutPending() const |
| 1831 { | 1852 { |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2392 if (!localFrameRoot->view()->m_isUpdatingAllLifecyclePhases || lifecycle().s
tate() >= DocumentLifecycle::PaintInvalidationClean) { | 2413 if (!localFrameRoot->view()->m_isUpdatingAllLifecyclePhases || lifecycle().s
tate() >= DocumentLifecycle::PaintInvalidationClean) { |
| 2393 // Schedule visual update to process the paint invalidation in the next
cycle. | 2414 // Schedule visual update to process the paint invalidation in the next
cycle. |
| 2394 localFrameRoot->scheduleVisualUpdateUnlessThrottled(); | 2415 localFrameRoot->scheduleVisualUpdateUnlessThrottled(); |
| 2395 } | 2416 } |
| 2396 // Otherwise the paint invalidation will be handled in paint invalidation ph
ase of this cycle. | 2417 // Otherwise the paint invalidation will be handled in paint invalidation ph
ase of this cycle. |
| 2397 } | 2418 } |
| 2398 | 2419 |
| 2399 // TODO(leviw): We don't assert lifecycle information from documents in child Pl
uginViews. | 2420 // TODO(leviw): We don't assert lifecycle information from documents in child Pl
uginViews. |
| 2400 void FrameView::updateLifecyclePhasesInternal(LifeCycleUpdateOption phases) | 2421 void FrameView::updateLifecyclePhasesInternal(LifeCycleUpdateOption phases) |
| 2401 { | 2422 { |
| 2423 showFrameTree(); |
| 2424 |
| 2402 Optional<TemporaryChange<bool>> isUpdatingAllLifecyclePhasesScope; | 2425 Optional<TemporaryChange<bool>> isUpdatingAllLifecyclePhasesScope; |
| 2403 if (phases == AllPhases) | 2426 if (phases == AllPhases) |
| 2404 isUpdatingAllLifecyclePhasesScope.emplace(m_isUpdatingAllLifecyclePhases
, true); | 2427 isUpdatingAllLifecyclePhasesScope.emplace(m_isUpdatingAllLifecyclePhases
, true); |
| 2405 | 2428 |
| 2406 // This must be called from the root frame, since it recurses down, not up. | 2429 // This must be called from the root frame, since it recurses down, not up. |
| 2407 // Otherwise the lifecycles of the frames might be out of sync. | 2430 // Otherwise the lifecycles of the frames might be out of sync. |
| 2408 ASSERT(m_frame->isLocalRoot()); | 2431 ASSERT(m_frame->isLocalRoot()); |
| 2409 | 2432 |
| 2410 if (shouldThrottleRendering()) { | 2433 if (shouldThrottleRendering()) { |
| 2411 updateViewportIntersectionsForSubtree(std::min(phases, OnlyUpToCompositi
ngCleanPlusScrolling)); | 2434 updateViewportIntersectionsForSubtree(std::min(phases, OnlyUpToCompositi
ngCleanPlusScrolling)); |
| (...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4102 return m_hiddenForThrottling && m_crossOriginForThrottling; | 4125 return m_hiddenForThrottling && m_crossOriginForThrottling; |
| 4103 } | 4126 } |
| 4104 | 4127 |
| 4105 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const | 4128 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const |
| 4106 { | 4129 { |
| 4107 ASSERT(layoutView()); | 4130 ASSERT(layoutView()); |
| 4108 return *layoutView(); | 4131 return *layoutView(); |
| 4109 } | 4132 } |
| 4110 | 4133 |
| 4111 } // namespace blink | 4134 } // namespace blink |
| OLD | NEW |