Esme Povirk (@madewokherd) commented about dlls/uiautomationcore/uia_client.c:
+static HRESULT uia_condition_check(HUIANODE node, struct UiaCondition *condition); +static BOOL uia_condition_matched(HRESULT hr); + +static HRESULT get_sibling_node_for_tree(HUIANODE huianode, struct UiaCondition *view_cond, int dir, + BOOL at_root_level, HUIANODE *out_node) +{ + struct uia_node *node = unsafe_impl_from_IWineUiaNode((IWineUiaNode *)huianode); + HUIANODE node2 = NULL; + HRESULT hr; + + *out_node = NULL; + + IWineUiaNode_AddRef(&node->IWineUiaNode_iface); + while (1) + { + hr = navigate_uia_node(node, dir, &node2); I'm confused why it's not necessary to check the condition if we get a non-NULL node2 here.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/1249#note_13529