script(webdriver): Check if element is keyboard interactable in element send keys (#38235)

Step 7.6 of remote end steps of [Element Send
Keys](https://w3c.github.io/webdriver/#element-send-keys)
> If element is not
[keyboard-interactable](https://w3c.github.io/webdriver/#dfn-keyboard-interactable),
return [error](https://w3c.github.io/webdriver/#dfn-error) with [error
code](https://w3c.github.io/webdriver/#dfn-error-code) [element not
interactable](https://w3c.github.io/webdriver/#dfn-element-not-interactable).

---------

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
This commit is contained in:
Kenzie Raditya Tirtarahardja 2025-07-24 12:32:46 +08:00 committed by GitHub
parent f726737f24
commit d95dd69e3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 24 additions and 10 deletions

View file

@ -1740,6 +1740,15 @@ impl Element {
}
}
/// <https://dom.spec.whatwg.org/#document-element>
pub(crate) fn is_document_element(&self) -> bool {
if let Some(ref document_element) = self.owner_document().GetDocumentElement() {
**document_element == *self
} else {
false
}
}
pub(crate) fn is_focusable_area(&self) -> bool {
if self.is_actually_disabled() {
return false;