(&self, parent_filter: &impl Fn(&Node) -> FilterResult)
| 651 | } |
| 652 | |
| 653 | pub fn is_invocable(&self, parent_filter: &impl Fn(&Node) -> FilterResult) -> bool { |
| 654 | // A control is "invocable" if it initiates an action when activated but |
| 655 | // does not maintain any state. A control that maintains state |
| 656 | // when activated would be considered a toggle or expand-collapse |
| 657 | // control - these controls are "clickable" but not "invocable". |
| 658 | // Similarly, if the action only gives the control keyboard focus, |
| 659 | // such as when clicking a text input, the control is not considered |
| 660 | // "invocable", as the "invoke" action would be a redundant synonym |
| 661 | // for the "set focus" action. The same logic applies to selection. |
| 662 | self.is_clickable(parent_filter) |
| 663 | && !self.is_text_input() |
| 664 | && !matches!(self.role(), Role::Document | Role::Terminal) |
| 665 | && !self.supports_toggle() |
| 666 | && !self.supports_expand_collapse() |
| 667 | && self.is_selected().is_none() |
| 668 | } |
| 669 | |
| 670 | pub fn supports_action( |
| 671 | &self, |
no test coverage detected