[M94 Migration][DA][a11y]Make elements with plain text readable 93/293493/4
authorGajendra N <gajendra.n@samsung.com>
Mon, 22 Aug 2022 10:43:50 +0000 (16:13 +0530)
committerBot Blink <blinkbot@samsung.com>
Thu, 1 Jun 2023 01:53:46 +0000 (01:53 +0000)
Currently plain text elements like <p>, <h1> etc. were not HIGHLIGHTABLE.
There is a requirement from DA team to make those elements highlightable
and readable. Also, if there is div element (considered as section) with
some text, then make it readable too.

Ref : https://review.tizen.org/gerrit/#/c/280031/

Change-Id: I292e1038e87a5163bb95f3289bd6301f5de3d534
Signed-off-by: Gajendra N <gajendra.n@samsung.com>
tizen_src/chromium_impl/ui/accessibility/platform/ax_platform_node_efl.cc

index f9e7fe6c7389bd2de8e22a3944d25fa613417d7e..965498c63c22344f27749844ea9882d8b8dea5f0 100644 (file)
@@ -237,6 +237,13 @@ bool AXPlatformNodeEfl::HasTextValue() const {
       !GetData().GetStringAttribute(ax::mojom::StringAttribute::kValue).empty())
     return true;
 
+#if defined(OS_TIZEN_DA_PRODUCT)
+  std::string name = GetData().GetStringAttribute(
+      ax::mojom::StringAttribute::kName);
+  if (!name.empty())
+    return true;
+#endif
+
   for (int i = 0; i < GetChildCount(); i++) {
     AXPlatformNodeEfl* obj = ToAXPlatformNodeEfl(
         AXPlatformNode::FromNativeViewAccessible(ChildAtIndex(i)));
@@ -252,6 +259,13 @@ bool AXPlatformNodeEfl::HasText() const {
   if (!text.empty())
     return true;
 
+#if defined(OS_TIZEN_DA_PRODUCT)
+  std::string name = GetData().GetStringAttribute(
+      ax::mojom::StringAttribute::kName);
+  if (!name.empty())
+    return true;
+#endif
+
   std::string description =
       GetData().GetStringAttribute(ax::mojom::StringAttribute::kDescription);
   if (!description.empty())
@@ -297,10 +311,14 @@ bool AXPlatformNodeEfl::IsAccessible() const {
     return false;
   if (IsFocusable())
     return true;
+
+#if !defined(OS_TIZEN_DA_PRODUCT)
   // Text object types are accessible for its direct reading purpose, while
   // sections allow to group accessible nodes for better ui experiance.
   if (!IsTextObjectType() && !IsSection())
     return false;
+#endif
+
   // There is no need to group only one child (skipping unknown ones).
   if (IsSection() && !MoreThanOneKnownChild())
     return false;
@@ -327,8 +345,12 @@ bool AXPlatformNodeEfl::IsAccessible() const {
     return true;
   if (parent_efl->IsFocusable())
     return false;
+
+#if !defined(OS_TIZEN_DA_PRODUCT)
   if (!parent_efl->IsTextObjectType() && !parent_efl->IsSection())
     return true;
+#endif
+
   if (parent_efl->IsSection() && !parent_efl->MoreThanOneKnownChild())
     return true;
   return false;