DescriptionMerge 117307 - Avoid jumpscroll when entering new text in a multi-line editor.
https://bugs.webkit.org/show_bug.cgi?id=82875
Reviewed by Ryosuke Niwa
Scroll caret to the edge of the viewport in case if a line break or a paragraph
separator is inserted at the end of a multi-line editor. This avoids
undesirable jumpscroll in cases when there is content under the editor.
Tests: editing/input/scroll-to-edge-if-line-break-at-end-of-document-contenteditable.html
editing/input/scroll-to-edge-if-line-break-at-end-of-document-textarea.html
editing/input/scroll-to-edge-if-paragraph-separator-at-end-of-document-contenteditable.html
* editing/Editor.cpp:
(WebCore::Editor::insertLineBreak):
(WebCore::Editor::insertParagraphSeparator):
(WebCore::Editor::revealSelectionAfterEditingOperation):
* editing/Editor.h:
(Editor):
* editing/input/resources/reveal-utilities.js:
(performJumpAtTheEdgeTest):
* editing/input/scroll-to-edge-if-line-break-at-end-of-document-contenteditable-expected.txt: Added.
* editing/input/scroll-to-edge-if-line-break-at-end-of-document-contenteditable.html: Added.
* editing/input/scroll-to-edge-if-line-break-at-end-of-document-textarea-expected.txt: Added.
* editing/input/scroll-to-edge-if-line-break-at-end-of-document-textarea.html: Added.
* editing/input/scroll-to-edge-if-paragraph-separator-at-end-of-document-contenteditable-expected.txt: Added.
* editing/input/scroll-to-edge-if-paragraph-separator-at-end-of-document-contenteditable.html: Added.
TBR=mnaganov@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=117419
Patch Set 1 #Messages
Total messages: 1 (0 generated)
|