File tree Expand file tree Collapse file tree 4 files changed +20
-1
lines changed Expand file tree Collapse file tree 4 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -609,6 +609,10 @@ impl<'a> Node<'a> {
609609 )
610610 }
611611
612+ pub fn is_required ( & self ) -> bool {
613+ self . data ( ) . is_required ( )
614+ }
615+
612616 pub fn live ( & self ) -> Live {
613617 self . data ( )
614618 . live ( )
Original file line number Diff line number Diff line change @@ -294,6 +294,9 @@ impl NodeWrapper<'_> {
294294 if state. is_focusable ( ) {
295295 atspi_state. insert ( State :: Focusable ) ;
296296 }
297+ if state. is_required ( ) {
298+ atspi_state. insert ( State :: Required ) ;
299+ }
297300 if let Some ( orientation) = state. orientation ( ) {
298301 atspi_state. insert ( if orientation == Orientation :: Horizontal {
299302 State :: Horizontal
Original file line number Diff line number Diff line change @@ -807,6 +807,12 @@ declare_class!(
807807 } ) ;
808808 }
809809
810+ #[ method( isAccessibilityRequired) ]
811+ fn is_required( & self ) -> bool {
812+ self . resolve( |node| node. is_required( ) )
813+ . unwrap_or( false )
814+ }
815+
810816 #[ method( isAccessibilitySelectorAllowed: ) ]
811817 fn is_selector_allowed( & self , selector: Sel ) -> bool {
812818 self . resolve( |node| {
@@ -860,6 +866,7 @@ declare_class!(
860866 || selector == sel!( accessibilityValue)
861867 || selector == sel!( accessibilityMinValue)
862868 || selector == sel!( accessibilityMaxValue)
869+ || selector == sel!( isAccessibilityRequired)
863870 || selector == sel!( accessibilityOrientation)
864871 || selector == sel!( isAccessibilityElement)
865872 || selector == sel!( isAccessibilityFocused)
Original file line number Diff line number Diff line change @@ -374,6 +374,10 @@ impl NodeWrapper<'_> {
374374 . unwrap_or_else ( || self . numeric_value_step ( ) )
375375 }
376376
377+ fn is_required ( & self ) -> bool {
378+ self . 0 . is_required ( )
379+ }
380+
377381 fn is_selection_item_pattern_supported ( & self ) -> bool {
378382 match self . 0 . role ( ) {
379383 // TODO: tables (#29)
@@ -885,7 +889,8 @@ properties! {
885889 ( LiveSetting , live_setting) ,
886890 ( AutomationId , automation_id) ,
887891 ( ClassName , class_name) ,
888- ( Orientation , orientation)
892+ ( Orientation , orientation) ,
893+ ( IsRequiredForForm , is_required)
889894}
890895
891896patterns ! {
You can’t perform that action at this time.
0 commit comments