mirror of
https://github.com/RGBCube/serenity
synced 2025-08-06 21:57:47 +00:00
WebDriver: Implement GET /session/{id}/element/{id}/css/{name}
This commit is contained in:
parent
202b2be1f2
commit
354a845d65
7 changed files with 73 additions and 0 deletions
|
@ -166,4 +166,26 @@ Messages::WebDriverSessionClient::GetElementPropertyResponse WebDriverConnection
|
|||
return { {} };
|
||||
}
|
||||
|
||||
Messages::WebDriverSessionClient::GetActiveDocumentsTypeResponse WebDriverConnection::get_active_documents_type()
|
||||
{
|
||||
dbgln("WebDriverConnection: get_active_documents_type");
|
||||
if (auto browser_window = m_browser_window.strong_ref()) {
|
||||
auto& tab = browser_window->active_tab();
|
||||
if (tab.on_get_active_documents_type)
|
||||
return { tab.on_get_active_documents_type() };
|
||||
}
|
||||
return { "" };
|
||||
}
|
||||
|
||||
Messages::WebDriverSessionClient::GetComputedValueForElementResponse WebDriverConnection::get_computed_value_for_element(i32 element_id, String const& property_name)
|
||||
{
|
||||
dbgln("WebDriverConnection: get_computed_value_for_element");
|
||||
if (auto browser_window = m_browser_window.strong_ref()) {
|
||||
auto& tab = browser_window->active_tab();
|
||||
if (tab.on_get_computed_value_for_element)
|
||||
return { tab.on_get_computed_value_for_element(element_id, property_name) };
|
||||
}
|
||||
return { "" };
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -51,6 +51,8 @@ public:
|
|||
virtual Messages::WebDriverSessionClient::QuerySelectorAllResponse query_selector_all(i32 start_node_id, String const& selector) override;
|
||||
virtual Messages::WebDriverSessionClient::GetElementAttributeResponse get_element_attribute(i32 element_id, String const& name) override;
|
||||
virtual Messages::WebDriverSessionClient::GetElementPropertyResponse get_element_property(i32 element_id, String const& name) override;
|
||||
virtual Messages::WebDriverSessionClient::GetActiveDocumentsTypeResponse get_active_documents_type() override;
|
||||
virtual Messages::WebDriverSessionClient::GetComputedValueForElementResponse get_computed_value_for_element(i32 element_id, String const& property_name) override;
|
||||
|
||||
private:
|
||||
WebDriverConnection(NonnullOwnPtr<Core::Stream::LocalSocket> socket, NonnullRefPtr<BrowserWindow> browser_window);
|
||||
|
|
|
@ -20,5 +20,7 @@ endpoint WebDriverSessionClient {
|
|||
query_selector_all(i32 start_node_id, String selector) => (Optional<Vector<i32>> elements_ids)
|
||||
get_element_attribute(i32 element_id, String name) => (Optional<String> atttibute)
|
||||
get_element_property(i32 element_id, String name) => (Optional<String> property)
|
||||
get_active_documents_type() => (String type)
|
||||
get_computed_value_for_element(i32 element_id, String property_name) => (String computed_value)
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue