diff options
author | Timothy Flynn <trflynn89@pm.me> | 2022-11-04 15:49:15 -0400 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-11-05 01:10:03 +0000 |
commit | 424e80ee75b50d7824a913351e419b9384c96c1f (patch) | |
tree | 7175cb0ffee6c117b1609f262e8329a5e201072e /Userland/Libraries/LibWebView | |
parent | 3510fbbea84e6c5be4c2a32ba22ca0c990097a2e (diff) | |
download | serenity-424e80ee75b50d7824a913351e419b9384c96c1f.zip |
LibWebView+WebContent: Add an IPC to scroll an element into view
Note that even though there is no response, this IPC has to be
synchronous to allow all scroll events to trigger before returning to
the calling WebDriver process.
Diffstat (limited to 'Userland/Libraries/LibWebView')
-rw-r--r-- | Userland/Libraries/LibWebView/OutOfProcessWebView.cpp | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibWebView/OutOfProcessWebView.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp b/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp index 464eba8cb9..cb088c4f6d 100644 --- a/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp +++ b/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp @@ -530,6 +530,11 @@ Optional<Vector<i32>> OutOfProcessWebView::query_selector_all(i32 start_node_id, return client().query_selector_all(start_node_id, selector); } +void OutOfProcessWebView::scroll_element_into_view(i32 element_id) +{ + return client().scroll_element_into_view(element_id); +} + bool OutOfProcessWebView::is_element_selected(i32 element_id) { return client().is_element_selected(element_id); diff --git a/Userland/Libraries/LibWebView/OutOfProcessWebView.h b/Userland/Libraries/LibWebView/OutOfProcessWebView.h index 9d2e072223..bc03b5b346 100644 --- a/Userland/Libraries/LibWebView/OutOfProcessWebView.h +++ b/Userland/Libraries/LibWebView/OutOfProcessWebView.h @@ -65,6 +65,7 @@ public: Optional<i32> get_document_element(); Optional<Vector<i32>> query_selector_all(i32 start_node_id, String const& selector); + void scroll_element_into_view(i32 element_id); bool is_element_selected(i32 element_id); Optional<String> get_element_attribute(i32 element_id, String const& name); Optional<String> get_element_property(i32 element_id, String const& name); |