static void setAtkRelationSetFromCoreObject(AccessibilityObject* coreObject, AtkRelationSet* relationSet) { AccessibilityRenderObject* accObject = static_cast<AccessibilityRenderObject*>(coreObject); if (accObject->isControl()) { AccessibilityObject* label = accObject->correspondingLabelForControlElement(); if (label) atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABELLED_BY, label->wrapper()); } else { AccessibilityObject* control = accObject->correspondingControlForLabelElement(); if (control) atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABEL_FOR, control->wrapper()); } }