OLD | NEW |
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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 // TODO(wjmaclean): find out why scrollbars fail to resize for complex | 510 // TODO(wjmaclean): find out why scrollbars fail to resize for complex |
511 // subframes after changing the zoom level. For now always calling | 511 // subframes after changing the zoom level. For now always calling |
512 // updateScrollbarsIfNeeded() here fixes the issue, but it would be good to | 512 // updateScrollbarsIfNeeded() here fixes the issue, but it would be good to |
513 // discover the deeper cause of this. http://crbug.com/607987. | 513 // discover the deeper cause of this. http://crbug.com/607987. |
514 updateScrollbarsIfNeeded(); | 514 updateScrollbarsIfNeeded(); |
515 | 515 |
516 frameRectsChanged(); | 516 frameRectsChanged(); |
517 | 517 |
518 updateParentScrollableAreaSet(); | 518 updateParentScrollableAreaSet(); |
519 | 519 |
520 if (LayoutViewItem layoutView = this->layoutViewItem()) { | |
521 // TODO(majidvp): It seems that this only needs to be called when size | |
522 // is updated ignoring any change in the location. | |
523 if (layoutView.usesCompositing()) | |
524 layoutView.compositor()->frameViewDidChangeSize(); | |
525 } | |
526 | |
527 if (frameSizeChanged) { | 520 if (frameSizeChanged) { |
528 viewportSizeChanged(newRect.width() != oldRect.width(), | 521 viewportSizeChanged(newRect.width() != oldRect.width(), |
529 newRect.height() != oldRect.height()); | 522 newRect.height() != oldRect.height()); |
530 | 523 |
531 if (m_frame->isMainFrame()) | 524 if (m_frame->isMainFrame()) |
532 m_frame->host()->visualViewport().mainFrameDidChangeSize(); | 525 m_frame->host()->visualViewport().mainFrameDidChangeSize(); |
533 | 526 |
534 frame().loader().restoreScrollPositionAndViewState(); | 527 frame().loader().restoreScrollPositionAndViewState(); |
535 } | 528 } |
536 } | 529 } |
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1504 | 1497 |
1505 if (ScrollingCoordinator* scrollingCoordinator = | 1498 if (ScrollingCoordinator* scrollingCoordinator = |
1506 this->scrollingCoordinator()) | 1499 this->scrollingCoordinator()) |
1507 scrollingCoordinator->frameViewFixedObjectsDidChange(this); | 1500 scrollingCoordinator->frameViewFixedObjectsDidChange(this); |
1508 } | 1501 } |
1509 } | 1502 } |
1510 | 1503 |
1511 void FrameView::viewportSizeChanged(bool widthChanged, bool heightChanged) { | 1504 void FrameView::viewportSizeChanged(bool widthChanged, bool heightChanged) { |
1512 DCHECK(widthChanged || heightChanged); | 1505 DCHECK(widthChanged || heightChanged); |
1513 | 1506 |
| 1507 if (LayoutViewItem layoutView = this->layoutViewItem()) { |
| 1508 if (layoutView.usesCompositing()) |
| 1509 layoutView.compositor()->frameViewDidChangeSize(); |
| 1510 } |
| 1511 |
| 1512 // Ensure the root scroller compositing layers update geometry in response to |
| 1513 // the URL bar resizing. |
| 1514 if (m_frame->isMainFrame()) { |
| 1515 m_frame->document() |
| 1516 ->frameHost() |
| 1517 ->globalRootScrollerController() |
| 1518 .mainFrameViewResized(); |
| 1519 } |
| 1520 |
1514 showOverlayScrollbars(); | 1521 showOverlayScrollbars(); |
1515 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 1522 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
1516 // The background must be repainted when the FrameView is resized, even if | 1523 // The background must be repainted when the FrameView is resized, even if |
1517 // the initial containing block does not change (so we can't rely on layout | 1524 // the initial containing block does not change (so we can't rely on layout |
1518 // to issue the invalidation). This is because the background fills the | 1525 // to issue the invalidation). This is because the background fills the |
1519 // main GraphicsLayer, which takes the size of the layout viewport. | 1526 // main GraphicsLayer, which takes the size of the layout viewport. |
1520 // TODO(skobes): Paint non-fixed backgrounds into the scrolling contents | 1527 // TODO(skobes): Paint non-fixed backgrounds into the scrolling contents |
1521 // layer and avoid this invalidation (http://crbug.com/568847). | 1528 // layer and avoid this invalidation (http://crbug.com/568847). |
1522 LayoutViewItem lvi = layoutViewItem(); | 1529 LayoutViewItem lvi = layoutViewItem(); |
1523 if (!lvi.isNull()) | 1530 if (!lvi.isNull()) |
(...skipping 1992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3516 | 3523 |
3517 void FrameView::didAddScrollbar(Scrollbar& scrollbar, | 3524 void FrameView::didAddScrollbar(Scrollbar& scrollbar, |
3518 ScrollbarOrientation orientation) { | 3525 ScrollbarOrientation orientation) { |
3519 ScrollableArea::didAddScrollbar(scrollbar, orientation); | 3526 ScrollableArea::didAddScrollbar(scrollbar, orientation); |
3520 } | 3527 } |
3521 | 3528 |
3522 void FrameView::setBrowserControlsViewportAdjustment(float adjustment) { | 3529 void FrameView::setBrowserControlsViewportAdjustment(float adjustment) { |
3523 m_browserControlsViewportAdjustment = adjustment; | 3530 m_browserControlsViewportAdjustment = adjustment; |
3524 } | 3531 } |
3525 | 3532 |
| 3533 PaintLayer* FrameView::layer() const { |
| 3534 LayoutViewItem layoutView = layoutViewItem(); |
| 3535 if (layoutView.isNull() || !layoutView.compositor()) |
| 3536 return nullptr; |
| 3537 |
| 3538 return layoutView.compositor()->rootLayer(); |
| 3539 } |
| 3540 |
3526 IntSize FrameView::maximumScrollOffsetInt() const { | 3541 IntSize FrameView::maximumScrollOffsetInt() const { |
3527 // Make the same calculation as in CC's LayerImpl::MaxScrollOffset() | 3542 // Make the same calculation as in CC's LayerImpl::MaxScrollOffset() |
3528 // FIXME: We probably shouldn't be storing the bounds in a float. | 3543 // FIXME: We probably shouldn't be storing the bounds in a float. |
3529 // crbug.com/422331. | 3544 // crbug.com/422331. |
3530 IntSize visibleSize = | 3545 IntSize visibleSize = |
3531 visibleContentSize(ExcludeScrollbars) + browserControlsSize(); | 3546 visibleContentSize(ExcludeScrollbars) + browserControlsSize(); |
3532 IntSize contentBounds = contentsSize(); | 3547 IntSize contentBounds = contentsSize(); |
3533 IntSize maximumOffset = | 3548 IntSize maximumOffset = |
3534 toIntSize(-scrollOrigin() + (contentBounds - visibleSize)); | 3549 toIntSize(-scrollOrigin() + (contentBounds - visibleSize)); |
3535 return maximumOffset.expandedTo(minimumScrollOffsetInt()); | 3550 return maximumOffset.expandedTo(minimumScrollOffsetInt()); |
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4562 DCHECK(m_frame->isMainFrame()); | 4577 DCHECK(m_frame->isMainFrame()); |
4563 return m_initialViewportSize.width(); | 4578 return m_initialViewportSize.width(); |
4564 } | 4579 } |
4565 | 4580 |
4566 int FrameView::initialViewportHeight() const { | 4581 int FrameView::initialViewportHeight() const { |
4567 DCHECK(m_frame->isMainFrame()); | 4582 DCHECK(m_frame->isMainFrame()); |
4568 return m_initialViewportSize.height(); | 4583 return m_initialViewportSize.height(); |
4569 } | 4584 } |
4570 | 4585 |
4571 } // namespace blink | 4586 } // namespace blink |
OLD | NEW |