| 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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 | 527 |
| 528 void Element::callDistributeScroll(ScrollState& scrollState) | 528 void Element::callDistributeScroll(ScrollState& scrollState) |
| 529 { | 529 { |
| 530 ScrollStateCallback* callback = scrollCustomizationCallbacks().getDistribute
Scroll(this); | 530 ScrollStateCallback* callback = scrollCustomizationCallbacks().getDistribute
Scroll(this); |
| 531 | 531 |
| 532 // TODO(bokan): Need to add tests before we allow calling custom callbacks | 532 // 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 | 533 // 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. | 534 // allow the viewport scroll callback so we don't disable overscroll. |
| 535 // crbug.com/623079. | 535 // crbug.com/623079. |
| 536 bool disableCustomCallbacks = !scrollState.isDirectManipulation() | 536 bool disableCustomCallbacks = !scrollState.isDirectManipulation() |
| 537 && !document().isViewportScrollCallback(callback); | 537 && !document().rootScrollerController()->isViewportScrollCallback(callba
ck); |
| 538 | 538 |
| 539 if (!callback || disableCustomCallbacks) { | 539 if (!callback || disableCustomCallbacks) { |
| 540 nativeDistributeScroll(scrollState); | 540 nativeDistributeScroll(scrollState); |
| 541 return; | 541 return; |
| 542 } | 542 } |
| 543 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::PerformAfte
rNativeScroll) | 543 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::PerformAfte
rNativeScroll) |
| 544 callback->handleEvent(&scrollState); | 544 callback->handleEvent(&scrollState); |
| 545 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::DisableNati
veScroll) | 545 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::DisableNati
veScroll) |
| 546 nativeDistributeScroll(scrollState); | 546 nativeDistributeScroll(scrollState); |
| 547 if (callback->nativeScrollBehavior() == WebNativeScrollBehavior::PerformAfte
rNativeScroll) | 547 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. | 605 // or CC. http://crbug.com/625676. |
| 606 DisableCompositingQueryAsserts disabler; | 606 DisableCompositingQueryAsserts disabler; |
| 607 | 607 |
| 608 ScrollStateCallback* callback = scrollCustomizationCallbacks().getApplyScrol
l(this); | 608 ScrollStateCallback* callback = scrollCustomizationCallbacks().getApplyScrol
l(this); |
| 609 | 609 |
| 610 // TODO(bokan): Need to add tests before we allow calling custom callbacks | 610 // 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 | 611 // 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. | 612 // allow the viewport scroll callback so we don't disable overscroll. |
| 613 // crbug.com/623079. | 613 // crbug.com/623079. |
| 614 bool disableCustomCallbacks = !scrollState.isDirectManipulation() | 614 bool disableCustomCallbacks = !scrollState.isDirectManipulation() |
| 615 && !document().isViewportScrollCallback(callback); | 615 && !document().rootScrollerController()->isViewportScrollCallback(callba
ck); |
| 616 | 616 |
| 617 if (!callback || disableCustomCallbacks) { | 617 if (!callback || disableCustomCallbacks) { |
| 618 nativeApplyScroll(scrollState); | 618 nativeApplyScroll(scrollState); |
| 619 return; | 619 return; |
| 620 } | 620 } |
| 621 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::PerformAfte
rNativeScroll) | 621 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::PerformAfte
rNativeScroll) |
| 622 callback->handleEvent(&scrollState); | 622 callback->handleEvent(&scrollState); |
| 623 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::DisableNati
veScroll) | 623 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::DisableNati
veScroll) |
| 624 nativeApplyScroll(scrollState); | 624 nativeApplyScroll(scrollState); |
| 625 if (callback->nativeScrollBehavior() == WebNativeScrollBehavior::PerformAfte
rNativeScroll) | 625 if (callback->nativeScrollBehavior() == WebNativeScrollBehavior::PerformAfte
rNativeScroll) |
| (...skipping 3215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3841 | 3841 |
| 3842 DEFINE_TRACE_WRAPPERS(Element) | 3842 DEFINE_TRACE_WRAPPERS(Element) |
| 3843 { | 3843 { |
| 3844 if (hasRareData()) { | 3844 if (hasRareData()) { |
| 3845 visitor->traceWrappers(elementRareData()); | 3845 visitor->traceWrappers(elementRareData()); |
| 3846 } | 3846 } |
| 3847 ContainerNode::traceWrappers(visitor); | 3847 ContainerNode::traceWrappers(visitor); |
| 3848 } | 3848 } |
| 3849 | 3849 |
| 3850 } // namespace blink | 3850 } // namespace blink |
| OLD | NEW |