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

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

Issue 2499853002: Fixed clip resize for document.rootScroller with inertTopControls (Closed)
Patch Set: Fixed typo Created 4 years 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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 // TODO(wjmaclean): find out why scrollbars fail to resize for complex 515 // TODO(wjmaclean): find out why scrollbars fail to resize for complex
516 // subframes after changing the zoom level. For now always calling 516 // subframes after changing the zoom level. For now always calling
517 // updateScrollbarsIfNeeded() here fixes the issue, but it would be good to 517 // updateScrollbarsIfNeeded() here fixes the issue, but it would be good to
518 // discover the deeper cause of this. http://crbug.com/607987. 518 // discover the deeper cause of this. http://crbug.com/607987.
519 updateScrollbarsIfNeeded(); 519 updateScrollbarsIfNeeded();
520 520
521 frameRectsChanged(); 521 frameRectsChanged();
522 522
523 updateParentScrollableAreaSet(); 523 updateParentScrollableAreaSet();
524 524
525 if (LayoutViewItem layoutView = this->layoutViewItem()) {
526 // TODO(majidvp): It seems that this only needs to be called when size
527 // is updated ignoring any change in the location.
528 if (layoutView.usesCompositing())
529 layoutView.compositor()->frameViewDidChangeSize();
530 }
531
532 if (frameSizeChanged) { 525 if (frameSizeChanged) {
533 viewportSizeChanged(newRect.width() != oldRect.width(), 526 viewportSizeChanged(newRect.width() != oldRect.width(),
534 newRect.height() != oldRect.height()); 527 newRect.height() != oldRect.height());
535 528
536 if (m_frame->isMainFrame()) 529 if (m_frame->isMainFrame())
537 m_frame->host()->visualViewport().mainFrameDidChangeSize(); 530 m_frame->host()->visualViewport().mainFrameDidChangeSize();
538 531
539 frame().loader().restoreScrollPositionAndViewState(); 532 frame().loader().restoreScrollPositionAndViewState();
540 } 533 }
541 } 534 }
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after
1523 1516
1524 if (ScrollingCoordinator* scrollingCoordinator = 1517 if (ScrollingCoordinator* scrollingCoordinator =
1525 this->scrollingCoordinator()) 1518 this->scrollingCoordinator())
1526 scrollingCoordinator->frameViewFixedObjectsDidChange(this); 1519 scrollingCoordinator->frameViewFixedObjectsDidChange(this);
1527 } 1520 }
1528 } 1521 }
1529 1522
1530 void FrameView::viewportSizeChanged(bool widthChanged, bool heightChanged) { 1523 void FrameView::viewportSizeChanged(bool widthChanged, bool heightChanged) {
1531 DCHECK(widthChanged || heightChanged); 1524 DCHECK(widthChanged || heightChanged);
1532 1525
1526 if (LayoutViewItem layoutView = this->layoutViewItem()) {
1527 if (layoutView.usesCompositing())
1528 layoutView.compositor()->frameViewDidChangeSize();
1529 }
1530
1531 // Ensure the root scroller compositing layers update geometry in response to
1532 // the URL bar resizing.
1533 if (m_frame->isMainFrame()) {
1534 m_frame->document()
1535 ->frameHost()
1536 ->globalRootScrollerController()
1537 .mainFrameViewResized();
1538 }
1539
1533 showOverlayScrollbars(); 1540 showOverlayScrollbars();
1534 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { 1541 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
1535 // The background must be repainted when the FrameView is resized, even if 1542 // The background must be repainted when the FrameView is resized, even if
1536 // the initial containing block does not change (so we can't rely on layout 1543 // the initial containing block does not change (so we can't rely on layout
1537 // to issue the invalidation). This is because the background fills the 1544 // to issue the invalidation). This is because the background fills the
1538 // main GraphicsLayer, which takes the size of the layout viewport. 1545 // main GraphicsLayer, which takes the size of the layout viewport.
1539 // TODO(skobes): Paint non-fixed backgrounds into the scrolling contents 1546 // TODO(skobes): Paint non-fixed backgrounds into the scrolling contents
1540 // layer and avoid this invalidation (http://crbug.com/568847). 1547 // layer and avoid this invalidation (http://crbug.com/568847).
1541 LayoutViewItem lvi = layoutViewItem(); 1548 LayoutViewItem lvi = layoutViewItem();
1542 if (!lvi.isNull()) 1549 if (!lvi.isNull())
(...skipping 1992 matching lines...) Expand 10 before | Expand all | Expand 10 after
3535 if (!m_frame->settings() || !m_frame->settings()->viewportEnabled() || 3542 if (!m_frame->settings() || !m_frame->settings()->viewportEnabled() ||
3536 !m_frame->document() || !m_frame->host()) 3543 !m_frame->document() || !m_frame->host())
3537 return false; 3544 return false;
3538 3545
3539 const TopDocumentRootScrollerController& controller = 3546 const TopDocumentRootScrollerController& controller =
3540 m_frame->host()->globalRootScrollerController(); 3547 m_frame->host()->globalRootScrollerController();
3541 3548
3542 if (!controller.globalRootScroller()) 3549 if (!controller.globalRootScroller())
3543 return false; 3550 return false;
3544 3551
3545 return RootScrollerUtil::scrollableAreaFor( 3552 return RootScrollerUtil::scrollableAreaForRootScroller(
3546 *controller.globalRootScroller()) == 3553 *controller.globalRootScroller()) ==
3547 layoutViewportScrollableArea(); 3554 layoutViewportScrollableArea();
3548 } 3555 }
3549 3556
3550 AXObjectCache* FrameView::axObjectCache() const { 3557 AXObjectCache* FrameView::axObjectCache() const {
3551 if (frame().document()) 3558 if (frame().document())
3552 return frame().document()->existingAXObjectCache(); 3559 return frame().document()->existingAXObjectCache();
3553 return nullptr; 3560 return nullptr;
3554 } 3561 }
3555 3562
(...skipping 24 matching lines...) Expand all
3580 3587
3581 void FrameView::didAddScrollbar(Scrollbar& scrollbar, 3588 void FrameView::didAddScrollbar(Scrollbar& scrollbar,
3582 ScrollbarOrientation orientation) { 3589 ScrollbarOrientation orientation) {
3583 ScrollableArea::didAddScrollbar(scrollbar, orientation); 3590 ScrollableArea::didAddScrollbar(scrollbar, orientation);
3584 } 3591 }
3585 3592
3586 void FrameView::setBrowserControlsViewportAdjustment(float adjustment) { 3593 void FrameView::setBrowserControlsViewportAdjustment(float adjustment) {
3587 m_browserControlsViewportAdjustment = adjustment; 3594 m_browserControlsViewportAdjustment = adjustment;
3588 } 3595 }
3589 3596
3597 PaintLayer* FrameView::layer() const {
3598 LayoutViewItem layoutView = layoutViewItem();
3599 if (layoutView.isNull() || !layoutView.compositor())
3600 return nullptr;
3601
3602 return layoutView.compositor()->rootLayer();
3603 }
3604
3590 IntSize FrameView::maximumScrollOffsetInt() const { 3605 IntSize FrameView::maximumScrollOffsetInt() const {
3591 // Make the same calculation as in CC's LayerImpl::MaxScrollOffset() 3606 // Make the same calculation as in CC's LayerImpl::MaxScrollOffset()
3592 // FIXME: We probably shouldn't be storing the bounds in a float. 3607 // FIXME: We probably shouldn't be storing the bounds in a float.
3593 // crbug.com/422331. 3608 // crbug.com/422331.
3594 IntSize visibleSize = 3609 IntSize visibleSize =
3595 visibleContentSize(ExcludeScrollbars) + browserControlsSize(); 3610 visibleContentSize(ExcludeScrollbars) + browserControlsSize();
3596 IntSize contentBounds = contentsSize(); 3611 IntSize contentBounds = contentsSize();
3597 IntSize maximumOffset = 3612 IntSize maximumOffset =
3598 toIntSize(-scrollOrigin() + (contentBounds - visibleSize)); 3613 toIntSize(-scrollOrigin() + (contentBounds - visibleSize));
3599 return maximumOffset.expandedTo(minimumScrollOffsetInt()); 3614 return maximumOffset.expandedTo(minimumScrollOffsetInt());
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
4644 DCHECK(m_frame->isMainFrame()); 4659 DCHECK(m_frame->isMainFrame());
4645 return m_initialViewportSize.width(); 4660 return m_initialViewportSize.width();
4646 } 4661 }
4647 4662
4648 int FrameView::initialViewportHeight() const { 4663 int FrameView::initialViewportHeight() const {
4649 DCHECK(m_frame->isMainFrame()); 4664 DCHECK(m_frame->isMainFrame());
4650 return m_initialViewportSize.height(); 4665 return m_initialViewportSize.height();
4651 } 4666 }
4652 4667
4653 } // namespace blink 4668 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698