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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h

Issue 2650343008: Implement Element.scrollIntoView for scroll-behavior: smooth. (Closed)
Patch Set: Added SimTest. Created 3 years, 9 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) 2003, 2009, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 233
234 Scrollbar* horizontalScrollbar() const override { 234 Scrollbar* horizontalScrollbar() const override {
235 return m_scrollbarManager.horizontalScrollbar(); 235 return m_scrollbarManager.horizontalScrollbar();
236 } 236 }
237 Scrollbar* verticalScrollbar() const override { 237 Scrollbar* verticalScrollbar() const override {
238 return m_scrollbarManager.verticalScrollbar(); 238 return m_scrollbarManager.verticalScrollbar();
239 } 239 }
240 240
241 HostWindow* getHostWindow() const override; 241 HostWindow* getHostWindow() const override;
242 242
243 ProgrammaticScrollCoordinator* getProgrammaticScrollCoordinator()
244 const override;
245
243 // For composited scrolling, we allocate an extra GraphicsLayer to hold 246 // For composited scrolling, we allocate an extra GraphicsLayer to hold
244 // onto the scrolling content. The layer can be shifted on the GPU and 247 // onto the scrolling content. The layer can be shifted on the GPU and
245 // composited at little cost. 248 // composited at little cost.
246 // Note that this is done in CompositedLayerMapping, this function being 249 // Note that this is done in CompositedLayerMapping, this function being
247 // only a helper. 250 // only a helper.
248 GraphicsLayer* layerForScrolling() const override; 251 GraphicsLayer* layerForScrolling() const override;
249 252
250 // GraphicsLayers for the scrolling components. 253 // GraphicsLayers for the scrolling components.
251 // 254 //
252 // Any function can return nullptr if they are not accelerated. 255 // Any function can return nullptr if they are not accelerated.
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 bool hitTestOverflowControls(HitTestResult&, const IntPoint& localPoint); 372 bool hitTestOverflowControls(HitTestResult&, const IntPoint& localPoint);
370 373
371 bool hitTestResizerInFragments(const PaintLayerFragments&, 374 bool hitTestResizerInFragments(const PaintLayerFragments&,
372 const HitTestLocation&) const; 375 const HitTestLocation&) const;
373 376
374 // Returns the new offset, after scrolling, of the given rect in absolute 377 // Returns the new offset, after scrolling, of the given rect in absolute
375 // coordinates, clipped by the parent's client rect. 378 // coordinates, clipped by the parent's client rect.
376 LayoutRect scrollIntoView(const LayoutRect&, 379 LayoutRect scrollIntoView(const LayoutRect&,
377 const ScrollAlignment& alignX, 380 const ScrollAlignment& alignX,
378 const ScrollAlignment& alignY, 381 const ScrollAlignment& alignY,
379 ScrollType = ProgrammaticScroll) override; 382 ScrollType = ProgrammaticScroll,
383 bool isSmooth = false) override;
380 384
381 // Returns true if scrollable area is in the FrameView's collection of 385 // Returns true if scrollable area is in the FrameView's collection of
382 // scrollable areas. This can only happen if we're scrollable, visible to hit 386 // scrollable areas. This can only happen if we're scrollable, visible to hit
383 // test, and do in fact overflow. This means that 'overflow: hidden' or 387 // test, and do in fact overflow. This means that 'overflow: hidden' or
384 // 'pointer-events: none' layers never get added to the FrameView's 388 // 'pointer-events: none' layers never get added to the FrameView's
385 // collection. 389 // collection.
386 bool scrollsOverflow() const { return m_scrollsOverflow; } 390 bool scrollsOverflow() const { return m_scrollsOverflow; }
387 391
388 // Rectangle encompassing the scroll corner and resizer rect. 392 // Rectangle encompassing the scroll corner and resizer rect.
389 IntRect scrollCornerAndResizerRect() const final; 393 IntRect scrollCornerAndResizerRect() const final;
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 602
599 DEFINE_TYPE_CASTS(PaintLayerScrollableArea, 603 DEFINE_TYPE_CASTS(PaintLayerScrollableArea,
600 ScrollableArea, 604 ScrollableArea,
601 scrollableArea, 605 scrollableArea,
602 scrollableArea->isPaintLayerScrollableArea(), 606 scrollableArea->isPaintLayerScrollableArea(),
603 scrollableArea.isPaintLayerScrollableArea()); 607 scrollableArea.isPaintLayerScrollableArea());
604 608
605 } // namespace blink 609 } // namespace blink
606 610
607 #endif // LayerScrollableArea_h 611 #endif // LayerScrollableArea_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698