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

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

Issue 190973007: Reland "Avoid layout/full-repaint on view height change if possible" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: computeOverflow, etc. Created 6 years, 9 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
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 3161 matching lines...) Expand 10 before | Expand all | Expand 10 after
3172 setLayoutSizeInternal(frameRect().size()); 3172 setLayoutSizeInternal(frameRect().size());
3173 3173
3174 ScrollView::frameRectsChanged(); 3174 ScrollView::frameRectsChanged();
3175 } 3175 }
3176 3176
3177 void FrameView::setLayoutSizeInternal(const IntSize& size) 3177 void FrameView::setLayoutSizeInternal(const IntSize& size)
3178 { 3178 {
3179 if (m_layoutSize == size) 3179 if (m_layoutSize == size)
3180 return; 3180 return;
3181 3181
3182 bool widthChanged = m_layoutSize.width() != size.width();
3182 m_layoutSize = size; 3183 m_layoutSize = size;
3183 contentsResized(); 3184
3185 // Update scrollbars. Not calling this->contentsResized() to avoid setNeedsL ayout.
3186 ScrollView::contentsResized();
3187
3188 RenderView* renderView = this->renderView();
3189 if (!renderView)
3190 return;
3191
3192 // If needsLayout, the next layout will do all the things required on layout Size change.
3193 if (renderView->needsLayout())
3194 return;
3195
3196 if (widthChanged) {
3197 setNeedsLayout();
3198 return;
3199 }
3200
3201 performPreLayoutTasks();
3202
3203 // During pre-layout tasks, viewport media queries, viewport sizes and other s may cause
3204 // style update and set needsLayout flag.
3205 if (renderView->needsLayout())
3206 return;
3207
3208 if (!renderView->trySimplifiedLayoutOnHeightChange()) {
3209 setNeedsLayout();
3210 return;
3211 }
3212
3213 // RenderView has finished a simplified layout for the height change. We nee d to perform
3214 // necessary post-layout tasks for the simplified layout.
3215 scheduleOrPerformPostLayoutTasks();
3216 if (frame().page())
3217 frame().page()->chrome().client().layoutUpdated(m_frame.get());
3184 } 3218 }
3185 3219
3186 void FrameView::didAddScrollbar(Scrollbar* scrollbar, ScrollbarOrientation orien tation) 3220 void FrameView::didAddScrollbar(Scrollbar* scrollbar, ScrollbarOrientation orien tation)
3187 { 3221 {
3188 ScrollableArea::didAddScrollbar(scrollbar, orientation); 3222 ScrollableArea::didAddScrollbar(scrollbar, orientation);
3189 if (AXObjectCache* cache = axObjectCache()) 3223 if (AXObjectCache* cache = axObjectCache())
3190 cache->handleScrollbarUpdate(this); 3224 cache->handleScrollbarUpdate(this);
3191 } 3225 }
3192 3226
3193 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation) 3227 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation)
3194 { 3228 {
3195 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); 3229 ScrollableArea::willRemoveScrollbar(scrollbar, orientation);
3196 if (AXObjectCache* cache = axObjectCache()) { 3230 if (AXObjectCache* cache = axObjectCache()) {
3197 cache->remove(scrollbar); 3231 cache->remove(scrollbar);
3198 cache->handleScrollbarUpdate(this); 3232 cache->handleScrollbarUpdate(this);
3199 } 3233 }
3200 } 3234 }
3201 3235
3202 } // namespace WebCore 3236 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698