diff options
author | Timothy Flynn <trflynn89@pm.me> | 2022-11-10 08:15:39 -0500 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-11-10 17:02:11 +0000 |
commit | 04ea3992e9cd954bb7202e94c2c5c54116d73136 (patch) | |
tree | e6b53280c4b87bea654ed94ce6514dfa1b23da10 /Userland/Services/WebContent/ConnectionFromClient.cpp | |
parent | 560da56a1df9eebcfb9a900b3f3dec2a65e78e6b (diff) | |
download | serenity-04ea3992e9cd954bb7202e94c2c5c54116d73136.zip |
Browser+WebContent+WebDriver: Move Is Element Selected to WebContent
Diffstat (limited to 'Userland/Services/WebContent/ConnectionFromClient.cpp')
-rw-r--r-- | Userland/Services/WebContent/ConnectionFromClient.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/Userland/Services/WebContent/ConnectionFromClient.cpp b/Userland/Services/WebContent/ConnectionFromClient.cpp index 4191473d4b..b4c53e4114 100644 --- a/Userland/Services/WebContent/ConnectionFromClient.cpp +++ b/Userland/Services/WebContent/ConnectionFromClient.cpp @@ -28,8 +28,6 @@ #include <LibWeb/Geometry/DOMRect.h> #include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/FormAssociatedElement.h> -#include <LibWeb/HTML/HTMLInputElement.h> -#include <LibWeb/HTML/HTMLOptionElement.h> #include <LibWeb/HTML/Scripting/ClassicScript.h> #include <LibWeb/HTML/Storage.h> #include <LibWeb/HTML/Window.h> @@ -497,27 +495,6 @@ void ConnectionFromClient::scroll_element_into_view(i32 element_id) element->scroll_into_view(options); } -Messages::WebContentServer::IsElementSelectedResponse ConnectionFromClient::is_element_selected(i32 element_id) -{ - auto element = find_element_by_id(element_id); - if (!element.has_value()) - return { false }; - - bool selected = false; - - if (is<Web::HTML::HTMLInputElement>(*element)) { - auto& input = dynamic_cast<Web::HTML::HTMLInputElement&>(*element); - using enum Web::HTML::HTMLInputElement::TypeAttributeState; - - if (input.type_state() == Checkbox || input.type_state() == RadioButton) - selected = input.checked(); - } else if (is<Web::HTML::HTMLOptionElement>(*element)) { - selected = dynamic_cast<Web::HTML::HTMLOptionElement&>(*element).selected(); - } - - return { selected }; -} - Messages::WebContentServer::GetElementAttributeResponse ConnectionFromClient::get_element_attribute(i32 element_id, String const& name) { auto element = find_element_by_id(element_id); |