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

Side by Side Diff: third_party/WebKit/Source/core/page/Page.cpp

Issue 2650343008: Implement Element.scrollIntoView for scroll-behavior: smooth. (Closed)
Patch Set: Fixed nits. Created 3 years, 6 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) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All
3 * Rights Reserved. 3 * Rights Reserved.
4 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. 4 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved.
5 * (http://www.torchmobile.com/) 5 * (http://www.torchmobile.com/)
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 #include "core/page/ValidationMessageClient.h" 54 #include "core/page/ValidationMessageClient.h"
55 #include "core/page/scrolling/OverscrollController.h" 55 #include "core/page/scrolling/OverscrollController.h"
56 #include "core/page/scrolling/ScrollingCoordinator.h" 56 #include "core/page/scrolling/ScrollingCoordinator.h"
57 #include "core/page/scrolling/TopDocumentRootScrollerController.h" 57 #include "core/page/scrolling/TopDocumentRootScrollerController.h"
58 #include "core/paint/PaintLayer.h" 58 #include "core/paint/PaintLayer.h"
59 #include "core/probe/CoreProbes.h" 59 #include "core/probe/CoreProbes.h"
60 #include "platform/WebFrameScheduler.h" 60 #include "platform/WebFrameScheduler.h"
61 #include "platform/graphics/GraphicsLayer.h" 61 #include "platform/graphics/GraphicsLayer.h"
62 #include "platform/loader/fetch/ResourceFetcher.h" 62 #include "platform/loader/fetch/ResourceFetcher.h"
63 #include "platform/plugins/PluginData.h" 63 #include "platform/plugins/PluginData.h"
64 #include "platform/scroll/SmoothScrollSequencer.h"
64 #include "public/platform/Platform.h" 65 #include "public/platform/Platform.h"
65 66
66 namespace blink { 67 namespace blink {
67 68
68 // Set of all live pages; includes internal Page objects that are 69 // Set of all live pages; includes internal Page objects that are
69 // not observable from scripts. 70 // not observable from scripts.
70 static Page::PageSet& AllPages() { 71 static Page::PageSet& AllPages() {
71 DEFINE_STATIC_LOCAL(Page::PageSet, pages, ()); 72 DEFINE_STATIC_LOCAL(Page::PageSet, pages, ());
72 return pages; 73 return pages;
73 } 74 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 if (!scrolling_coordinator_ && settings_->GetAcceleratedCompositingEnabled()) 166 if (!scrolling_coordinator_ && settings_->GetAcceleratedCompositingEnabled())
166 scrolling_coordinator_ = ScrollingCoordinator::Create(this); 167 scrolling_coordinator_ = ScrollingCoordinator::Create(this);
167 168
168 return scrolling_coordinator_.Get(); 169 return scrolling_coordinator_.Get();
169 } 170 }
170 171
171 PageScaleConstraintsSet& Page::GetPageScaleConstraintsSet() { 172 PageScaleConstraintsSet& Page::GetPageScaleConstraintsSet() {
172 return *page_scale_constraints_set_; 173 return *page_scale_constraints_set_;
173 } 174 }
174 175
176 SmoothScrollSequencer* Page::GetSmoothScrollSequencer() {
177 if (!smooth_scroll_sequencer_)
178 smooth_scroll_sequencer_ = new SmoothScrollSequencer();
179
180 return smooth_scroll_sequencer_.Get();
181 }
182
175 const PageScaleConstraintsSet& Page::GetPageScaleConstraintsSet() const { 183 const PageScaleConstraintsSet& Page::GetPageScaleConstraintsSet() const {
176 return *page_scale_constraints_set_; 184 return *page_scale_constraints_set_;
177 } 185 }
178 186
179 BrowserControls& Page::GetBrowserControls() { 187 BrowserControls& Page::GetBrowserControls() {
180 return *browser_controls_; 188 return *browser_controls_;
181 } 189 }
182 190
183 const BrowserControls& Page::GetBrowserControls() const { 191 const BrowserControls& Page::GetBrowserControls() const {
184 return *browser_controls_; 192 return *browser_controls_;
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 DEFINE_TRACE(Page) { 621 DEFINE_TRACE(Page) {
614 visitor->Trace(animator_); 622 visitor->Trace(animator_);
615 visitor->Trace(autoscroll_controller_); 623 visitor->Trace(autoscroll_controller_);
616 visitor->Trace(chrome_client_); 624 visitor->Trace(chrome_client_);
617 visitor->Trace(drag_caret_); 625 visitor->Trace(drag_caret_);
618 visitor->Trace(drag_controller_); 626 visitor->Trace(drag_controller_);
619 visitor->Trace(focus_controller_); 627 visitor->Trace(focus_controller_);
620 visitor->Trace(context_menu_controller_); 628 visitor->Trace(context_menu_controller_);
621 visitor->Trace(pointer_lock_controller_); 629 visitor->Trace(pointer_lock_controller_);
622 visitor->Trace(scrolling_coordinator_); 630 visitor->Trace(scrolling_coordinator_);
631 visitor->Trace(smooth_scroll_sequencer_);
623 visitor->Trace(browser_controls_); 632 visitor->Trace(browser_controls_);
624 visitor->Trace(console_message_storage_); 633 visitor->Trace(console_message_storage_);
625 visitor->Trace(event_handler_registry_); 634 visitor->Trace(event_handler_registry_);
626 visitor->Trace(global_root_scroller_controller_); 635 visitor->Trace(global_root_scroller_controller_);
627 visitor->Trace(visual_viewport_); 636 visitor->Trace(visual_viewport_);
628 visitor->Trace(overscroll_controller_); 637 visitor->Trace(overscroll_controller_);
629 visitor->Trace(main_frame_); 638 visitor->Trace(main_frame_);
630 visitor->Trace(plugin_data_); 639 visitor->Trace(plugin_data_);
631 visitor->Trace(validation_message_client_); 640 visitor->Trace(validation_message_client_);
632 visitor->Trace(use_counter_); 641 visitor->Trace(use_counter_);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 : chrome_client(nullptr), 682 : chrome_client(nullptr),
674 context_menu_client(nullptr), 683 context_menu_client(nullptr),
675 editor_client(nullptr), 684 editor_client(nullptr),
676 spell_checker_client(nullptr) {} 685 spell_checker_client(nullptr) {}
677 686
678 Page::PageClients::~PageClients() {} 687 Page::PageClients::~PageClients() {}
679 688
680 template class CORE_TEMPLATE_EXPORT Supplement<Page>; 689 template class CORE_TEMPLATE_EXPORT Supplement<Page>;
681 690
682 } // namespace blink 691 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698