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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 2935813002: "Find" scrolling should be smoothly animated. (Closed)
Patch Set: Rebase and set ScrollRectToVisibleRecursive() to private. 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 8c1b379e40db31e9000cad793d53d6ef81948036..1fd325601d713ad5dd94557677fbc2ae982ec446 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -650,6 +650,23 @@ void LayoutBox::ScrollRectToVisible(const LayoutRect& rect,
ScrollType scroll_type,
bool make_visible_in_visual_viewport,
ScrollBehavior scroll_behavior) {
+ SmoothScrollSequencer* sequencer =
+ GetFrame()->GetPage()->GetSmoothScrollSequencer();
+ sequencer->AbortAnimations();
+ ScrollRectToVisibleRecursive(rect, align_x, align_y, scroll_type,
+ make_visible_in_visual_viewport,
+ scroll_behavior);
+ if (scroll_behavior == kScrollBehaviorSmooth)
+ sequencer->RunQueuedAnimations();
+}
+
+void LayoutBox::ScrollRectToVisibleRecursive(
+ const LayoutRect& rect,
+ const ScrollAlignment& align_x,
+ const ScrollAlignment& align_y,
+ ScrollType scroll_type,
+ bool make_visible_in_visual_viewport,
+ ScrollBehavior scroll_behavior) {
DCHECK(scroll_type == kProgrammaticScroll || scroll_type == kUserScroll);
// Presumably the same issue as in setScrollTop. See crbug.com/343132.
DisableCompositingQueryAsserts disabler;
@@ -724,9 +741,9 @@ void LayoutBox::ScrollRectToVisible(const LayoutRect& rect,
parent_box = EnclosingScrollableBox();
if (parent_box) {
- parent_box->ScrollRectToVisible(new_rect, align_x, align_y, scroll_type,
- make_visible_in_visual_viewport,
- scroll_behavior);
+ parent_box->ScrollRectToVisibleRecursive(
+ new_rect, align_x, align_y, scroll_type,
+ make_visible_in_visual_viewport, scroll_behavior);
}
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | third_party/WebKit/Source/web/tests/SmoothScrollTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698