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

Side by Side Diff: Source/platform/scroll/ScrollAnimatorNone.cpp

Issue 792513004: Implement CSSOM smooth scroll for Elements (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/scroll/ScrollAnimatorNone.h ('k') | Source/platform/scroll/ScrollableArea.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011, Google Inc. All rights reserved. 2 * Copyright (c) 2011, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 421
422 // This is an animatable scroll. Set the animation in motion using the appro priate parameters. 422 // This is an animatable scroll. Set the animation in motion using the appro priate parameters.
423 float scrollableSize = static_cast<float>(m_scrollableArea->scrollSize(orien tation)); 423 float scrollableSize = static_cast<float>(m_scrollableArea->scrollSize(orien tation));
424 424
425 PerAxisData& data = (orientation == VerticalScrollbar) ? m_verticalData : m_ horizontalData; 425 PerAxisData& data = (orientation == VerticalScrollbar) ? m_verticalData : m_ horizontalData;
426 bool needToScroll = data.updateDataFromParameters(step, delta, scrollableSiz e, WTF::monotonicallyIncreasingTime(), &parameters); 426 bool needToScroll = data.updateDataFromParameters(step, delta, scrollableSiz e, WTF::monotonicallyIncreasingTime(), &parameters);
427 if (needToScroll && !animationTimerActive()) { 427 if (needToScroll && !animationTimerActive()) {
428 m_startTime = data.m_startTime; 428 m_startTime = data.m_startTime;
429 animationWillStart(); 429 animationWillStart();
430 animationTimerFired(); 430 animationTimerFired();
431 scrollableArea()->registerForAnimation();
431 } 432 }
432 return needToScroll; 433 return needToScroll;
433 } 434 }
434 435
435 void ScrollAnimatorNone::scrollToOffsetWithoutAnimation(const FloatPoint& offset ) 436 void ScrollAnimatorNone::scrollToOffsetWithoutAnimation(const FloatPoint& offset )
436 { 437 {
437 stopAnimationTimerIfNeeded(); 438 stopAnimationTimerIfNeeded();
438 439
439 m_horizontalData.reset(); 440 m_horizontalData.reset();
440 *m_horizontalData.m_currentPosition = offset.x(); 441 *m_horizontalData.m_currentPosition = offset.x();
(...skipping 12 matching lines...) Expand all
453 { 454 {
454 m_animationActive = false; 455 m_animationActive = false;
455 } 456 }
456 457
457 void ScrollAnimatorNone::serviceScrollAnimations() 458 void ScrollAnimatorNone::serviceScrollAnimations()
458 { 459 {
459 if (m_animationActive) 460 if (m_animationActive)
460 animationTimerFired(); 461 animationTimerFired();
461 } 462 }
462 463
464 bool ScrollAnimatorNone::hasRunningAnimation() const
465 {
466 return m_animationActive;
467 }
468
463 void ScrollAnimatorNone::willEndLiveResize() 469 void ScrollAnimatorNone::willEndLiveResize()
464 { 470 {
465 updateVisibleLengths(); 471 updateVisibleLengths();
466 } 472 }
467 473
468 void ScrollAnimatorNone::didAddVerticalScrollbar(Scrollbar*) 474 void ScrollAnimatorNone::didAddVerticalScrollbar(Scrollbar*)
469 { 475 {
470 updateVisibleLengths(); 476 updateVisibleLengths();
471 } 477 }
472 478
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 return m_animationActive; 522 return m_animationActive;
517 } 523 }
518 524
519 void ScrollAnimatorNone::stopAnimationTimerIfNeeded() 525 void ScrollAnimatorNone::stopAnimationTimerIfNeeded()
520 { 526 {
521 if (animationTimerActive()) 527 if (animationTimerActive())
522 m_animationActive = false; 528 m_animationActive = false;
523 } 529 }
524 530
525 } // namespace blink 531 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/scroll/ScrollAnimatorNone.h ('k') | Source/platform/scroll/ScrollableArea.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698