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

Browser+WebContent+WebDriver: Move Get Element Property to WebContent

This commit is contained in:
Timothy Flynn 2022-11-10 09:25:53 -05:00 committed by Linus Groh
parent 1bc94e135f
commit 3c00d0e92b
16 changed files with 35 additions and 74 deletions

View file

@ -495,28 +495,6 @@ void ConnectionFromClient::scroll_element_into_view(i32 element_id)
element->scroll_into_view(options);
}
Messages::WebContentServer::GetElementPropertyResponse ConnectionFromClient::get_element_property(i32 element_id, String const& name)
{
auto element = find_element_by_id(element_id);
if (!element.has_value())
return Optional<String> {};
auto property_or_error = element->get(name);
if (property_or_error.is_throw_completion())
return Optional<String> {};
auto property = property_or_error.release_value();
if (property.is_undefined())
return Optional<String> {};
auto string_or_error = property.to_string(element->vm());
if (string_or_error.is_error())
return Optional<String> {};
return { string_or_error.release_value() };
}
Messages::WebContentServer::GetActiveDocumentsTypeResponse ConnectionFromClient::get_active_documents_type()
{
auto* active_document = page().top_level_browsing_context().active_document();