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> {
609
609
)
610
610
}
611
611
612
+ pub fn is_required ( & self ) -> bool {
613
+ self . data ( ) . is_required ( )
614
+ }
615
+
612
616
pub fn live ( & self ) -> Live {
613
617
self . data ( )
614
618
. live ( )
Original file line number Diff line number Diff line change @@ -294,6 +294,9 @@ impl NodeWrapper<'_> {
294
294
if state. is_focusable ( ) {
295
295
atspi_state. insert ( State :: Focusable ) ;
296
296
}
297
+ if state. is_required ( ) {
298
+ atspi_state. insert ( State :: Required ) ;
299
+ }
297
300
if let Some ( orientation) = state. orientation ( ) {
298
301
atspi_state. insert ( if orientation == Orientation :: Horizontal {
299
302
State :: Horizontal
Original file line number Diff line number Diff line change @@ -807,6 +807,12 @@ declare_class!(
807
807
} ) ;
808
808
}
809
809
810
+ #[ method( isAccessibilityRequired) ]
811
+ fn is_required( & self ) -> bool {
812
+ self . resolve( |node| node. is_required( ) )
813
+ . unwrap_or( false )
814
+ }
815
+
810
816
#[ method( isAccessibilitySelectorAllowed: ) ]
811
817
fn is_selector_allowed( & self , selector: Sel ) -> bool {
812
818
self . resolve( |node| {
@@ -860,6 +866,7 @@ declare_class!(
860
866
|| selector == sel!( accessibilityValue)
861
867
|| selector == sel!( accessibilityMinValue)
862
868
|| selector == sel!( accessibilityMaxValue)
869
+ || selector == sel!( isAccessibilityRequired)
863
870
|| selector == sel!( accessibilityOrientation)
864
871
|| selector == sel!( isAccessibilityElement)
865
872
|| selector == sel!( isAccessibilityFocused)
Original file line number Diff line number Diff line change @@ -374,6 +374,10 @@ impl NodeWrapper<'_> {
374
374
. unwrap_or_else ( || self . numeric_value_step ( ) )
375
375
}
376
376
377
+ fn is_required ( & self ) -> bool {
378
+ self . 0 . is_required ( )
379
+ }
380
+
377
381
fn is_selection_item_pattern_supported ( & self ) -> bool {
378
382
match self . 0 . role ( ) {
379
383
// TODO: tables (#29)
@@ -885,7 +889,8 @@ properties! {
885
889
( LiveSetting , live_setting) ,
886
890
( AutomationId , automation_id) ,
887
891
( ClassName , class_name) ,
888
- ( Orientation , orientation)
892
+ ( Orientation , orientation) ,
893
+ ( IsRequiredForForm , is_required)
889
894
}
890
895
891
896
patterns ! {
You can’t perform that action at this time.
0 commit comments