Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/Editor.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp |
| index e31a15ba917ac60211ce405a3072e80fae1ad9d7..47f6887bf0b08ca507983807103645a681f3064c 100644 |
| --- a/third_party/WebKit/Source/core/editing/Editor.cpp |
| +++ b/third_party/WebKit/Source/core/editing/Editor.cpp |
| @@ -1615,10 +1615,26 @@ Range* Editor::FindStringAndScrollToVisible(const String& target, |
| return nullptr; |
| Node* first_node = next_match->FirstNode(); |
| - first_node->GetLayoutObject()->ScrollRectToVisible( |
| - LayoutRect(next_match->BoundingBox()), |
| - ScrollAlignment::kAlignCenterIfNeeded, |
| - ScrollAlignment::kAlignCenterIfNeeded, kUserScroll); |
|
sunyunjia
2017/06/12 21:17:57
Not sure why this was kUserScroll. Perhaps we shou
bokan
2017/06/13 01:48:08
Acknowledged.
|
| + first_node->GetDocument() |
|
bokan
2017/06/13 01:48:08
This leaks too many details of how smooth scroll a
sunyunjia
2017/06/13 17:45:11
Done.
|
| + .GetPage() |
| + ->GetSmoothScrollSequencer() |
| + ->AbortAnimations(); |
| + if (RuntimeEnabledFeatures::CSSOMSmoothScrollEnabled()) { |
|
bokan
2017/06/13 01:48:08
This has no web-facing consequences so there's no
sunyunjia
2017/06/13 17:45:11
Done.
|
| + first_node->GetLayoutObject()->ScrollRectToVisible( |
| + LayoutRect(next_match->BoundingBox()), |
| + ScrollAlignment::kAlignCenterIfNeeded, |
| + ScrollAlignment::kAlignCenterIfNeeded, kProgrammaticScroll, true, |
| + kScrollBehaviorSmooth); |
| + first_node->GetDocument() |
| + .GetPage() |
| + ->GetSmoothScrollSequencer() |
| + ->RunQueuedAnimations(); |
| + } else { |
| + first_node->GetLayoutObject()->ScrollRectToVisible( |
| + LayoutRect(next_match->BoundingBox()), |
| + ScrollAlignment::kAlignCenterIfNeeded, |
| + ScrollAlignment::kAlignCenterIfNeeded, kUserScroll); |
| + } |
| first_node->GetDocument().SetSequentialFocusNavigationStartingPoint( |
| first_node); |