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

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

Issue 2188483004: Remove extraneous frameView->setNeedsLayout() in LayoutPart (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove bogus test Created 4 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
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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 , m_verticalScrollbarLock(false) 159 , m_verticalScrollbarLock(false)
160 , m_scrollbarsAvoidingResizer(0) 160 , m_scrollbarsAvoidingResizer(0)
161 , m_scrollbarsSuppressed(false) 161 , m_scrollbarsSuppressed(false)
162 , m_inUpdateScrollbars(false) 162 , m_inUpdateScrollbars(false)
163 , m_frameTimingRequestsDirty(true) 163 , m_frameTimingRequestsDirty(true)
164 , m_viewportIntersectionValid(false) 164 , m_viewportIntersectionValid(false)
165 , m_hiddenForThrottling(false) 165 , m_hiddenForThrottling(false)
166 , m_crossOriginForThrottling(false) 166 , m_crossOriginForThrottling(false)
167 , m_subtreeThrottled(false) 167 , m_subtreeThrottled(false)
168 , m_currentUpdateLifecyclePhasesTargetState(DocumentLifecycle::Uninitialized ) 168 , m_currentUpdateLifecyclePhasesTargetState(DocumentLifecycle::Uninitialized )
169 , m_needsScrollbarsUpdate(false)
170 , m_suppressAdjustViewSize(false) 169 , m_suppressAdjustViewSize(false)
171 , m_allowsLayoutInvalidationAfterLayoutClean(true) 170 , m_allowsLayoutInvalidationAfterLayoutClean(true)
172 { 171 {
173 ASSERT(m_frame); 172 ASSERT(m_frame);
174 init(); 173 init();
175 } 174 }
176 175
177 FrameView* FrameView::create(LocalFrame* frame) 176 FrameView* FrameView::create(LocalFrame* frame)
178 { 177 {
179 FrameView* view = new FrameView(frame); 178 FrameView* view = new FrameView(frame);
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 layoutObject->invalidatePaintRectangle(LayoutRect(paintInvalidationRect)); 390 layoutObject->invalidatePaintRectangle(LayoutRect(paintInvalidationRect));
392 } 391 }
393 392
394 void FrameView::setFrameRect(const IntRect& newRect) 393 void FrameView::setFrameRect(const IntRect& newRect)
395 { 394 {
396 IntRect oldRect = frameRect(); 395 IntRect oldRect = frameRect();
397 if (newRect == oldRect) 396 if (newRect == oldRect)
398 return; 397 return;
399 398
400 Widget::setFrameRect(newRect); 399 Widget::setFrameRect(newRect);
400 frameRectsChanged();
401 401
402 const bool frameSizeChanged = oldRect.size() != newRect.size(); 402 if (oldRect.size() == newRect.size())
403 return;
403 404
404 m_needsScrollbarsUpdate = frameSizeChanged;
405 // TODO(wjmaclean): find out why scrollbars fail to resize for complex 405 // TODO(wjmaclean): find out why scrollbars fail to resize for complex
406 // subframes after changing the zoom level. For now always calling 406 // subframes after changing the zoom level. For now always calling
407 // updateScrollbarsIfNeeded() here fixes the issue, but it would be good to 407 // updateScrollbarsIfNeeded() here fixes the issue, but it would be good to
408 // discover the deeper cause of this. http://crbug.com/607987. 408 // discover the deeper cause of this. http://crbug.com/607987.
409 updateScrollbarsIfNeeded(); 409 updateScrollbars();
410
411 frameRectsChanged();
412 410
413 updateScrollableAreaSet(); 411 updateScrollableAreaSet();
414 412
415 if (LayoutViewItem layoutView = this->layoutViewItem()) { 413 if (LayoutViewItem layoutView = this->layoutViewItem()) {
416 // TODO(majidvp): It seems that this only needs to be called when size
417 // is updated ignoring any change in the location.
418 if (layoutView.usesCompositing()) 414 if (layoutView.usesCompositing())
419 layoutView.compositor()->frameViewDidChangeSize(); 415 layoutView.compositor()->frameViewDidChangeSize();
420 } 416 }
421 417
422 if (frameSizeChanged) { 418 viewportSizeChanged(newRect.width() != oldRect.width(), newRect.height() != oldRect.height());
423 viewportSizeChanged(newRect.width() != oldRect.width(), newRect.height() != oldRect.height());
424 419
425 if (m_frame->isMainFrame()) 420 if (m_frame->isMainFrame())
426 m_frame->host()->visualViewport().mainFrameDidChangeSize(); 421 m_frame->host()->visualViewport().mainFrameDidChangeSize();
427 frame().loader().restoreScrollPositionAndViewState(); 422 frame().loader().restoreScrollPositionAndViewState();
428 }
429 } 423 }
430 424
431 Page* FrameView::page() const 425 Page* FrameView::page() const
432 { 426 {
433 return frame().page(); 427 return frame().page();
434 } 428 }
435 429
436 LayoutView* FrameView::layoutView() const 430 LayoutView* FrameView::layoutView() const
437 { 431 {
438 return frame().contentLayoutObject(); 432 return frame().contentLayoutObject();
(...skipping 3150 matching lines...) Expand 10 before | Expand all | Expand 10 after
3589 return hasAnyScrollbar && (shouldUseCustom != hasCustom); 3583 return hasAnyScrollbar && (shouldUseCustom != hasCustom);
3590 } 3584 }
3591 3585
3592 bool FrameView::shouldIgnoreOverflowHidden() const 3586 bool FrameView::shouldIgnoreOverflowHidden() const
3593 { 3587 {
3594 return m_frame->settings()->ignoreMainFrameOverflowHiddenQuirk() && m_frame- >isMainFrame(); 3588 return m_frame->settings()->ignoreMainFrameOverflowHiddenQuirk() && m_frame- >isMainFrame();
3595 } 3589 }
3596 3590
3597 void FrameView::updateScrollbarsIfNeeded() 3591 void FrameView::updateScrollbarsIfNeeded()
3598 { 3592 {
3599 if (m_needsScrollbarsUpdate || needsScrollbarReconstruction() || scrollOrigi nChanged()) 3593 if (needsScrollbarReconstruction() || scrollOriginChanged())
3600 updateScrollbars(); 3594 updateScrollbars();
3601 } 3595 }
3602 3596
3603 void FrameView::updateScrollbars() 3597 void FrameView::updateScrollbars()
3604 { 3598 {
3605 m_needsScrollbarsUpdate = false;
3606
3607 if (m_frame->settings() && m_frame->settings()->rootLayerScrolls()) 3599 if (m_frame->settings() && m_frame->settings()->rootLayerScrolls())
3608 return; 3600 return;
3609 3601
3610 // Avoid drawing two sets of scrollbars when visual viewport is enabled. 3602 // Avoid drawing two sets of scrollbars when visual viewport is enabled.
3611 if (visualViewportSuppliesScrollbars()) { 3603 if (visualViewportSuppliesScrollbars()) {
3612 setHasHorizontalScrollbar(false); 3604 setHasHorizontalScrollbar(false);
3613 setHasVerticalScrollbar(false); 3605 setHasVerticalScrollbar(false);
3614 adjustScrollPositionFromUpdateScrollbars(); 3606 adjustScrollPositionFromUpdateScrollbars();
3615 return; 3607 return;
3616 } 3608 }
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
4283 } 4275 }
4284 4276
4285 bool FrameView::canThrottleRendering() const 4277 bool FrameView::canThrottleRendering() const
4286 { 4278 {
4287 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4279 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4288 return false; 4280 return false;
4289 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4281 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4290 } 4282 }
4291 4283
4292 } // namespace blink 4284 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698