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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 #include "core/layout/svg/LayoutSVGRoot.h" | 82 #include "core/layout/svg/LayoutSVGRoot.h" |
83 #include "core/loader/DocumentLoader.h" | 83 #include "core/loader/DocumentLoader.h" |
84 #include "core/loader/FrameLoader.h" | 84 #include "core/loader/FrameLoader.h" |
85 #include "core/loader/FrameLoaderClient.h" | 85 #include "core/loader/FrameLoaderClient.h" |
86 #include "core/observer/ResizeObserverController.h" | 86 #include "core/observer/ResizeObserverController.h" |
87 #include "core/page/AutoscrollController.h" | 87 #include "core/page/AutoscrollController.h" |
88 #include "core/page/ChromeClient.h" | 88 #include "core/page/ChromeClient.h" |
89 #include "core/page/FocusController.h" | 89 #include "core/page/FocusController.h" |
90 #include "core/page/FrameTree.h" | 90 #include "core/page/FrameTree.h" |
91 #include "core/page/Page.h" | 91 #include "core/page/Page.h" |
| 92 #include "core/page/scrolling/RootScrollerUtil.h" |
92 #include "core/page/scrolling/ScrollingCoordinator.h" | 93 #include "core/page/scrolling/ScrollingCoordinator.h" |
93 #include "core/page/scrolling/TopDocumentRootScrollerController.h" | 94 #include "core/page/scrolling/TopDocumentRootScrollerController.h" |
94 #include "core/paint/FramePainter.h" | 95 #include "core/paint/FramePainter.h" |
95 #include "core/paint/PaintLayer.h" | 96 #include "core/paint/PaintLayer.h" |
96 #include "core/paint/PrePaintTreeWalk.h" | 97 #include "core/paint/PrePaintTreeWalk.h" |
97 #include "core/plugins/PluginView.h" | 98 #include "core/plugins/PluginView.h" |
98 #include "core/style/ComputedStyle.h" | 99 #include "core/style/ComputedStyle.h" |
99 #include "core/svg/SVGDocumentExtensions.h" | 100 #include "core/svg/SVGDocumentExtensions.h" |
100 #include "core/svg/SVGSVGElement.h" | 101 #include "core/svg/SVGSVGElement.h" |
101 #include "platform/Histogram.h" | 102 #include "platform/Histogram.h" |
(...skipping 2564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2666 if (!parent()) | 2667 if (!parent()) |
2667 return nullptr; | 2668 return nullptr; |
2668 | 2669 |
2669 Frame* parentFrame = m_frame->tree().parent(); | 2670 Frame* parentFrame = m_frame->tree().parent(); |
2670 if (parentFrame && parentFrame->isLocalFrame()) | 2671 if (parentFrame && parentFrame->isLocalFrame()) |
2671 return toLocalFrame(parentFrame)->view(); | 2672 return toLocalFrame(parentFrame)->view(); |
2672 | 2673 |
2673 return nullptr; | 2674 return nullptr; |
2674 } | 2675 } |
2675 | 2676 |
| 2677 void FrameView::didChangeGlobalRootScroller() { |
| 2678 if (!ScrollbarTheme::theme().usesOverlayScrollbars()) |
| 2679 return; |
| 2680 |
| 2681 // Avoid drawing two sets of scrollbars when visual viewport is enabled. |
| 2682 bool shouldHaveHorizontalScrollbar = false; |
| 2683 bool shouldHaveVerticalScrollbar = false; |
| 2684 computeScrollbarExistence(shouldHaveHorizontalScrollbar, |
| 2685 shouldHaveVerticalScrollbar, contentsSize()); |
| 2686 m_scrollbarManager.setHasHorizontalScrollbar(shouldHaveHorizontalScrollbar); |
| 2687 m_scrollbarManager.setHasVerticalScrollbar(shouldHaveVerticalScrollbar); |
| 2688 } |
| 2689 |
2676 void FrameView::updateWidgetGeometriesIfNeeded() { | 2690 void FrameView::updateWidgetGeometriesIfNeeded() { |
2677 if (!m_needsUpdateWidgetGeometries) | 2691 if (!m_needsUpdateWidgetGeometries) |
2678 return; | 2692 return; |
2679 | 2693 |
2680 m_needsUpdateWidgetGeometries = false; | 2694 m_needsUpdateWidgetGeometries = false; |
2681 | 2695 |
2682 updateWidgetGeometries(); | 2696 updateWidgetGeometries(); |
2683 } | 2697 } |
2684 | 2698 |
2685 void FrameView::updateAllLifecyclePhases() { | 2699 void FrameView::updateAllLifecyclePhases() { |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3490 void FrameView::removeChild(Widget* child) { | 3504 void FrameView::removeChild(Widget* child) { |
3491 ASSERT(child->parent() == this); | 3505 ASSERT(child->parent() == this); |
3492 | 3506 |
3493 if (child->isFrameView()) | 3507 if (child->isFrameView()) |
3494 removeScrollableArea(toFrameView(child)); | 3508 removeScrollableArea(toFrameView(child)); |
3495 | 3509 |
3496 child->setParent(0); | 3510 child->setParent(0); |
3497 m_children.remove(child); | 3511 m_children.remove(child); |
3498 } | 3512 } |
3499 | 3513 |
3500 bool FrameView::visualViewportSuppliesScrollbars() const { | 3514 bool FrameView::visualViewportSuppliesScrollbars() { |
3501 return m_frame->isMainFrame() && m_frame->settings() && | 3515 // On desktop, we always use the layout viewport's scrollbars. |
3502 m_frame->settings()->viewportEnabled(); | 3516 if (!m_frame->settings() || !m_frame->settings()->viewportEnabled() || |
| 3517 !m_frame->document() || !m_frame->document()->frameHost()) |
| 3518 return false; |
| 3519 |
| 3520 const TopDocumentRootScrollerController& controller = |
| 3521 m_frame->document()->frameHost()->globalRootScrollerController(); |
| 3522 |
| 3523 if (!controller.globalRootScroller()) |
| 3524 return false; |
| 3525 |
| 3526 return RootScrollerUtil::scrollableAreaFor( |
| 3527 *controller.globalRootScroller()) == |
| 3528 layoutViewportScrollableArea(); |
3503 } | 3529 } |
3504 | 3530 |
3505 AXObjectCache* FrameView::axObjectCache() const { | 3531 AXObjectCache* FrameView::axObjectCache() const { |
3506 if (frame().document()) | 3532 if (frame().document()) |
3507 return frame().document()->existingAXObjectCache(); | 3533 return frame().document()->existingAXObjectCache(); |
3508 return nullptr; | 3534 return nullptr; |
3509 } | 3535 } |
3510 | 3536 |
3511 void FrameView::setCursor(const Cursor& cursor) { | 3537 void FrameView::setCursor(const Cursor& cursor) { |
3512 Page* page = frame().page(); | 3538 Page* page = frame().page(); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3749 bool FrameView::hasOverlayScrollbars() const { | 3775 bool FrameView::hasOverlayScrollbars() const { |
3750 return (horizontalScrollbar() && | 3776 return (horizontalScrollbar() && |
3751 horizontalScrollbar()->isOverlayScrollbar()) || | 3777 horizontalScrollbar()->isOverlayScrollbar()) || |
3752 (verticalScrollbar() && verticalScrollbar()->isOverlayScrollbar()); | 3778 (verticalScrollbar() && verticalScrollbar()->isOverlayScrollbar()); |
3753 } | 3779 } |
3754 | 3780 |
3755 void FrameView::computeScrollbarExistence( | 3781 void FrameView::computeScrollbarExistence( |
3756 bool& newHasHorizontalScrollbar, | 3782 bool& newHasHorizontalScrollbar, |
3757 bool& newHasVerticalScrollbar, | 3783 bool& newHasVerticalScrollbar, |
3758 const IntSize& docSize, | 3784 const IntSize& docSize, |
3759 ComputeScrollbarExistenceOption option) const { | 3785 ComputeScrollbarExistenceOption option) { |
3760 if (m_frame->settings() && m_frame->settings()->hideScrollbars()) { | 3786 if ((m_frame->settings() && m_frame->settings()->hideScrollbars()) || |
| 3787 visualViewportSuppliesScrollbars()) { |
3761 newHasHorizontalScrollbar = false; | 3788 newHasHorizontalScrollbar = false; |
3762 newHasVerticalScrollbar = false; | 3789 newHasVerticalScrollbar = false; |
3763 return; | 3790 return; |
3764 } | 3791 } |
3765 | 3792 |
3766 bool hasHorizontalScrollbar = horizontalScrollbar(); | 3793 bool hasHorizontalScrollbar = horizontalScrollbar(); |
3767 bool hasVerticalScrollbar = verticalScrollbar(); | 3794 bool hasVerticalScrollbar = verticalScrollbar(); |
3768 | 3795 |
3769 newHasHorizontalScrollbar = hasHorizontalScrollbar; | 3796 newHasHorizontalScrollbar = hasHorizontalScrollbar; |
3770 newHasVerticalScrollbar = hasVerticalScrollbar; | 3797 newHasVerticalScrollbar = hasVerticalScrollbar; |
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4594 DCHECK(m_frame->isMainFrame()); | 4621 DCHECK(m_frame->isMainFrame()); |
4595 return m_initialViewportSize.width(); | 4622 return m_initialViewportSize.width(); |
4596 } | 4623 } |
4597 | 4624 |
4598 int FrameView::initialViewportHeight() const { | 4625 int FrameView::initialViewportHeight() const { |
4599 DCHECK(m_frame->isMainFrame()); | 4626 DCHECK(m_frame->isMainFrame()); |
4600 return m_initialViewportSize.height(); | 4627 return m_initialViewportSize.height(); |
4601 } | 4628 } |
4602 | 4629 |
4603 } // namespace blink | 4630 } // namespace blink |
OLD | NEW |