@@ -14,16 +14,14 @@ struct PrivateAXFields {
1414 let selected : Bool ?
1515 let actions : [ String ] ?
1616 let children : [ [ String : Any ] ]
17-
18- var hasFrame : Bool { ! rect . isNull && ! rect . isEmpty }
1917}
2018
2119extension RunnerTests {
2220 /// Private-AX acquisition: ONE serializer for both projections. Reported facts at traversal
2321 /// depth -- membership, the clip fold, scroll hints, and collapsed depth are
2422 /// `SnapshotPresentation`'s alone (#1797). The traversal-depth cut is the backend's one
2523 /// narrowing, complete for raw (raw depth *is* traversal depth) and a declared residue for
26- /// regular; `hittable` is the pre-clip geometric fact the fold narrows per projection .
24+ /// regular; `hittable` is the shared geometric fact the fold recomputes for effective geometry .
2725 func privateAXAcquisition ( rawRoot : [ String : Any ] , hint : CaptureHint , viewport : CGRect )
2826 -> [ RawAXNode ]
2927 {
@@ -38,10 +36,15 @@ extension RunnerTests {
3836 {
3937 if let limit = hint . depth , depth > limit { return }
4038 let fields = privateAXFields ( raw )
41- let onScreen = fields . hasFrame && Self . isVisibleInViewport ( fields . rect , viewport )
4239 let index = nodes . count
4340 nodes . append (
44- privateAXNode ( fields , index : index , depth : depth , parentIndex : parentIndex , onScreen : onScreen )
41+ privateAXNode (
42+ fields ,
43+ index : index ,
44+ depth : depth ,
45+ parentIndex : parentIndex ,
46+ viewport : viewport
47+ )
4548 )
4649 for child in fields . children {
4750 appendPrivateAXNode ( child , to : & nodes , hint : hint , viewport : viewport ,
@@ -67,7 +70,7 @@ extension RunnerTests {
6770 }
6871
6972 private func privateAXNode ( _ fields : PrivateAXFields , index : Int , depth : Int , parentIndex : Int ? ,
70- onScreen : Bool ) -> RawAXNode
73+ viewport : CGRect ) -> RawAXNode
7174 {
7275 RawAXNode ( index : index ,
7376 type : fields . elementType . map ( elementTypeName ) ?? " Element( \( fields . rawType ) ) " ,
@@ -76,8 +79,11 @@ extension RunnerTests {
7679 value : fields . value . isEmpty ? nil : fields . value ,
7780 rect : snapshotRect ( from : fields . rect ) , enabled : fields . enabled ,
7881 focused : fields . focused , selected : fields . selected ,
79- hittable : onScreen && fields . enabled
80- && privateAXInteractiveCandidate ( rawElementType : fields . rawType ) ,
82+ hittable : parentIndex != nil && SnapshotGeometry . isGeometricallyActionable (
83+ enabled : fields . enabled ,
84+ frame : fields . rect ,
85+ viewport : viewport
86+ ) ,
8187 depth : depth , parentIndex : parentIndex , hiddenContentAbove : nil , hiddenContentBelow : nil ,
8288 actions : fields . actions )
8389 }
0 commit comments