1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:27:35 +00:00

LibWeb: Scroll elements into view when they become focused

This makes both user-interactive (tab keys) and programmatic focus
changes scroll the viewport if necessary to reveal the newly focused
element.
This commit is contained in:
Andreas Kling 2022-10-11 12:15:46 +02:00
parent 7dcbb403bb
commit 5ab501c92f
2 changed files with 5 additions and 1 deletions

View file

@ -160,7 +160,7 @@ public:
WebIDL::ExceptionOr<void> insert_adjacent_text(String const& where, String const& data);
// https://w3c.github.io/csswg-drafts/cssom-view-1/#dom-element-scrollintoview
void scroll_into_view(Optional<Variant<bool, ScrollIntoViewOptions>>);
void scroll_into_view(Optional<Variant<bool, ScrollIntoViewOptions>> = {});
protected:
Element(Document&, DOM::QualifiedName);