[Tizen] Add forceChildSearch a11y attribute to enable searching for out-of-bounds... 05/311705/2 accepted/tizen/7.0/unified/20240528.162633
authorYoungsun Suh <youngsun.suh@samsung.com>
Fri, 24 May 2024 05:56:17 +0000 (14:56 +0900)
committerYoungsun Suh <youngsun.suh@samsung.com>
Mon, 27 May 2024 01:35:08 +0000 (10:35 +0900)
Change-Id: Iaa66022ec2edecfd9600f11f3af78f0e68c58cb1

dali/internal/accessibility/bridge/bridge-accessible.cpp

index 25de371d09e97cffdb5930e398534184a7d36097..cbdb3e87522210f270fa4675e8c342c1579f2cdc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -41,6 +41,8 @@ using namespace Dali::Accessibility;
 
 namespace
 {
+constexpr const char* FORCE_CHILD_SEARCH_ATTR{"forceChildSearch"};
+
 bool SortVertically(Component* lhs, Component* rhs)
 {
   auto leftRect  = lhs->GetExtents(CoordinateType::WINDOW);
@@ -437,7 +439,16 @@ Component* BridgeAccessible::CalculateNavigableAccessibleAtPoint(Accessible* roo
   auto rootComponent = dynamic_cast<Component*>(root);
   LOG() << "CalculateNavigableAccessibleAtPoint: checking: " << MakeIndent(maxRecursionDepth) << GetComponentInfo(rootComponent);
 
-  if(rootComponent && !rootComponent->IsAccessibleContainingPoint(point, type))
+  bool        forceChildSearch     = false;
+  const auto& attributes           = root->GetAttributes();
+  auto        forceChildSearchAttr = attributes.find(FORCE_CHILD_SEARCH_ATTR);
+  if(forceChildSearchAttr != attributes.end())
+  {
+    DALI_LOG_RELEASE_INFO("Force child search attr is set.");
+    forceChildSearch = std::atoi(forceChildSearchAttr->second.c_str()) == 1;
+  }
+
+  if(rootComponent && !forceChildSearch && !rootComponent->IsAccessibleContainingPoint(point, type))
   {
     return nullptr;
   }
@@ -489,7 +500,7 @@ BridgeAccessible::ReadingMaterialType BridgeAccessible::GetReadingMaterial()
 
   auto describedByObject = findObjectByRelationType(RelationType::DESCRIBED_BY);
 
-  double      currentValue     = 0.0;
+  double      currentValue = 0.0;
   std::string currentValueText;
   double      minimumIncrement = 0.0;
   double      maximumValue     = 0.0;
@@ -602,23 +613,23 @@ BridgeAccessible::ReadingMaterialType BridgeAccessible::GetReadingMaterial()
 
 BridgeAccessible::NodeInfoType BridgeAccessible::GetNodeInfo()
 {
-  auto self         = FindSelf();
-  auto roleName     = self->GetRoleName();
-  auto name         = self->GetName();
-  auto toolkitName  = "dali";
-  auto attributes   = self->GetAttributes();
-  auto states       = self->GetStates();
-
-  auto* component   = Component::DownCast(self);
+  auto self        = FindSelf();
+  auto roleName    = self->GetRoleName();
+  auto name        = self->GetName();
+  auto toolkitName = "dali";
+  auto attributes  = self->GetAttributes();
+  auto states      = self->GetStates();
+
+  auto*        component     = Component::DownCast(self);
   Dali::Rect<> screenExtents = {0, 0, 0, 0};
   Dali::Rect<> windowExtents = {0, 0, 0, 0};
-  if (component)
+  if(component)
   {
     screenExtents = component->GetExtents(CoordinateType::SCREEN);
     windowExtents = component->GetExtents(CoordinateType::WINDOW);
   }
 
-  auto* valueInterface    = Value::DownCast(self);
+  auto*  valueInterface   = Value::DownCast(self);
   double currentValue     = 0.0;
   double minimumIncrement = 0.0;
   double maximumValue     = 0.0;