OLD | NEW |
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 #include "core/observer/ResizeObservation.h" | 120 #include "core/observer/ResizeObservation.h" |
121 #include "core/page/ChromeClient.h" | 121 #include "core/page/ChromeClient.h" |
122 #include "core/page/FocusController.h" | 122 #include "core/page/FocusController.h" |
123 #include "core/page/Page.h" | 123 #include "core/page/Page.h" |
124 #include "core/page/PointerLockController.h" | 124 #include "core/page/PointerLockController.h" |
125 #include "core/page/SpatialNavigation.h" | 125 #include "core/page/SpatialNavigation.h" |
126 #include "core/page/scrolling/RootScrollerController.h" | 126 #include "core/page/scrolling/RootScrollerController.h" |
127 #include "core/page/scrolling/ScrollCustomizationCallbacks.h" | 127 #include "core/page/scrolling/ScrollCustomizationCallbacks.h" |
128 #include "core/page/scrolling/ScrollState.h" | 128 #include "core/page/scrolling/ScrollState.h" |
129 #include "core/page/scrolling/ScrollStateCallback.h" | 129 #include "core/page/scrolling/ScrollStateCallback.h" |
| 130 #include "core/page/scrolling/TopDocumentRootScrollerController.h" |
130 #include "core/paint/PaintLayer.h" | 131 #include "core/paint/PaintLayer.h" |
131 #include "core/svg/SVGAElement.h" | 132 #include "core/svg/SVGAElement.h" |
132 #include "core/svg/SVGDocumentExtensions.h" | 133 #include "core/svg/SVGDocumentExtensions.h" |
133 #include "core/svg/SVGElement.h" | 134 #include "core/svg/SVGElement.h" |
134 #include "platform/EventDispatchForbiddenScope.h" | 135 #include "platform/EventDispatchForbiddenScope.h" |
135 #include "platform/RuntimeEnabledFeatures.h" | 136 #include "platform/RuntimeEnabledFeatures.h" |
136 #include "platform/UserGestureIndicator.h" | 137 #include "platform/UserGestureIndicator.h" |
137 #include "platform/graphics/CompositorMutableProperties.h" | 138 #include "platform/graphics/CompositorMutableProperties.h" |
138 #include "platform/graphics/CompositorMutation.h" | 139 #include "platform/graphics/CompositorMutation.h" |
139 #include "platform/scroll/ScrollableArea.h" | 140 #include "platform/scroll/ScrollableArea.h" |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 | 528 |
528 void Element::callDistributeScroll(ScrollState& scrollState) | 529 void Element::callDistributeScroll(ScrollState& scrollState) |
529 { | 530 { |
530 ScrollStateCallback* callback = scrollCustomizationCallbacks().getDistribute
Scroll(this); | 531 ScrollStateCallback* callback = scrollCustomizationCallbacks().getDistribute
Scroll(this); |
531 | 532 |
532 // TODO(bokan): Need to add tests before we allow calling custom callbacks | 533 // TODO(bokan): Need to add tests before we allow calling custom callbacks |
533 // for non-touch modalities. For now, just call into the native callback but | 534 // for non-touch modalities. For now, just call into the native callback but |
534 // allow the viewport scroll callback so we don't disable overscroll. | 535 // allow the viewport scroll callback so we don't disable overscroll. |
535 // crbug.com/623079. | 536 // crbug.com/623079. |
536 bool disableCustomCallbacks = !scrollState.isDirectManipulation() | 537 bool disableCustomCallbacks = !scrollState.isDirectManipulation() |
537 && !document().rootScrollerController()->isViewportScrollCallback(callba
ck); | 538 && !document().frameHost()->globalRootScrollerController().isViewportScr
ollCallback(callback); |
538 | 539 |
539 if (!callback || disableCustomCallbacks) { | 540 if (!callback || disableCustomCallbacks) { |
540 nativeDistributeScroll(scrollState); | 541 nativeDistributeScroll(scrollState); |
541 return; | 542 return; |
542 } | 543 } |
543 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::PerformAfte
rNativeScroll) | 544 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::PerformAfte
rNativeScroll) |
544 callback->handleEvent(&scrollState); | 545 callback->handleEvent(&scrollState); |
545 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::DisableNati
veScroll) | 546 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::DisableNati
veScroll) |
546 nativeDistributeScroll(scrollState); | 547 nativeDistributeScroll(scrollState); |
547 if (callback->nativeScrollBehavior() == WebNativeScrollBehavior::PerformAfte
rNativeScroll) | 548 if (callback->nativeScrollBehavior() == WebNativeScrollBehavior::PerformAfte
rNativeScroll) |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 // or CC. http://crbug.com/625676. | 606 // or CC. http://crbug.com/625676. |
606 DisableCompositingQueryAsserts disabler; | 607 DisableCompositingQueryAsserts disabler; |
607 | 608 |
608 ScrollStateCallback* callback = scrollCustomizationCallbacks().getApplyScrol
l(this); | 609 ScrollStateCallback* callback = scrollCustomizationCallbacks().getApplyScrol
l(this); |
609 | 610 |
610 // TODO(bokan): Need to add tests before we allow calling custom callbacks | 611 // TODO(bokan): Need to add tests before we allow calling custom callbacks |
611 // for non-touch modalities. For now, just call into the native callback but | 612 // for non-touch modalities. For now, just call into the native callback but |
612 // allow the viewport scroll callback so we don't disable overscroll. | 613 // allow the viewport scroll callback so we don't disable overscroll. |
613 // crbug.com/623079. | 614 // crbug.com/623079. |
614 bool disableCustomCallbacks = !scrollState.isDirectManipulation() | 615 bool disableCustomCallbacks = !scrollState.isDirectManipulation() |
615 && !document().rootScrollerController()->isViewportScrollCallback(callba
ck); | 616 && !document().frameHost()->globalRootScrollerController().isViewportScr
ollCallback(callback); |
616 | 617 |
617 if (!callback || disableCustomCallbacks) { | 618 if (!callback || disableCustomCallbacks) { |
618 nativeApplyScroll(scrollState); | 619 nativeApplyScroll(scrollState); |
619 return; | 620 return; |
620 } | 621 } |
621 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::PerformAfte
rNativeScroll) | 622 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::PerformAfte
rNativeScroll) |
622 callback->handleEvent(&scrollState); | 623 callback->handleEvent(&scrollState); |
623 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::DisableNati
veScroll) | 624 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::DisableNati
veScroll) |
624 nativeApplyScroll(scrollState); | 625 nativeApplyScroll(scrollState); |
625 if (callback->nativeScrollBehavior() == WebNativeScrollBehavior::PerformAfte
rNativeScroll) | 626 if (callback->nativeScrollBehavior() == WebNativeScrollBehavior::PerformAfte
rNativeScroll) |
(...skipping 3192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3818 | 3819 |
3819 DEFINE_TRACE_WRAPPERS(Element) | 3820 DEFINE_TRACE_WRAPPERS(Element) |
3820 { | 3821 { |
3821 if (hasRareData()) { | 3822 if (hasRareData()) { |
3822 visitor->traceWrappers(elementRareData()); | 3823 visitor->traceWrappers(elementRareData()); |
3823 } | 3824 } |
3824 ContainerNode::traceWrappers(visitor); | 3825 ContainerNode::traceWrappers(visitor); |
3825 } | 3826 } |
3826 | 3827 |
3827 } // namespace blink | 3828 } // namespace blink |
OLD | NEW |