| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, Google Inc. All rights reserved. |
| 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. | 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 void ScrollableArea::layerForScrollingDidChange(CompositorAnimationTimeline* tim
eline) | 475 void ScrollableArea::layerForScrollingDidChange(CompositorAnimationTimeline* tim
eline) |
| 476 { | 476 { |
| 477 if (ProgrammaticScrollAnimator* programmaticScrollAnimator = existingProgram
maticScrollAnimator()) | 477 if (ProgrammaticScrollAnimator* programmaticScrollAnimator = existingProgram
maticScrollAnimator()) |
| 478 programmaticScrollAnimator->layerForCompositedScrollingDidChange(timelin
e); | 478 programmaticScrollAnimator->layerForCompositedScrollingDidChange(timelin
e); |
| 479 if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator()) | 479 if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator()) |
| 480 scrollAnimator->layerForCompositedScrollingDidChange(timeline); | 480 scrollAnimator->layerForCompositedScrollingDidChange(timeline); |
| 481 } | 481 } |
| 482 | 482 |
| 483 bool ScrollableArea::scheduleAnimation() | 483 bool ScrollableArea::scheduleAnimation() |
| 484 { | 484 { |
| 485 if (HostWindow* window = hostWindow()) { | 485 if (HostWindow* window = getHostWindow()) { |
| 486 window->scheduleAnimation(widget()); | 486 window->scheduleAnimation(getWidget()); |
| 487 return true; | 487 return true; |
| 488 } | 488 } |
| 489 return false; | 489 return false; |
| 490 } | 490 } |
| 491 | 491 |
| 492 void ScrollableArea::serviceScrollAnimations(double monotonicTime) | 492 void ScrollableArea::serviceScrollAnimations(double monotonicTime) |
| 493 { | 493 { |
| 494 bool requiresAnimationService = false; | 494 bool requiresAnimationService = false; |
| 495 if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator()) { | 495 if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator()) { |
| 496 scrollAnimator->tickAnimation(monotonicTime); | 496 scrollAnimator->tickAnimation(monotonicTime); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 return scrollPosition.shrunkTo(maximumScrollPosition()).expandedTo(minimumSc
rollPosition()); | 570 return scrollPosition.shrunkTo(maximumScrollPosition()).expandedTo(minimumSc
rollPosition()); |
| 571 } | 571 } |
| 572 | 572 |
| 573 DoublePoint ScrollableArea::clampScrollPosition(const DoublePoint& scrollPositio
n) const | 573 DoublePoint ScrollableArea::clampScrollPosition(const DoublePoint& scrollPositio
n) const |
| 574 { | 574 { |
| 575 return scrollPosition.shrunkTo(maximumScrollPositionDouble()).expandedTo(min
imumScrollPositionDouble()); | 575 return scrollPosition.shrunkTo(maximumScrollPositionDouble()).expandedTo(min
imumScrollPositionDouble()); |
| 576 } | 576 } |
| 577 | 577 |
| 578 int ScrollableArea::lineStep(ScrollbarOrientation) const | 578 int ScrollableArea::lineStep(ScrollbarOrientation) const |
| 579 { | 579 { |
| 580 return pixelsPerLineStep(hostWindow()); | 580 return pixelsPerLineStep(getHostWindow()); |
| 581 } | 581 } |
| 582 | 582 |
| 583 int ScrollableArea::pageStep(ScrollbarOrientation orientation) const | 583 int ScrollableArea::pageStep(ScrollbarOrientation orientation) const |
| 584 { | 584 { |
| 585 IntRect visibleRect = visibleContentRect(IncludeScrollbars); | 585 IntRect visibleRect = visibleContentRect(IncludeScrollbars); |
| 586 int length = (orientation == HorizontalScrollbar) ? visibleRect.width() : vi
sibleRect.height(); | 586 int length = (orientation == HorizontalScrollbar) ? visibleRect.width() : vi
sibleRect.height(); |
| 587 int minPageStep = static_cast<float>(length) * minFractionToStepWhenPaging()
; | 587 int minPageStep = static_cast<float>(length) * minFractionToStepWhenPaging()
; |
| 588 int pageStep = std::max(minPageStep, length - maxOverlapBetweenPages()); | 588 int pageStep = std::max(minPageStep, length - maxOverlapBetweenPages()); |
| 589 | 589 |
| 590 return std::max(pageStep, 1); | 590 return std::max(pageStep, 1); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 614 std::max(0, size.height() - horizontalScrollbarHeight)); | 614 std::max(0, size.height() - horizontalScrollbarHeight)); |
| 615 } | 615 } |
| 616 | 616 |
| 617 DEFINE_TRACE(ScrollableArea) | 617 DEFINE_TRACE(ScrollableArea) |
| 618 { | 618 { |
| 619 visitor->trace(m_scrollAnimator); | 619 visitor->trace(m_scrollAnimator); |
| 620 visitor->trace(m_programmaticScrollAnimator); | 620 visitor->trace(m_programmaticScrollAnimator); |
| 621 } | 621 } |
| 622 | 622 |
| 623 } // namespace blink | 623 } // namespace blink |
| OLD | NEW |