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

Issue 2935813002: "Find" scrolling should be smoothly animated. (Closed)

Created:
3 years, 6 months ago by sunyunjia
Modified:
3 years, 6 months ago
Reviewers:
bokan, scottmg
CC:
chromium-reviews, blink-reviews, kinuko+watch, platform-architecture-syd+reviews-web_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

"Find" scrolling should be smoothly animated. Previously, when we "Find" (Ctr + F) something in the webpage, the page abruptly scrolls the element into view, which makes it harder for users' eyes to keep track. As Safari is using smooth scroll for the "Find" feature, we implement this feature by setting the ScrollBehavior as "smooth" when calling scrollRectoToVisible(). BUG=702966 Review-Url: https://codereview.chromium.org/2935813002 Cr-Commit-Position: refs/heads/master@{#479133} Committed: https://chromium.googlesource.com/chromium/src/+/e790c147386fdd83a00c71b62a54908a73a27dd6

Patch Set 1 #

Total comments: 6

Patch Set 2 : Move smooth scroll logic to LayoutBox #

Total comments: 1

Patch Set 3 : Rebase and set ScrollRectToVisibleRecursive() to private. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+58 lines, -8 lines) Patch
M third_party/WebKit/Source/core/dom/Element.cpp View 1 1 chunk +0 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/editing/Editor.cpp View 1 1 chunk +4 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.h View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.cpp View 1 2 chunks +20 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/web/tests/SmoothScrollTest.cpp View 1 2 2 chunks +27 lines, -0 lines 0 comments Download

Messages

Total messages: 33 (23 generated)
sunyunjia
Hi David, This is a fix of a small bug with the help of smooth-scroll's ...
3 years, 6 months ago (2017-06-12 21:17:57 UTC) #9
bokan
https://codereview.chromium.org/2935813002/diff/1/third_party/WebKit/Source/core/editing/Editor.cpp File third_party/WebKit/Source/core/editing/Editor.cpp (left): https://codereview.chromium.org/2935813002/diff/1/third_party/WebKit/Source/core/editing/Editor.cpp#oldcode1621 third_party/WebKit/Source/core/editing/Editor.cpp:1621: ScrollAlignment::kAlignCenterIfNeeded, kUserScroll); On 2017/06/12 21:17:57, sunyunjia wrote: > Not ...
3 years, 6 months ago (2017-06-13 01:48:09 UTC) #12
sunyunjia
PTAL, thanks! https://codereview.chromium.org/2935813002/diff/1/third_party/WebKit/Source/core/editing/Editor.cpp File third_party/WebKit/Source/core/editing/Editor.cpp (right): https://codereview.chromium.org/2935813002/diff/1/third_party/WebKit/Source/core/editing/Editor.cpp#newcode1618 third_party/WebKit/Source/core/editing/Editor.cpp:1618: first_node->GetDocument() On 2017/06/13 01:48:08, bokan wrote: > ...
3 years, 6 months ago (2017-06-13 17:45:11 UTC) #15
bokan
lgtm % one small change https://codereview.chromium.org/2935813002/diff/20001/third_party/WebKit/Source/core/layout/LayoutBox.h File third_party/WebKit/Source/core/layout/LayoutBox.h (right): https://codereview.chromium.org/2935813002/diff/20001/third_party/WebKit/Source/core/layout/LayoutBox.h#newcode591 third_party/WebKit/Source/core/layout/LayoutBox.h:591: void ScrollRectToVisibleRecursive(const LayoutRect&, This ...
3 years, 6 months ago (2017-06-13 17:58:51 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2935813002/40001
3 years, 6 months ago (2017-06-13 20:30:13 UTC) #25
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/e790c147386fdd83a00c71b62a54908a73a27dd6
3 years, 6 months ago (2017-06-13 20:35:44 UTC) #28
scottmg
Was there a UI review for this change? It feel pretty unusable on long pages ...
3 years, 6 months ago (2017-06-14 16:38:49 UTC) #30
scottmg
On 2017/06/14 16:38:49, scottmg wrote: > Was there a UI review for this change? It ...
3 years, 6 months ago (2017-06-14 16:40:17 UTC) #31
scottmg
A revert of this CL (patchset #3 id:40001) has been created in https://codereview.chromium.org/2942673002/ by scottmg@chromium.org. ...
3 years, 6 months ago (2017-06-14 16:44:12 UTC) #32
bokan
3 years, 6 months ago (2017-06-14 16:44:32 UTC) #33
Message was sent while issue was closed.
On 2017/06/14 16:40:17, scottmg wrote:
> On 2017/06/14 16:38:49, scottmg wrote:
> > Was there a UI review for this change? It feel pretty unusable on long pages
> as
> > the scroll can take several seconds.

We should probably scroll super fast in these long cases or just make it
instant. That said, I agree we should loop in someone from UX to review - do you
know who'd be relevant here? Otherwise I can try and find someone.

> 
> Additionally, I think it needs to respect the OS-level smooth scrolling
> behaviour. If mouse wheel and scroll bar scrolling are not smoothed, then
> find-in-page shouldn't be either.

Agreed, all smooth scrolls should respect the OS level setting (including if the
page requests a smooth scroll). sunyunjia@, please file a bug for this.

Powered by Google App Engine
This is Rietveld 408576698