atspi: do not accept invisible object 43/142243/2
authorShinwoo Kim <cinoo.kim@samsung.com>
Thu, 3 Aug 2017 06:46:25 +0000 (15:46 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Fri, 4 Aug 2017 10:48:50 +0000 (10:48 +0000)
Issue:
If an object is child of scrollable parent, then the object is accepted even
though the object is invisible.

Solution:
Do not accept invisible object.

Change-Id: I0492eb9f5f265211521f066acd6f56d9c24356c0

src/lib/elm_atspi_bridge.c

index 6a81045..b3a77ed 100644 (file)
@@ -4220,6 +4220,12 @@ static unsigned char _object_is_highlightable(accessibility_navigation_pointer_t
    return _state_set_is_set(state_set, ATSPI_STATE_HIGHLIGHTABLE);
 }
 
+static unsigned char _object_is_visible(accessibility_navigation_pointer_table *table, void *obj)
+{
+   uint64_t state_set = CALL(object_get_state_set, obj);
+   return _state_set_is_set(state_set, ATSPI_STATE_VISIBLE);
+}
+
 static unsigned char _object_is_showing(accessibility_navigation_pointer_table *table, void *obj)
 {
    uint64_t state_set = CALL(object_get_state_set, obj);
@@ -4257,6 +4263,7 @@ static void *_get_scrollable_parent(accessibility_navigation_pointer_table *tabl
 static unsigned char _accept_object(accessibility_navigation_pointer_table *table, void *obj)
 {
    if (!obj) return 0;
+   if (!_object_is_visible(table, obj)) return 0;
    if (!_accept_object_check_role(table, obj)) return 0;
    if (CALL(get_object_in_relation_by_type, obj, ATSPI_RELATION_CONTROLLED_BY) != NULL) return 0;
    if (!_object_is_highlightable(table, obj)) return 0;