Co-authored-by: Artur Świgoń <a.swigon@samsung.com>
Due to an oversight in #4389, the automationId attribute disappeared from the AT-SPI tree for some Views, causing multiple regressions in Aurum tests. This PR fixes this bug.
The "automationId" key set in AccessibilityAttributes is ignored for controls not backed by a NUIViewAccessible (e.g. BaseComponents, FluxView etc.), because NUIViewAccessible::GetAttributes is never called for such controls. The value of AutomationId should be propagated to dali-toolkit instead, so that is it visible to ControlAccessible::GetAttributes, therefore having an effect for all types of Views (NUIViewAccessible::GetAttributes calls ControlAccessible::GetAttributes first, and then collects any additional attributes stored in View.AccessibilityAttributes).
Dependencies:
https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-toolkit/+/278352/ (merged)
https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-csharp-binder/+/278353/ (merged)
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_Property_ACCESSIBILITY_HIDDEN_get")]
public static extern int AccessibilityHiddenGet();
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_Property_AUTOMATION_ID_get")]
+ public static extern int AutomationIdGet();
}
}
}
NotifyPropertyChanged();
}
}
-
- private string InternalAutomationId
- {
- get { return base.AutomationId; }
- set
- {
- base.AutomationId = value;
- AccessibilityAttributes["automationId"] = value;
- }
- }
}
}
var instance = (Tizen.NUI.BaseComponents.View)bindable;
if (newValue != null)
{
- instance.InternalAutomationId = (string)newValue;
+ Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)instance.SwigCPtr, View.Property.AutomationId, new Tizen.NUI.PropertyValue((string)newValue));
}
},
defaultValueCreator: (bindable) =>
{
var instance = (Tizen.NUI.BaseComponents.View)bindable;
- return instance.InternalAutomationId;
+ string temp = "";
+ Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)instance.SwigCPtr, View.Property.AutomationId).Get(out temp);
+ return temp;
});
/// <summary>
internal static readonly int AccessibilityAttributes = Interop.ViewProperty.AccessibilityAttributesGet();
internal static readonly int DispatchKeyEvents = Interop.ViewProperty.DispatchKeyEventsGet();
internal static readonly int AccessibilityHidden = Interop.ViewProperty.AccessibilityHiddenGet();
+ internal static readonly int AutomationId = Interop.ViewProperty.AutomationIdGet();
}
}
}