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

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

Issue 2659183002: [RootLayerScrolls] Fix frame scrolling layer in ScrollingCoordinator (Closed)
Patch Set: nit scratched Created 3 years, 10 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 2574 matching lines...) Expand 10 before | Expand all | Expand 10 after
2585 2585
2586 IntRect FrameView::scrollableAreaBoundingBox() const { 2586 IntRect FrameView::scrollableAreaBoundingBox() const {
2587 LayoutPartItem ownerLayoutItem = frame().ownerLayoutItem(); 2587 LayoutPartItem ownerLayoutItem = frame().ownerLayoutItem();
2588 if (ownerLayoutItem.isNull()) 2588 if (ownerLayoutItem.isNull())
2589 return frameRect(); 2589 return frameRect();
2590 2590
2591 return ownerLayoutItem.absoluteContentQuad(TraverseDocumentBoundaries) 2591 return ownerLayoutItem.absoluteContentQuad(TraverseDocumentBoundaries)
2592 .enclosingBoundingBox(); 2592 .enclosingBoundingBox();
2593 } 2593 }
2594 2594
2595 bool FrameView::isScrollable() { 2595 bool FrameView::isScrollable() const {
2596 return getScrollingReasons() == Scrollable; 2596 return getScrollingReasons() == Scrollable;
2597 } 2597 }
2598 2598
2599 bool FrameView::isProgrammaticallyScrollable() { 2599 bool FrameView::isProgrammaticallyScrollable() {
2600 return !m_inUpdateScrollbars; 2600 return !m_inUpdateScrollbars;
2601 } 2601 }
2602 2602
2603 FrameView::ScrollingReasons FrameView::getScrollingReasons() const { 2603 FrameView::ScrollingReasons FrameView::getScrollingReasons() const {
2604 // Check for: 2604 // Check for:
2605 // 1) If there an actual overflow. 2605 // 1) If there an actual overflow.
(...skipping 21 matching lines...) Expand all
2627 calculateScrollbarModes(horizontalMode, verticalMode, 2627 calculateScrollbarModes(horizontalMode, verticalMode,
2628 RulesFromWebContentOnly); 2628 RulesFromWebContentOnly);
2629 if (horizontalMode == ScrollbarAlwaysOff && 2629 if (horizontalMode == ScrollbarAlwaysOff &&
2630 verticalMode == ScrollbarAlwaysOff) 2630 verticalMode == ScrollbarAlwaysOff)
2631 return NotScrollableExplicitlyDisabled; 2631 return NotScrollableExplicitlyDisabled;
2632 2632
2633 return Scrollable; 2633 return Scrollable;
2634 } 2634 }
2635 2635
2636 void FrameView::updateParentScrollableAreaSet() { 2636 void FrameView::updateParentScrollableAreaSet() {
2637 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled())
2638 return;
2639
2637 // That ensures that only inner frames are cached. 2640 // That ensures that only inner frames are cached.
2638 FrameView* parentFrameView = this->parentFrameView(); 2641 FrameView* parentFrameView = this->parentFrameView();
2639 if (!parentFrameView) 2642 if (!parentFrameView)
2640 return; 2643 return;
2641 2644
2642 if (!isScrollable()) { 2645 if (!isScrollable()) {
2643 parentFrameView->removeScrollableArea(this); 2646 parentFrameView->removeScrollableArea(this);
2644 return; 2647 return;
2645 } 2648 }
2646 2649
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
3652 updateParentScrollableAreaSet(); 3655 updateParentScrollableAreaSet();
3653 setupRenderThrottling(); 3656 setupRenderThrottling();
3654 3657
3655 if (parentFrameView()) 3658 if (parentFrameView())
3656 m_subtreeThrottled = parentFrameView()->canThrottleRendering(); 3659 m_subtreeThrottled = parentFrameView()->canThrottleRendering();
3657 } 3660 }
3658 3661
3659 void FrameView::removeChild(Widget* child) { 3662 void FrameView::removeChild(Widget* child) {
3660 ASSERT(child->parent() == this); 3663 ASSERT(child->parent() == this);
3661 3664
3662 if (child->isFrameView()) 3665 if (child->isFrameView() &&
3666 !RuntimeEnabledFeatures::rootLayerScrollingEnabled())
3663 removeScrollableArea(toFrameView(child)); 3667 removeScrollableArea(toFrameView(child));
3664 3668
3665 child->setParent(0); 3669 child->setParent(0);
3666 m_children.remove(child); 3670 m_children.remove(child);
3667 } 3671 }
3668 3672
3669 bool FrameView::visualViewportSuppliesScrollbars() { 3673 bool FrameView::visualViewportSuppliesScrollbars() {
3670 // On desktop, we always use the layout viewport's scrollbars. 3674 // On desktop, we always use the layout viewport's scrollbars.
3671 if (!m_frame->settings() || !m_frame->settings()->getViewportEnabled() || 3675 if (!m_frame->settings() || !m_frame->settings()->getViewportEnabled() ||
3672 !m_frame->document() || !m_frame->host()) 3676 !m_frame->document() || !m_frame->host())
(...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after
4881 if (!page()->settings().getThreadedScrollingEnabled()) 4885 if (!page()->settings().getThreadedScrollingEnabled())
4882 reasons |= MainThreadScrollingReason::kThreadedScrollingDisabled; 4886 reasons |= MainThreadScrollingReason::kThreadedScrollingDisabled;
4883 4887
4884 if (!frame.isLocalFrame()) 4888 if (!frame.isLocalFrame())
4885 return; 4889 return;
4886 4890
4887 if (!toLocalFrame(frame).view()->layerForScrolling()) 4891 if (!toLocalFrame(frame).view()->layerForScrolling())
4888 return; 4892 return;
4889 4893
4890 reasons |= toLocalFrame(frame).view()->mainThreadScrollingReasonsPerFrame(); 4894 reasons |= toLocalFrame(frame).view()->mainThreadScrollingReasonsPerFrame();
4891 if (WebLayer* scrollLayer = 4895 if (GraphicsLayer* layerForScrolling = toLocalFrame(frame)
4892 toLocalFrame(frame).view()->layerForScrolling()->platformLayer()) { 4896 .view()
4893 if (reasons) { 4897 ->layoutViewportScrollableArea()
4894 scrollLayer->addMainThreadScrollingReasons(reasons); 4898 ->layerForScrolling()) {
4895 } else { 4899 if (WebLayer* platformLayerForScrolling =
4896 // Clear all main thread scrolling reasons except the one that's set 4900 layerForScrolling->platformLayer()) {
4897 // if there is a running scroll animation. 4901 if (reasons) {
4898 scrollLayer->clearMainThreadScrollingReasons( 4902 platformLayerForScrolling->addMainThreadScrollingReasons(reasons);
4899 ~MainThreadScrollingReason::kHandlingScrollFromMainThread); 4903 } else {
4904 // Clear all main thread scrolling reasons except the one that's set
4905 // if there is a running scroll animation.
4906 platformLayerForScrolling->clearMainThreadScrollingReasons(
4907 ~MainThreadScrollingReason::kHandlingScrollFromMainThread);
4908 }
4900 } 4909 }
4901 } 4910 }
4902 4911
4903 Frame* child = frame.tree().firstChild(); 4912 Frame* child = frame.tree().firstChild();
4904 while (child) { 4913 while (child) {
4905 updateSubFrameScrollOnMainReason(*child, reasons); 4914 updateSubFrameScrollOnMainReason(*child, reasons);
4906 child = child->tree().nextSibling(); 4915 child = child->tree().nextSibling();
4907 } 4916 }
4908 4917
4909 if (frame.isMainFrame()) 4918 if (frame.isMainFrame())
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
5085 std::unique_ptr<CompositorAnimationTimeline> timeline) { 5094 std::unique_ptr<CompositorAnimationTimeline> timeline) {
5086 m_animationTimeline = std::move(timeline); 5095 m_animationTimeline = std::move(timeline);
5087 } 5096 }
5088 5097
5089 void FrameView::setAnimationHost( 5098 void FrameView::setAnimationHost(
5090 std::unique_ptr<CompositorAnimationHost> host) { 5099 std::unique_ptr<CompositorAnimationHost> host) {
5091 m_animationHost = std::move(host); 5100 m_animationHost = std::move(host);
5092 } 5101 }
5093 5102
5094 } // namespace blink 5103 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698