WebContent: Invert focus condition in WebDriver's Element Send Keys

The spec states we should inspect the relevant value if the element does
*not* have focus.
This commit is contained in:
Timothy Flynn 2025-07-25 13:53:58 -04:00 committed by Jelle Raaijmakers
parent c566cc5024
commit cdf270a5e6
Notes: github-actions[bot] 2025-07-25 22:42:07 +00:00

View file

@ -1979,7 +1979,7 @@ Web::WebDriver::Response WebDriverConnection::element_send_keys_impl(StringView
// 1. If element does not currently have focus, let current text length be the length of element's API value.
Optional<Web::WebIDL::UnsignedLong> current_text_length;
if (element->is_focused()) {
if (!element->is_focused()) {
auto api_value = target->relevant_value();
// FIXME: This should be a UTF-16 code unit length, but `set_the_selection_range` is also currently