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

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

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

Powered by Google App Engine
This is Rietveld 408576698