@@ -75,7 +75,7 @@ class CRAXNode implements accessibility.AXNode {
75
75
private _isTextOnlyObject ( ) : boolean {
76
76
const role = this . _role ;
77
77
return ( role === 'LineBreak' || role === 'text' ||
78
- role === 'InlineTextBox' ) ;
78
+ role === 'InlineTextBox' || role === 'StaticText' ) ;
79
79
}
80
80
81
81
private _hasFocusableChild ( ) : boolean {
@@ -145,7 +145,7 @@ class CRAXNode implements accessibility.AXNode {
145
145
// Here and below: Android heuristics
146
146
if ( this . _hasFocusableChild ( ) )
147
147
return false ;
148
- if ( this . _focusable && this . _role !== 'WebArea' && this . _name )
148
+ if ( this . _focusable && this . _role !== 'WebArea' && this . _role !== 'RootWebArea' && this . _name )
149
149
return true ;
150
150
if ( this . _role === 'heading' && this . _name )
151
151
return true ;
@@ -199,6 +199,17 @@ class CRAXNode implements accessibility.AXNode {
199
199
return this . isLeafNode ( ) && ! ! this . _name ;
200
200
}
201
201
202
+ normalizedRole ( ) {
203
+ switch ( this . _role ) {
204
+ case 'RootWebArea' :
205
+ return 'WebArea' ;
206
+ case 'StaticText' :
207
+ return 'text' ;
208
+ default :
209
+ return this . _role ;
210
+ }
211
+ }
212
+
202
213
serialize ( ) : types . SerializedAXNode {
203
214
const properties : Map < string , number | string | boolean > = new Map ( ) ;
204
215
for ( const property of this . _payload . properties || [ ] )
@@ -207,7 +218,7 @@ class CRAXNode implements accessibility.AXNode {
207
218
properties . set ( 'description' , this . _payload . description . value ) ;
208
219
209
220
const node : { [ x in keyof types . SerializedAXNode ] : any } = {
210
- role : this . _role ,
221
+ role : this . normalizedRole ( ) ,
211
222
name : this . _payload . name ? ( this . _payload . name . value || '' ) : '' ,
212
223
} ;
213
224
@@ -236,7 +247,7 @@ class CRAXNode implements accessibility.AXNode {
236
247
for ( const booleanProperty of booleanProperties ) {
237
248
// WebArea's treat focus differently than other nodes. They report whether their frame has focus,
238
249
// not whether focus is specifically on the root node.
239
- if ( booleanProperty === 'focused' && this . _role === 'WebArea' )
250
+ if ( booleanProperty === 'focused' && ( this . _role === 'WebArea' || this . _role === 'RootWebArea' ) )
240
251
continue ;
241
252
const value = properties . get ( booleanProperty ) ;
242
253
if ( ! value )
0 commit comments