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

Side by Side Diff: Source/platform/scroll/ScrollableArea.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/ScrollableArea.h ('k') | no next file » | 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) 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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 { 423 {
424 if (HostWindow* window = hostWindow()) { 424 if (HostWindow* window = hostWindow()) {
425 window->scheduleAnimation(); 425 window->scheduleAnimation();
426 return true; 426 return true;
427 } 427 }
428 return false; 428 return false;
429 } 429 }
430 430
431 void ScrollableArea::serviceScrollAnimations(double monotonicTime) 431 void ScrollableArea::serviceScrollAnimations(double monotonicTime)
432 { 432 {
433 if (ScrollAnimator* scrollAnimator = existingScrollAnimator()) 433 bool hasRunningAnimation = false;
434 if (ScrollAnimator* scrollAnimator = existingScrollAnimator()) {
434 scrollAnimator->serviceScrollAnimations(); 435 scrollAnimator->serviceScrollAnimations();
435 if (ProgrammaticScrollAnimator* programmaticScrollAnimator = existingProgram maticScrollAnimator()) 436 if (scrollAnimator->hasRunningAnimation())
437 hasRunningAnimation = true;
438 }
439 if (ProgrammaticScrollAnimator* programmaticScrollAnimator = existingProgram maticScrollAnimator()) {
436 programmaticScrollAnimator->tickAnimation(monotonicTime); 440 programmaticScrollAnimator->tickAnimation(monotonicTime);
441 if (programmaticScrollAnimator->hasRunningAnimation())
442 hasRunningAnimation = true;
443 }
444 if (!hasRunningAnimation)
445 deregisterForAnimation();
437 } 446 }
438 447
439 void ScrollableArea::cancelProgrammaticScrollAnimation() 448 void ScrollableArea::cancelProgrammaticScrollAnimation()
440 { 449 {
441 if (ProgrammaticScrollAnimator* programmaticScrollAnimator = existingProgram maticScrollAnimator()) 450 if (ProgrammaticScrollAnimator* programmaticScrollAnimator = existingProgram maticScrollAnimator())
442 programmaticScrollAnimator->cancelAnimation(); 451 programmaticScrollAnimator->cancelAnimation();
443 } 452 }
444 453
445 IntRect ScrollableArea::visibleContentRect(IncludeScrollbarsInRect scrollbarIncl usion) const 454 IntRect ScrollableArea::visibleContentRect(IncludeScrollbarsInRect scrollbarIncl usion) const
446 { 455 {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 { 492 {
484 return scrollSize(orientation); 493 return scrollSize(orientation);
485 } 494 }
486 495
487 float ScrollableArea::pixelStep(ScrollbarOrientation) const 496 float ScrollableArea::pixelStep(ScrollbarOrientation) const
488 { 497 {
489 return 1; 498 return 1;
490 } 499 }
491 500
492 } // namespace blink 501 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/scroll/ScrollableArea.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698