Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: Source/core/frame/FrameView.cpp

Issue 232013002: Rewind the DocumentLifecycle when dirtying state (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address Ojan's comments Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after
1791 return; 1791 return;
1792 if (!needsLayout()) 1792 if (!needsLayout())
1793 return; 1793 return;
1794 if (!m_frame->document()->shouldScheduleLayout()) 1794 if (!m_frame->document()->shouldScheduleLayout())
1795 return; 1795 return;
1796 InspectorInstrumentation::didInvalidateLayout(m_frame.get()); 1796 InspectorInstrumentation::didInvalidateLayout(m_frame.get());
1797 1797
1798 if (m_hasPendingLayout) 1798 if (m_hasPendingLayout)
1799 return; 1799 return;
1800 m_hasPendingLayout = true; 1800 m_hasPendingLayout = true;
1801
1801 page()->animator().scheduleVisualUpdate(); 1802 page()->animator().scheduleVisualUpdate();
1803 lifecycle().ensureStateAtMost(DocumentLifecycle::StyleClean);
1802 } 1804 }
1803 1805
1804 static bool isObjectAncestorContainerOf(RenderObject* ancestor, RenderObject* de scendant) 1806 static bool isObjectAncestorContainerOf(RenderObject* ancestor, RenderObject* de scendant)
1805 { 1807 {
1806 for (RenderObject* r = descendant; r; r = r->container()) { 1808 for (RenderObject* r = descendant; r; r = r->container()) {
1807 if (r == ancestor) 1809 if (r == ancestor)
1808 return true; 1810 return true;
1809 } 1811 }
1810 return false; 1812 return false;
1811 } 1813 }
1812 1814
1813 void FrameView::scheduleRelayoutOfSubtree(RenderObject* relayoutRoot) 1815 void FrameView::scheduleRelayoutOfSubtree(RenderObject* relayoutRoot)
1814 { 1816 {
1815 ASSERT(m_frame->view() == this); 1817 ASSERT(m_frame->view() == this);
1816 1818
1819 // FIXME: Should this call shouldScheduleLayout instead?
1820 if (!m_frame->document()->isActive())
1821 return;
1822
1817 RenderView* renderView = this->renderView(); 1823 RenderView* renderView = this->renderView();
1818 if (renderView && renderView->needsLayout()) { 1824 if (renderView && renderView->needsLayout()) {
1819 if (relayoutRoot) 1825 if (relayoutRoot)
1820 relayoutRoot->markContainingBlocksForLayout(false); 1826 relayoutRoot->markContainingBlocksForLayout(false);
1821 return; 1827 return;
1822 } 1828 }
1823 1829
1824 if (layoutPending() || !m_layoutSchedulingEnabled) { 1830 if (layoutPending() || !m_layoutSchedulingEnabled) {
1825 if (m_layoutSubtreeRoot != relayoutRoot) { 1831 if (m_layoutSubtreeRoot != relayoutRoot) {
1826 if (isObjectAncestorContainerOf(m_layoutSubtreeRoot, relayoutRoot)) { 1832 if (isObjectAncestorContainerOf(m_layoutSubtreeRoot, relayoutRoot)) {
(...skipping 13 matching lines...) Expand all
1840 m_layoutSubtreeRoot = 0; 1846 m_layoutSubtreeRoot = 0;
1841 relayoutRoot->markContainingBlocksForLayout(false); 1847 relayoutRoot->markContainingBlocksForLayout(false);
1842 InspectorInstrumentation::didInvalidateLayout(m_frame.get()); 1848 InspectorInstrumentation::didInvalidateLayout(m_frame.get());
1843 } 1849 }
1844 } 1850 }
1845 } else if (m_layoutSchedulingEnabled) { 1851 } else if (m_layoutSchedulingEnabled) {
1846 m_layoutSubtreeRoot = relayoutRoot; 1852 m_layoutSubtreeRoot = relayoutRoot;
1847 ASSERT(!m_layoutSubtreeRoot->container() || !m_layoutSubtreeRoot->contai ner()->needsLayout()); 1853 ASSERT(!m_layoutSubtreeRoot->container() || !m_layoutSubtreeRoot->contai ner()->needsLayout());
1848 InspectorInstrumentation::didInvalidateLayout(m_frame.get()); 1854 InspectorInstrumentation::didInvalidateLayout(m_frame.get());
1849 m_hasPendingLayout = true; 1855 m_hasPendingLayout = true;
1856
1850 page()->animator().scheduleVisualUpdate(); 1857 page()->animator().scheduleVisualUpdate();
1858 lifecycle().ensureStateAtMost(DocumentLifecycle::StyleClean);
1851 } 1859 }
1852 } 1860 }
1853 1861
1854 bool FrameView::layoutPending() const 1862 bool FrameView::layoutPending() const
1855 { 1863 {
1856 // FIXME: This should check Document::lifecycle instead. 1864 // FIXME: This should check Document::lifecycle instead.
1857 return m_hasPendingLayout; 1865 return m_hasPendingLayout;
1858 } 1866 }
1859 1867
1860 bool FrameView::isInPerformLayout() const 1868 bool FrameView::isInPerformLayout() const
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after
3219 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation) 3227 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation)
3220 { 3228 {
3221 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); 3229 ScrollableArea::willRemoveScrollbar(scrollbar, orientation);
3222 if (AXObjectCache* cache = axObjectCache()) { 3230 if (AXObjectCache* cache = axObjectCache()) {
3223 cache->remove(scrollbar); 3231 cache->remove(scrollbar);
3224 cache->handleScrollbarUpdate(this); 3232 cache->handleScrollbarUpdate(this);
3225 } 3233 }
3226 } 3234 }
3227 3235
3228 } // namespace WebCore 3236 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/frame/DeprecatedScheduleStyleRecalcDuringLayout.cpp ('k') | Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698