mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02:00
LibWeb: Do not scroll cursor into view on programmatic selection changes
We were mimicking Firefox' behavior that whenever a programmatic change to an <input>'s or <textarea>'s selection happened, the new selection focus is brought into view by scrolling. Currently we run a layout update synchronously for that to make sure we have the fragment's correct dimensions, which caused a significant performance regression in Speedometer. Since this is non-standard behavior, let's mimic Chromium instead which does not scroll at all - only for direct user initiated input such as typing. Relevant issues: * https://github.com/whatwg/html/issues/6217 * https://bugzilla.mozilla.org/show_bug.cgi?id=232405 * https://issues.chromium.org/issues/41081857
This commit is contained in:
committed by
Andreas Kling
parent
fa04c8db83
commit
ded42e649b
Notes:
github-actions[bot]
2026-02-17 09:25:08 +00:00
Author: https://github.com/gmta Commit: https://github.com/LadybirdBrowser/ladybird/commit/ded42e649b2 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7982
@@ -22,9 +22,8 @@
|
||||
internals.click(x, y);
|
||||
println(`before: ${input.selectionStart}`);
|
||||
|
||||
// Move cursor to the end, which should scroll the input.
|
||||
input.setSelectionRange(39, 39);
|
||||
input.offsetWidth;
|
||||
// Move cursor to the end via keyboard, which should scroll the input.
|
||||
internals.sendKey(input, "End");
|
||||
|
||||
// Click in the same spot after scrolling.
|
||||
internals.click(x, y);
|
||||
|
||||
Reference in New Issue
Block a user