WebDriver+LibWeb: Rename "click" to "element_click"

This matches the name used in the spec, and is unambiguous.
This commit is contained in:
Sam Atkins 2023-01-26 14:11:54 +00:00 committed by Linus Groh
parent 2f3eefe03b
commit c43db5dae7
Notes: sideshowbarker 2024-07-17 10:08:28 +09:00
7 changed files with 8 additions and 8 deletions

View file

@ -87,7 +87,7 @@ static constexpr auto s_webdriver_endpoints = Array {
ROUTE(GET, "/session/:session_id/element/:element_id/rect"sv, get_element_rect),
ROUTE(GET, "/session/:session_id/element/:element_id/enabled"sv, is_element_enabled),
ROUTE(GET, "/session/:session_id/element/:element_id/computedrole"sv, get_computed_role),
ROUTE(POST, "/session/:session_id/element/:element_id/click"sv, click),
ROUTE(POST, "/session/:session_id/element/:element_id/click"sv, element_click),
ROUTE(GET, "/session/:session_id/source"sv, get_source),
ROUTE(POST, "/session/:session_id/execute/sync"sv, execute_script),
ROUTE(POST, "/session/:session_id/execute/async"sv, execute_async_script),

View file

@ -75,7 +75,7 @@ public:
virtual Response get_element_rect(Parameters parameters, JsonValue payload) = 0;
virtual Response is_element_enabled(Parameters parameters, JsonValue payload) = 0;
virtual Response get_computed_role(Parameters parameters, JsonValue payload) = 0;
virtual Response click(Parameters parameters, JsonValue payload) = 0;
virtual Response element_click(Parameters parameters, JsonValue payload) = 0;
// 13. Document, https://w3c.github.io/webdriver/#document
virtual Response get_source(Parameters parameters, JsonValue payload) = 0;

View file

@ -41,7 +41,7 @@ endpoint WebDriverClient {
get_element_rect(DeprecatedString element_id) => (Web::WebDriver::Response response)
is_element_enabled(DeprecatedString element_id) => (Web::WebDriver::Response response)
get_computed_role(DeprecatedString element_id) => (Web::WebDriver::Response response)
click(DeprecatedString element_id) => (Web::WebDriver::Response response)
element_click(DeprecatedString element_id) => (Web::WebDriver::Response response)
get_source() => (Web::WebDriver::Response response)
execute_script(JsonValue payload) => (Web::WebDriver::Response response)
execute_async_script(JsonValue payload) => (Web::WebDriver::Response response)

View file

@ -1192,7 +1192,7 @@ Messages::WebDriverClient::GetComputedRoleResponse WebDriverConnection::get_comp
}
// 12.5.1 Element Click, https://w3c.github.io/webdriver/#element-click
Messages::WebDriverClient::ClickResponse WebDriverConnection::click(DeprecatedString const& element_id)
Messages::WebDriverClient::ElementClickResponse WebDriverConnection::element_click(DeprecatedString const& element_id)
{
// 1. If the current browsing context is no longer open, return error with error code no such window.
TRY(ensure_open_top_level_browsing_context());

View file

@ -76,7 +76,7 @@ private:
virtual Messages::WebDriverClient::GetElementRectResponse get_element_rect(DeprecatedString const& element_id) override;
virtual Messages::WebDriverClient::IsElementEnabledResponse is_element_enabled(DeprecatedString const& element_id) override;
virtual Messages::WebDriverClient::GetComputedRoleResponse get_computed_role(DeprecatedString const& element_id) override;
virtual Messages::WebDriverClient::ClickResponse click(DeprecatedString const& element_id) override;
virtual Messages::WebDriverClient::ElementClickResponse element_click(DeprecatedString const& element_id) override;
virtual Messages::WebDriverClient::GetSourceResponse get_source() override;
virtual Messages::WebDriverClient::ExecuteScriptResponse execute_script(JsonValue const& payload) override;
virtual Messages::WebDriverClient::ExecuteAsyncScriptResponse execute_async_script(JsonValue const& payload) override;

View file

@ -544,11 +544,11 @@ Web::WebDriver::Response Client::get_computed_role(Web::WebDriver::Parameters pa
// 12.5.1 Element Click, https://w3c.github.io/webdriver/#element-click
// POST /session/{session id}/element/{element id}/click
Web::WebDriver::Response Client::click(Web::WebDriver::Parameters parameters, JsonValue)
Web::WebDriver::Response Client::element_click(Web::WebDriver::Parameters parameters, JsonValue)
{
dbgln_if(WEBDRIVER_DEBUG, "Handling POST /session/<session_id>/element/<element_id>/click");
auto* session = TRY(find_session_with_id(parameters[0]));
return session->web_content_connection().click(parameters[1]);
return session->web_content_connection().element_click(parameters[1]);
}
// 13.1 Get Page Source, https://w3c.github.io/webdriver/#dfn-get-page-source

View file

@ -76,7 +76,7 @@ private:
virtual Web::WebDriver::Response get_element_rect(Web::WebDriver::Parameters parameters, JsonValue payload) override;
virtual Web::WebDriver::Response is_element_enabled(Web::WebDriver::Parameters parameters, JsonValue payload) override;
virtual Web::WebDriver::Response get_computed_role(Web::WebDriver::Parameters parameters, JsonValue payload) override;
virtual Web::WebDriver::Response click(Web::WebDriver::Parameters parameters, JsonValue payload) override;
virtual Web::WebDriver::Response element_click(Web::WebDriver::Parameters parameters, JsonValue payload) override;
virtual Web::WebDriver::Response get_source(Web::WebDriver::Parameters parameters, JsonValue payload) override;
virtual Web::WebDriver::Response execute_script(Web::WebDriver::Parameters parameters, JsonValue payload) override;
virtual Web::WebDriver::Response execute_async_script(Web::WebDriver::Parameters parameters, JsonValue payload) override;