From 30d6a73d0ee552ee889a8550b2c87cd7d10957ff Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Thu, 10 Nov 2022 10:33:29 -0500 Subject: Browser+WebContent+WebDriver: Move Get Element Rect to WebContent --- Userland/Applications/Browser/BrowserWindow.cpp | 4 ---- Userland/Applications/Browser/WebDriverConnection.cpp | 11 ----------- Userland/Applications/Browser/WebDriverConnection.h | 1 - Userland/Applications/Browser/WebDriverEndpoints.h | 1 - Userland/Applications/Browser/WebDriverSessionClient.ipc | 1 - 5 files changed, 18 deletions(-) (limited to 'Userland/Applications') diff --git a/Userland/Applications/Browser/BrowserWindow.cpp b/Userland/Applications/Browser/BrowserWindow.cpp index e802f4e83f..987afc4013 100644 --- a/Userland/Applications/Browser/BrowserWindow.cpp +++ b/Userland/Applications/Browser/BrowserWindow.cpp @@ -611,10 +611,6 @@ void BrowserWindow::create_new_tab(URL url, bool activate) active_tab().view().scroll_element_into_view(element_id); }; - new_tab.webdriver_endpoints().on_get_element_rect = [this](i32 element_id) { - return active_tab().view().get_element_rect(element_id); - }; - new_tab.webdriver_endpoints().on_is_element_enabled = [this](i32 element_id) { return active_tab().view().is_element_enabled(element_id); }; diff --git a/Userland/Applications/Browser/WebDriverConnection.cpp b/Userland/Applications/Browser/WebDriverConnection.cpp index 16408f607a..541f3f1f88 100644 --- a/Userland/Applications/Browser/WebDriverConnection.cpp +++ b/Userland/Applications/Browser/WebDriverConnection.cpp @@ -146,17 +146,6 @@ void WebDriverConnection::scroll_element_into_view(i32 element_id) } } -Messages::WebDriverSessionClient::GetElementRectResponse WebDriverConnection::get_element_rect(i32 element_id) -{ - dbgln("WebDriverConnection: get_element_rect {}", element_id); - if (auto browser_window = m_browser_window.strong_ref()) { - auto& tab = browser_window->active_tab(); - if (tab.webdriver_endpoints().on_get_element_rect) - return { tab.webdriver_endpoints().on_get_element_rect(element_id) }; - } - return { {} }; -} - Messages::WebDriverSessionClient::IsElementEnabledResponse WebDriverConnection::is_element_enabled(i32 element_id) { dbgln("WebDriverConnection: is_element_enabled {}", element_id); diff --git a/Userland/Applications/Browser/WebDriverConnection.h b/Userland/Applications/Browser/WebDriverConnection.h index 12800a65bf..7e5007ecae 100644 --- a/Userland/Applications/Browser/WebDriverConnection.h +++ b/Userland/Applications/Browser/WebDriverConnection.h @@ -49,7 +49,6 @@ public: virtual void add_cookie(Web::Cookie::ParsedCookie const&) override; virtual void update_cookie(Web::Cookie::Cookie const&) override; virtual void scroll_element_into_view(i32 element_id) override; - virtual Messages::WebDriverSessionClient::GetElementRectResponse get_element_rect(i32 element_id) override; virtual Messages::WebDriverSessionClient::IsElementEnabledResponse is_element_enabled(i32 element_id) override; virtual Messages::WebDriverSessionClient::TakeScreenshotResponse take_screenshot() override; virtual Messages::WebDriverSessionClient::TakeElementScreenshotResponse take_element_screenshot(i32 element_id) override; diff --git a/Userland/Applications/Browser/WebDriverEndpoints.h b/Userland/Applications/Browser/WebDriverEndpoints.h index 387a56dce0..7aed04734d 100644 --- a/Userland/Applications/Browser/WebDriverEndpoints.h +++ b/Userland/Applications/Browser/WebDriverEndpoints.h @@ -24,7 +24,6 @@ public: ~WebDriverEndpoints() = default; Function on_scroll_element_into_view; - Function on_get_element_rect; Function on_is_element_enabled; Function on_take_element_screenshot; Function on_serialize_source; diff --git a/Userland/Applications/Browser/WebDriverSessionClient.ipc b/Userland/Applications/Browser/WebDriverSessionClient.ipc index eae41548ef..5a358b9533 100644 --- a/Userland/Applications/Browser/WebDriverSessionClient.ipc +++ b/Userland/Applications/Browser/WebDriverSessionClient.ipc @@ -25,7 +25,6 @@ endpoint WebDriverSessionClient { add_cookie(Web::Cookie::ParsedCookie cookie) =| update_cookie(Web::Cookie::Cookie cookie) =| scroll_element_into_view(i32 element_id) => () - get_element_rect(i32 element_id) => (Gfx::IntRect rect) is_element_enabled(i32 element_id) => (bool enabled) take_screenshot() => (Gfx::ShareableBitmap data) take_element_screenshot(i32 element_id) => (Gfx::ShareableBitmap data) -- cgit v1.2.3