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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp

Issue 2650343008: Implement Element.scrollIntoView for scroll-behavior: smooth. (Closed)
Patch Set: Added SimTest. Created 3 years, 10 months 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
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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 // TODO(bokan): The userScroll method should probably be modified to call this 242 // TODO(bokan): The userScroll method should probably be modified to call this
243 // method and ScrollAnimatorBase to have a simpler 243 // method and ScrollAnimatorBase to have a simpler
244 // animateToOffset method like the ProgrammaticScrollAnimator. 244 // animateToOffset method like the ProgrammaticScrollAnimator.
245 ASSERT(scrollBehavior == ScrollBehaviorInstant); 245 ASSERT(scrollBehavior == ScrollBehaviorInstant);
246 scrollAnimator().scrollToOffsetWithoutAnimation(ScrollOffset(x, y)); 246 scrollAnimator().scrollToOffsetWithoutAnimation(ScrollOffset(x, y));
247 } 247 }
248 248
249 LayoutRect ScrollableArea::scrollIntoView(const LayoutRect& rectInContent, 249 LayoutRect ScrollableArea::scrollIntoView(const LayoutRect& rectInContent,
250 const ScrollAlignment& alignX, 250 const ScrollAlignment& alignX,
251 const ScrollAlignment& alignY, 251 const ScrollAlignment& alignY,
252 ScrollType) { 252 ScrollType,
253 bool isSmooth) {
253 // TODO(bokan): This should really be implemented here but ScrollAlignment is 254 // TODO(bokan): This should really be implemented here but ScrollAlignment is
254 // in Core which is a dependency violation. 255 // in Core which is a dependency violation.
255 ASSERT_NOT_REACHED(); 256 ASSERT_NOT_REACHED();
256 return LayoutRect(); 257 return LayoutRect();
257 } 258 }
258 259
259 void ScrollableArea::scrollOffsetChanged(const ScrollOffset& offset, 260 void ScrollableArea::scrollOffsetChanged(const ScrollOffset& offset,
260 ScrollType scrollType) { 261 ScrollType scrollType) {
261 TRACE_EVENT0("blink", "ScrollableArea::scrollOffsetChanged"); 262 TRACE_EVENT0("blink", "ScrollableArea::scrollOffsetChanged");
262 263
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 offset.y() - scrollOrigin().y()); 668 offset.y() - scrollOrigin().y());
668 setScrollOffset(newOffset, CompositorScroll); 669 setScrollOffset(newOffset, CompositorScroll);
669 } 670 }
670 671
671 DEFINE_TRACE(ScrollableArea) { 672 DEFINE_TRACE(ScrollableArea) {
672 visitor->trace(m_scrollAnimator); 673 visitor->trace(m_scrollAnimator);
673 visitor->trace(m_programmaticScrollAnimator); 674 visitor->trace(m_programmaticScrollAnimator);
674 } 675 }
675 676
676 } // namespace blink 677 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698