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

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

Issue 473903002: Avoid auto-resize re-entrancy problems. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed incorrect return. Created 6 years, 4 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
« no previous file with comments | « no previous file | Source/web/tests/WebViewTest.cpp » ('j') | Source/web/tests/WebViewTest.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 ASSERT(m_frame->page()); 795 ASSERT(m_frame->page());
796 796
797 ScriptForbiddenScope forbidScript; 797 ScriptForbiddenScope forbidScript;
798 798
799 if (isInPerformLayout() || !m_frame->document()->isActive()) 799 if (isInPerformLayout() || !m_frame->document()->isActive())
800 return; 800 return;
801 801
802 TRACE_EVENT0("blink", "FrameView::layout"); 802 TRACE_EVENT0("blink", "FrameView::layout");
803 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "Layout"); 803 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "Layout");
804 804
805 autoSizeIfEnabled();
levin 2014/08/22 02:11:00 Why not after protector and changeInProgrammaticSc
rune 2014/08/22 08:52:26 Because I thought those would be called when Frame
806
805 // Protect the view from being deleted during layout (in recalcStyle) 807 // Protect the view from being deleted during layout (in recalcStyle)
806 RefPtr<FrameView> protector(this); 808 RefPtr<FrameView> protector(this);
807 809
808 // Every scroll that happens during layout is programmatic. 810 // Every scroll that happens during layout is programmatic.
809 TemporaryChange<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, tru e); 811 TemporaryChange<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, tru e);
810 812
811 m_hasPendingLayout = false; 813 m_hasPendingLayout = false;
812 DocumentLifecycle::Scope lifecycleScope(lifecycle(), DocumentLifecycle::Layo utClean); 814 DocumentLifecycle::Scope lifecycleScope(lifecycle(), DocumentLifecycle::Layo utClean);
813 815
814 RELEASE_ASSERT(!isPainting()); 816 RELEASE_ASSERT(!isPainting());
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 if (body && body->renderer()) { 853 if (body && body->renderer()) {
852 if (isHTMLFrameSetElement(*body)) { 854 if (isHTMLFrameSetElement(*body)) {
853 body->renderer()->setChildNeedsLayout(); 855 body->renderer()->setChildNeedsLayout();
854 } else if (isHTMLBodyElement(*body)) { 856 } else if (isHTMLBodyElement(*body)) {
855 if (!m_firstLayout && m_size.height() != layoutSize().height () && body->renderer()->enclosingBox()->stretchesToViewport()) 857 if (!m_firstLayout && m_size.height() != layoutSize().height () && body->renderer()->enclosingBox()->stretchesToViewport())
856 body->renderer()->setChildNeedsLayout(); 858 body->renderer()->setChildNeedsLayout();
857 } 859 }
858 } 860 }
859 } 861 }
860 updateCounters(); 862 updateCounters();
861 autoSizeIfEnabled();
862 863
863 ScrollbarMode hMode; 864 ScrollbarMode hMode;
864 ScrollbarMode vMode; 865 ScrollbarMode vMode;
865 calculateScrollbarModesForLayoutAndSetViewportRenderer(hMode, vMode); 866 calculateScrollbarModesForLayoutAndSetViewportRenderer(hMode, vMode);
866 867
867 if (!inSubtreeLayout) { 868 if (!inSubtreeLayout) {
868 // Now set our scrollbar state for the layout. 869 // Now set our scrollbar state for the layout.
869 ScrollbarMode currentHMode = horizontalScrollbarMode(); 870 ScrollbarMode currentHMode = horizontalScrollbarMode();
870 ScrollbarMode currentVMode = verticalScrollbarMode(); 871 ScrollbarMode currentVMode = verticalScrollbarMode();
871 872
(...skipping 2263 matching lines...) Expand 10 before | Expand all | Expand 10 after
3135 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation) 3136 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation)
3136 { 3137 {
3137 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); 3138 ScrollableArea::willRemoveScrollbar(scrollbar, orientation);
3138 if (AXObjectCache* cache = axObjectCache()) { 3139 if (AXObjectCache* cache = axObjectCache()) {
3139 cache->remove(scrollbar); 3140 cache->remove(scrollbar);
3140 cache->handleScrollbarUpdate(this); 3141 cache->handleScrollbarUpdate(this);
3141 } 3142 }
3142 } 3143 }
3143 3144
3144 } // namespace blink 3145 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/web/tests/WebViewTest.cpp » ('j') | Source/web/tests/WebViewTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698