| 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 2578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2589 | 2589 |
| 2590 IntRect FrameView::scrollableAreaBoundingBox() const { | 2590 IntRect FrameView::scrollableAreaBoundingBox() const { |
| 2591 LayoutPartItem ownerLayoutItem = frame().ownerLayoutItem(); | 2591 LayoutPartItem ownerLayoutItem = frame().ownerLayoutItem(); |
| 2592 if (ownerLayoutItem.isNull()) | 2592 if (ownerLayoutItem.isNull()) |
| 2593 return frameRect(); | 2593 return frameRect(); |
| 2594 | 2594 |
| 2595 return ownerLayoutItem.absoluteContentQuad(TraverseDocumentBoundaries) | 2595 return ownerLayoutItem.absoluteContentQuad(TraverseDocumentBoundaries) |
| 2596 .enclosingBoundingBox(); | 2596 .enclosingBoundingBox(); |
| 2597 } | 2597 } |
| 2598 | 2598 |
| 2599 bool FrameView::isScrollable() { | 2599 bool FrameView::isScrollable() const { |
| 2600 return getScrollingReasons() == Scrollable; | 2600 return getScrollingReasons() == Scrollable; |
| 2601 } | 2601 } |
| 2602 | 2602 |
| 2603 bool FrameView::isProgrammaticallyScrollable() { | 2603 bool FrameView::isProgrammaticallyScrollable() { |
| 2604 return !m_inUpdateScrollbars; | 2604 return !m_inUpdateScrollbars; |
| 2605 } | 2605 } |
| 2606 | 2606 |
| 2607 FrameView::ScrollingReasons FrameView::getScrollingReasons() const { | 2607 FrameView::ScrollingReasons FrameView::getScrollingReasons() const { |
| 2608 // Check for: | 2608 // Check for: |
| 2609 // 1) If there an actual overflow. | 2609 // 1) If there an actual overflow. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 2631 calculateScrollbarModes(horizontalMode, verticalMode, | 2631 calculateScrollbarModes(horizontalMode, verticalMode, |
| 2632 RulesFromWebContentOnly); | 2632 RulesFromWebContentOnly); |
| 2633 if (horizontalMode == ScrollbarAlwaysOff && | 2633 if (horizontalMode == ScrollbarAlwaysOff && |
| 2634 verticalMode == ScrollbarAlwaysOff) | 2634 verticalMode == ScrollbarAlwaysOff) |
| 2635 return NotScrollableExplicitlyDisabled; | 2635 return NotScrollableExplicitlyDisabled; |
| 2636 | 2636 |
| 2637 return Scrollable; | 2637 return Scrollable; |
| 2638 } | 2638 } |
| 2639 | 2639 |
| 2640 void FrameView::updateParentScrollableAreaSet() { | 2640 void FrameView::updateParentScrollableAreaSet() { |
| 2641 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) |
| 2642 return; |
| 2643 |
| 2641 // That ensures that only inner frames are cached. | 2644 // That ensures that only inner frames are cached. |
| 2642 FrameView* parentFrameView = this->parentFrameView(); | 2645 FrameView* parentFrameView = this->parentFrameView(); |
| 2643 if (!parentFrameView) | 2646 if (!parentFrameView) |
| 2644 return; | 2647 return; |
| 2645 | 2648 |
| 2646 if (!isScrollable()) { | 2649 if (!isScrollable()) { |
| 2647 parentFrameView->removeScrollableArea(this); | 2650 parentFrameView->removeScrollableArea(this); |
| 2648 return; | 2651 return; |
| 2649 } | 2652 } |
| 2650 | 2653 |
| (...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3656 updateParentScrollableAreaSet(); | 3659 updateParentScrollableAreaSet(); |
| 3657 setupRenderThrottling(); | 3660 setupRenderThrottling(); |
| 3658 | 3661 |
| 3659 if (parentFrameView()) | 3662 if (parentFrameView()) |
| 3660 m_subtreeThrottled = parentFrameView()->canThrottleRendering(); | 3663 m_subtreeThrottled = parentFrameView()->canThrottleRendering(); |
| 3661 } | 3664 } |
| 3662 | 3665 |
| 3663 void FrameView::removeChild(Widget* child) { | 3666 void FrameView::removeChild(Widget* child) { |
| 3664 ASSERT(child->parent() == this); | 3667 ASSERT(child->parent() == this); |
| 3665 | 3668 |
| 3666 if (child->isFrameView()) | 3669 if (child->isFrameView() && |
| 3670 !RuntimeEnabledFeatures::rootLayerScrollingEnabled()) |
| 3667 removeScrollableArea(toFrameView(child)); | 3671 removeScrollableArea(toFrameView(child)); |
| 3668 | 3672 |
| 3669 child->setParent(0); | 3673 child->setParent(0); |
| 3670 m_children.remove(child); | 3674 m_children.remove(child); |
| 3671 } | 3675 } |
| 3672 | 3676 |
| 3673 bool FrameView::visualViewportSuppliesScrollbars() { | 3677 bool FrameView::visualViewportSuppliesScrollbars() { |
| 3674 // On desktop, we always use the layout viewport's scrollbars. | 3678 // On desktop, we always use the layout viewport's scrollbars. |
| 3675 if (!m_frame->settings() || !m_frame->settings()->getViewportEnabled() || | 3679 if (!m_frame->settings() || !m_frame->settings()->getViewportEnabled() || |
| 3676 !m_frame->document() || !m_frame->host()) | 3680 !m_frame->document() || !m_frame->host()) |
| (...skipping 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4866 if (!page()->settings().getThreadedScrollingEnabled()) | 4870 if (!page()->settings().getThreadedScrollingEnabled()) |
| 4867 reasons |= MainThreadScrollingReason::kThreadedScrollingDisabled; | 4871 reasons |= MainThreadScrollingReason::kThreadedScrollingDisabled; |
| 4868 | 4872 |
| 4869 if (!frame.isLocalFrame()) | 4873 if (!frame.isLocalFrame()) |
| 4870 return; | 4874 return; |
| 4871 | 4875 |
| 4872 if (!toLocalFrame(frame).view()->layerForScrolling()) | 4876 if (!toLocalFrame(frame).view()->layerForScrolling()) |
| 4873 return; | 4877 return; |
| 4874 | 4878 |
| 4875 reasons |= toLocalFrame(frame).view()->mainThreadScrollingReasonsPerFrame(); | 4879 reasons |= toLocalFrame(frame).view()->mainThreadScrollingReasonsPerFrame(); |
| 4876 if (WebLayer* scrollLayer = | 4880 if (GraphicsLayer* layerForScrolling = toLocalFrame(frame) |
| 4877 toLocalFrame(frame).view()->layerForScrolling()->platformLayer()) { | 4881 .view() |
| 4878 if (reasons) { | 4882 ->layoutViewportScrollableArea() |
| 4879 scrollLayer->addMainThreadScrollingReasons(reasons); | 4883 ->layerForScrolling()) { |
| 4880 } else { | 4884 if (WebLayer* platformLayerForScrolling = |
| 4881 // Clear all main thread scrolling reasons except the one that's set | 4885 layerForScrolling->platformLayer()) { |
| 4882 // if there is a running scroll animation. | 4886 if (reasons) { |
| 4883 scrollLayer->clearMainThreadScrollingReasons( | 4887 platformLayerForScrolling->addMainThreadScrollingReasons(reasons); |
| 4884 ~MainThreadScrollingReason::kHandlingScrollFromMainThread); | 4888 } else { |
| 4889 // Clear all main thread scrolling reasons except the one that's set |
| 4890 // if there is a running scroll animation. |
| 4891 platformLayerForScrolling->clearMainThreadScrollingReasons( |
| 4892 ~MainThreadScrollingReason::kHandlingScrollFromMainThread); |
| 4893 } |
| 4885 } | 4894 } |
| 4886 } | 4895 } |
| 4887 | 4896 |
| 4888 Frame* child = frame.tree().firstChild(); | 4897 Frame* child = frame.tree().firstChild(); |
| 4889 while (child) { | 4898 while (child) { |
| 4890 updateSubFrameScrollOnMainReason(*child, reasons); | 4899 updateSubFrameScrollOnMainReason(*child, reasons); |
| 4891 child = child->tree().nextSibling(); | 4900 child = child->tree().nextSibling(); |
| 4892 } | 4901 } |
| 4893 | 4902 |
| 4894 if (frame.isMainFrame()) | 4903 if (frame.isMainFrame()) |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5070 std::unique_ptr<CompositorAnimationTimeline> timeline) { | 5079 std::unique_ptr<CompositorAnimationTimeline> timeline) { |
| 5071 m_animationTimeline = std::move(timeline); | 5080 m_animationTimeline = std::move(timeline); |
| 5072 } | 5081 } |
| 5073 | 5082 |
| 5074 void FrameView::setAnimationHost( | 5083 void FrameView::setAnimationHost( |
| 5075 std::unique_ptr<CompositorAnimationHost> host) { | 5084 std::unique_ptr<CompositorAnimationHost> host) { |
| 5076 m_animationHost = std::move(host); | 5085 m_animationHost = std::move(host); |
| 5077 } | 5086 } |
| 5078 | 5087 |
| 5079 } // namespace blink | 5088 } // namespace blink |
| OLD | NEW |