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

Side by Side Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2285253003: Move TopDocumentRootScrollerController to a separate object on FrameHost (Closed)
Patch Set: Rebase Created 4 years, 3 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 #include "core/observer/ResizeObservation.h" 122 #include "core/observer/ResizeObservation.h"
123 #include "core/page/ChromeClient.h" 123 #include "core/page/ChromeClient.h"
124 #include "core/page/FocusController.h" 124 #include "core/page/FocusController.h"
125 #include "core/page/Page.h" 125 #include "core/page/Page.h"
126 #include "core/page/PointerLockController.h" 126 #include "core/page/PointerLockController.h"
127 #include "core/page/SpatialNavigation.h" 127 #include "core/page/SpatialNavigation.h"
128 #include "core/page/scrolling/RootScrollerController.h" 128 #include "core/page/scrolling/RootScrollerController.h"
129 #include "core/page/scrolling/ScrollCustomizationCallbacks.h" 129 #include "core/page/scrolling/ScrollCustomizationCallbacks.h"
130 #include "core/page/scrolling/ScrollState.h" 130 #include "core/page/scrolling/ScrollState.h"
131 #include "core/page/scrolling/ScrollStateCallback.h" 131 #include "core/page/scrolling/ScrollStateCallback.h"
132 #include "core/page/scrolling/TopDocumentRootScrollerController.h"
132 #include "core/paint/PaintLayer.h" 133 #include "core/paint/PaintLayer.h"
133 #include "core/svg/SVGAElement.h" 134 #include "core/svg/SVGAElement.h"
134 #include "core/svg/SVGDocumentExtensions.h" 135 #include "core/svg/SVGDocumentExtensions.h"
135 #include "core/svg/SVGElement.h" 136 #include "core/svg/SVGElement.h"
136 #include "platform/EventDispatchForbiddenScope.h" 137 #include "platform/EventDispatchForbiddenScope.h"
137 #include "platform/RuntimeEnabledFeatures.h" 138 #include "platform/RuntimeEnabledFeatures.h"
138 #include "platform/UserGestureIndicator.h" 139 #include "platform/UserGestureIndicator.h"
139 #include "platform/graphics/CompositorMutableProperties.h" 140 #include "platform/graphics/CompositorMutableProperties.h"
140 #include "platform/graphics/CompositorMutation.h" 141 #include "platform/graphics/CompositorMutation.h"
141 #include "platform/scroll/ScrollableArea.h" 142 #include "platform/scroll/ScrollableArea.h"
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 530
530 void Element::callDistributeScroll(ScrollState& scrollState) 531 void Element::callDistributeScroll(ScrollState& scrollState)
531 { 532 {
532 ScrollStateCallback* callback = scrollCustomizationCallbacks().getDistribute Scroll(this); 533 ScrollStateCallback* callback = scrollCustomizationCallbacks().getDistribute Scroll(this);
533 534
534 // TODO(bokan): Need to add tests before we allow calling custom callbacks 535 // TODO(bokan): Need to add tests before we allow calling custom callbacks
535 // for non-touch modalities. For now, just call into the native callback but 536 // for non-touch modalities. For now, just call into the native callback but
536 // allow the viewport scroll callback so we don't disable overscroll. 537 // allow the viewport scroll callback so we don't disable overscroll.
537 // crbug.com/623079. 538 // crbug.com/623079.
538 bool disableCustomCallbacks = !scrollState.isDirectManipulation() 539 bool disableCustomCallbacks = !scrollState.isDirectManipulation()
539 && !document().rootScrollerController()->isViewportScrollCallback(callba ck); 540 && !document().frameHost()->globalRootScrollerController().isViewportScr ollCallback(callback);
540 541
541 if (!callback || disableCustomCallbacks) { 542 if (!callback || disableCustomCallbacks) {
542 nativeDistributeScroll(scrollState); 543 nativeDistributeScroll(scrollState);
543 return; 544 return;
544 } 545 }
545 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::PerformAfte rNativeScroll) 546 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::PerformAfte rNativeScroll)
546 callback->handleEvent(&scrollState); 547 callback->handleEvent(&scrollState);
547 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::DisableNati veScroll) 548 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::DisableNati veScroll)
548 nativeDistributeScroll(scrollState); 549 nativeDistributeScroll(scrollState);
549 if (callback->nativeScrollBehavior() == WebNativeScrollBehavior::PerformAfte rNativeScroll) 550 if (callback->nativeScrollBehavior() == WebNativeScrollBehavior::PerformAfte rNativeScroll)
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 // or CC. http://crbug.com/625676. 608 // or CC. http://crbug.com/625676.
608 DisableCompositingQueryAsserts disabler; 609 DisableCompositingQueryAsserts disabler;
609 610
610 ScrollStateCallback* callback = scrollCustomizationCallbacks().getApplyScrol l(this); 611 ScrollStateCallback* callback = scrollCustomizationCallbacks().getApplyScrol l(this);
611 612
612 // TODO(bokan): Need to add tests before we allow calling custom callbacks 613 // TODO(bokan): Need to add tests before we allow calling custom callbacks
613 // for non-touch modalities. For now, just call into the native callback but 614 // for non-touch modalities. For now, just call into the native callback but
614 // allow the viewport scroll callback so we don't disable overscroll. 615 // allow the viewport scroll callback so we don't disable overscroll.
615 // crbug.com/623079. 616 // crbug.com/623079.
616 bool disableCustomCallbacks = !scrollState.isDirectManipulation() 617 bool disableCustomCallbacks = !scrollState.isDirectManipulation()
617 && !document().rootScrollerController()->isViewportScrollCallback(callba ck); 618 && !document().frameHost()->globalRootScrollerController().isViewportScr ollCallback(callback);
618 619
619 if (!callback || disableCustomCallbacks) { 620 if (!callback || disableCustomCallbacks) {
620 nativeApplyScroll(scrollState); 621 nativeApplyScroll(scrollState);
621 return; 622 return;
622 } 623 }
623 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::PerformAfte rNativeScroll) 624 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::PerformAfte rNativeScroll)
624 callback->handleEvent(&scrollState); 625 callback->handleEvent(&scrollState);
625 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::DisableNati veScroll) 626 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::DisableNati veScroll)
626 nativeApplyScroll(scrollState); 627 nativeApplyScroll(scrollState);
627 if (callback->nativeScrollBehavior() == WebNativeScrollBehavior::PerformAfte rNativeScroll) 628 if (callback->nativeScrollBehavior() == WebNativeScrollBehavior::PerformAfte rNativeScroll)
(...skipping 3200 matching lines...) Expand 10 before | Expand all | Expand 10 after
3828 3829
3829 DEFINE_TRACE_WRAPPERS(Element) 3830 DEFINE_TRACE_WRAPPERS(Element)
3830 { 3831 {
3831 if (hasRareData()) { 3832 if (hasRareData()) {
3832 visitor->traceWrappers(elementRareData()); 3833 visitor->traceWrappers(elementRareData());
3833 } 3834 }
3834 ContainerNode::traceWrappers(visitor); 3835 ContainerNode::traceWrappers(visitor);
3835 } 3836 }
3836 3837
3837 } // namespace blink 3838 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/frame/FrameHost.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698