1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:18:12 +00:00

Browser+WebContent+WebDriver: Move Take Element Screenshot to WebContent

This commit is contained in:
Timothy Flynn 2022-11-10 13:33:18 -05:00 committed by Linus Groh
parent de1e882601
commit ea0561a0b3
15 changed files with 51 additions and 185 deletions

View file

@ -136,26 +136,4 @@ void WebDriverConnection::update_cookie(Web::Cookie::Cookie const& cookie)
}
}
void WebDriverConnection::scroll_element_into_view(i32 element_id)
{
dbgln("WebDriverConnection: scroll_element_into_view {}", element_id);
if (auto browser_window = m_browser_window.strong_ref()) {
auto& tab = browser_window->active_tab();
if (tab.webdriver_endpoints().on_scroll_element_into_view)
tab.webdriver_endpoints().on_scroll_element_into_view(element_id);
}
}
Messages::WebDriverSessionClient::TakeElementScreenshotResponse WebDriverConnection::take_element_screenshot(i32 element_id)
{
dbgln_if(WEBDRIVER_DEBUG, "WebDriverConnection: take_element_screenshot {}", element_id);
if (auto browser_window = m_browser_window.strong_ref()) {
auto& tab = browser_window->active_tab();
if (tab.webdriver_endpoints().on_take_element_screenshot)
return { tab.webdriver_endpoints().on_take_element_screenshot(element_id) };
}
return { {} };
}
}