mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
webdriver: Implement element send keys command for non-typeable form control (#38189)
Implement Step 8 of remote end steps of [Element Send keys](https://w3c.github.io/webdriver/#element-send-keys), specifically for non-typeable form control. --------- Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
This commit is contained in:
parent
3cb16eb864
commit
0970a99b7c
2 changed files with 65 additions and 5 deletions
|
@ -520,6 +520,24 @@ impl HTMLInputElement {
|
|||
self.input_type.get()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
/// <https://w3c.github.io/webdriver/#dfn-non-typeable-form-control>
|
||||
pub(crate) fn is_nontypeable(&self) -> bool {
|
||||
matches!(
|
||||
self.input_type(),
|
||||
InputType::Button |
|
||||
InputType::Checkbox |
|
||||
InputType::Color |
|
||||
InputType::File |
|
||||
InputType::Hidden |
|
||||
InputType::Image |
|
||||
InputType::Radio |
|
||||
InputType::Range |
|
||||
InputType::Reset |
|
||||
InputType::Submit
|
||||
)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn is_submit_button(&self) -> bool {
|
||||
let input_type = self.input_type.get();
|
||||
|
@ -2154,7 +2172,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#concept-fe-mutable
|
||||
fn is_mutable(&self) -> bool {
|
||||
pub(crate) fn is_mutable(&self) -> bool {
|
||||
// https://html.spec.whatwg.org/multipage/#the-input-element:concept-fe-mutable
|
||||
// https://html.spec.whatwg.org/multipage/#the-readonly-attribute:concept-fe-mutable
|
||||
!(self.upcast::<Element>().disabled_state() || self.ReadOnly())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue