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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.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) 1997 Martin Jones (mjones@kde.org) 2 Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 (C) 1998 Waldo Bastian (bastian@kde.org) 3 (C) 1998 Waldo Bastian (bastian@kde.org)
4 (C) 1998, 1999 Torben Weis (weis@kde.org) 4 (C) 1998, 1999 Torben Weis (weis@kde.org)
5 (C) 1999 Lars Knoll (knoll@kde.org) 5 (C) 1999 Lars Knoll (knoll@kde.org)
6 (C) 1999 Antti Koivisto (koivisto@kde.org) 6 (C) 1999 Antti Koivisto (koivisto@kde.org)
7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights 7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
8 reserved. 8 reserved.
9 9
10 This library is free software; you can redistribute it and/or 10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Library General Public 11 modify it under the terms of the GNU Library General Public
12 License as published by the Free Software Foundation; either 12 License as published by the Free Software Foundation; either
13 version 2 of the License, or (at your option) any later version. 13 version 2 of the License, or (at your option) any later version.
14 14
15 This library is distributed in the hope that it will be useful, 15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Library General Public License for more details. 18 Library General Public License for more details.
19 19
20 You should have received a copy of the GNU Library General Public License 20 You should have received a copy of the GNU Library General Public License
21 along with this library; see the file COPYING.LIB. If not, write to 21 along with this library; see the file COPYING.LIB. If not, write to
22 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 Boston, MA 02110-1301, USA. 23 Boston, MA 02110-1301, USA.
24 */ 24 */
25 25
26 #ifndef FrameView_h 26 #ifndef FrameView_h
27 #define FrameView_h 27 #define FrameView_h
28 28
29 #include <memory>
29 #include "core/CoreExport.h" 30 #include "core/CoreExport.h"
30 #include "core/dom/DocumentLifecycle.h" 31 #include "core/dom/DocumentLifecycle.h"
31 #include "core/frame/FrameViewAutoSizeInfo.h" 32 #include "core/frame/FrameViewAutoSizeInfo.h"
32 #include "core/frame/LayoutSubtreeRootList.h" 33 #include "core/frame/LayoutSubtreeRootList.h"
33 #include "core/frame/RootFrameViewport.h" 34 #include "core/frame/RootFrameViewport.h"
34 #include "core/layout/MapCoordinatesFlags.h" 35 #include "core/layout/MapCoordinatesFlags.h"
35 #include "core/layout/ScrollAnchor.h" 36 #include "core/layout/ScrollAnchor.h"
36 #include "core/paint/FirstMeaningfulPaintDetector.h" 37 #include "core/paint/FirstMeaningfulPaintDetector.h"
37 #include "core/paint/ObjectPaintProperties.h" 38 #include "core/paint/ObjectPaintProperties.h"
38 #include "core/paint/PaintInvalidationCapableScrollableArea.h" 39 #include "core/paint/PaintInvalidationCapableScrollableArea.h"
39 #include "core/paint/PaintPhase.h" 40 #include "core/paint/PaintPhase.h"
40 #include "core/paint/ScrollbarManager.h" 41 #include "core/paint/ScrollbarManager.h"
41 #include "platform/RuntimeEnabledFeatures.h" 42 #include "platform/RuntimeEnabledFeatures.h"
42 #include "platform/Widget.h" 43 #include "platform/Widget.h"
43 #include "platform/animation/CompositorAnimationHost.h" 44 #include "platform/animation/CompositorAnimationHost.h"
44 #include "platform/animation/CompositorAnimationTimeline.h" 45 #include "platform/animation/CompositorAnimationTimeline.h"
45 #include "platform/geometry/IntRect.h" 46 #include "platform/geometry/IntRect.h"
46 #include "platform/geometry/LayoutRect.h" 47 #include "platform/geometry/LayoutRect.h"
47 #include "platform/graphics/Color.h" 48 #include "platform/graphics/Color.h"
48 #include "platform/graphics/GraphicsLayerClient.h" 49 #include "platform/graphics/GraphicsLayerClient.h"
50 #include "platform/scroll/ProgrammaticScrollCoordinator.h"
49 #include "platform/scroll/ScrollTypes.h" 51 #include "platform/scroll/ScrollTypes.h"
50 #include "platform/scroll/Scrollbar.h" 52 #include "platform/scroll/Scrollbar.h"
51 #include "public/platform/ShapeProperties.h" 53 #include "public/platform/ShapeProperties.h"
52 #include "public/platform/WebDisplayMode.h" 54 #include "public/platform/WebDisplayMode.h"
53 #include "public/platform/WebRect.h" 55 #include "public/platform/WebRect.h"
54 #include "wtf/Allocator.h" 56 #include "wtf/Allocator.h"
55 #include "wtf/AutoReset.h" 57 #include "wtf/AutoReset.h"
56 #include "wtf/Forward.h" 58 #include "wtf/Forward.h"
57 #include "wtf/HashSet.h" 59 #include "wtf/HashSet.h"
58 #include "wtf/ListHashSet.h" 60 #include "wtf/ListHashSet.h"
59 #include "wtf/text/WTFString.h" 61 #include "wtf/text/WTFString.h"
60 #include <memory>
61 62
62 namespace blink { 63 namespace blink {
63 64
64 class AXObjectCache; 65 class AXObjectCache;
65 class ComputedStyle; 66 class ComputedStyle;
66 class DocumentLifecycle; 67 class DocumentLifecycle;
67 class Cursor; 68 class Cursor;
68 class Element; 69 class Element;
69 class ElementVisibilityObserver; 70 class ElementVisibilityObserver;
70 class Frame; 71 class Frame;
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 CompositorAnimationTimeline* compositorAnimationTimeline() const override; 447 CompositorAnimationTimeline* compositorAnimationTimeline() const override;
447 LayoutBox* layoutBox() const override; 448 LayoutBox* layoutBox() const override;
448 FloatQuad localToVisibleContentQuad(const FloatQuad&, 449 FloatQuad localToVisibleContentQuad(const FloatQuad&,
449 const LayoutObject*, 450 const LayoutObject*,
450 unsigned = 0) const final; 451 unsigned = 0) const final;
451 RefPtr<WebTaskRunner> getTimerTaskRunner() const final; 452 RefPtr<WebTaskRunner> getTimerTaskRunner() const final;
452 453
453 LayoutRect scrollIntoView(const LayoutRect& rectInContent, 454 LayoutRect scrollIntoView(const LayoutRect& rectInContent,
454 const ScrollAlignment& alignX, 455 const ScrollAlignment& alignX,
455 const ScrollAlignment& alignY, 456 const ScrollAlignment& alignY,
456 ScrollType = ProgrammaticScroll) override; 457 ScrollType = ProgrammaticScroll,
458 bool isSmooth = false) override;
457 459
458 // The window that hosts the FrameView. The FrameView will communicate scrolls 460 // The window that hosts the FrameView. The FrameView will communicate scrolls
459 // and repaints to the host window in the window's coordinate space. 461 // and repaints to the host window in the window's coordinate space.
460 HostWindow* getHostWindow() const; 462 HostWindow* getHostWindow() const;
461 463
464 ProgrammaticScrollCoordinator* getProgrammaticScrollCoordinator()
bokan 2017/03/28 16:29:53 Please change the name to avoid confusion with the
sunyunjia 2017/04/07 13:53:21 Done.
465 const override;
466
462 typedef HeapHashSet<Member<Widget>> ChildrenWidgetSet; 467 typedef HeapHashSet<Member<Widget>> ChildrenWidgetSet;
463 468
464 // Functions for child manipulation and inspection. 469 // Functions for child manipulation and inspection.
465 void setParent(Widget*) override; 470 void setParent(Widget*) override;
466 void removeChild(Widget*); 471 void removeChild(Widget*);
467 void addChild(Widget*); 472 void addChild(Widget*);
468 const ChildrenWidgetSet* children() const { return &m_children; } 473 const ChildrenWidgetSet* children() const { return &m_children; }
469 474
470 // If the scroll view does not use a native widget, then it will have 475 // If the scroll view does not use a native widget, then it will have
471 // cross-platform Scrollbars. These functions can be used to obtain those 476 // cross-platform Scrollbars. These functions can be used to obtain those
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
1251 widget.isFrameView()); 1256 widget.isFrameView());
1252 DEFINE_TYPE_CASTS(FrameView, 1257 DEFINE_TYPE_CASTS(FrameView,
1253 ScrollableArea, 1258 ScrollableArea,
1254 scrollableArea, 1259 scrollableArea,
1255 scrollableArea->isFrameView(), 1260 scrollableArea->isFrameView(),
1256 scrollableArea.isFrameView()); 1261 scrollableArea.isFrameView());
1257 1262
1258 } // namespace blink 1263 } // namespace blink
1259 1264
1260 #endif // FrameView_h 1265 #endif // FrameView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698