commit | 76e4800ce07e2cdf134a14bdfb65e6e31d3d2f12 | [log] [tgz] |
---|---|---|
author | Oriol Brufau <obrufau@igalia.com> | Thu Feb 21 23:09:27 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Thu Feb 21 23:09:27 2019 |
tree | 414d671fbbbd36ca98f384def7af7a116e0a0511 | |
parent | b21942adfa3c6cf09083423a9f34edfcfc287c17 [diff] |
Let editing scroll hidden cursor into nearest edge instead of the center When writing text inside a scroll container with fixed height, the cursor eventually moves outside the visible area. At that point it's scrolled back into view. Before this patch it was moved as much as possible into the center of the visible area, the problem with this was when writing text at the end of a container with bottom padding. When the cursor was overflowing the content area but still in the padding area, it was still into view, so no scroll happened. But after leaving the padding area, the scrollbar was scrolled to the bottom, moving the cursor into the content area. This behavior seemed inconsistent, giving the impression that sometimes it was trying to keep the cursor inside the content area and sometimes not caring that the cursor was in the padding area. After this patch, a hidden cursor is only scrolled into the nearest edge of the visible area. This aligns Chromium with Firefox and Edge. BUG=931838 TEST=editing/input/caret-at-the-edge-of-contenteditable.html TEST=editing/input/caret-at-the-edge-of-input.html TEST=editing/input/reveal-caret-of-multiline-contenteditable.html TEST=editing/input/reveal-caret-of-multiline-input.html TEST=editing/input/reveal-contenteditable-on-input-vertically.html TEST=editing/input/reveal-edit-on-input-vertically.html TEST=fast/forms/text/input-text-scroll-left-on-blur.html Change-Id: I584e9c85d3eabd4ace1b694906cd6f7649c58443 Reviewed-on: https://chromium-review.googlesource.com/c/1477255 Reviewed-by: Yoshifumi Inoue <yosin@chromium.org> Commit-Queue: Oriol Brufau <obrufau@igalia.com> Cr-Commit-Position: refs/heads/master@{#634393}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .