[AT-SPI] Set keyboard focus to webview when a11y is enabled 04/318404/2
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Thu, 16 Jan 2025 09:42:16 +0000 (18:42 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 20 Jan 2025 09:58:52 +0000 (18:58 +0900)
- This commit is cherry-picked from tizen_7.0 branch
 5fc015cc177a0a877d8ea5ba614bb8ca4b25ef2a
- Review was got from archive tizen page :
 https://archive.tizen.org/gerrit/#/c/platform/core/uifw/dali-toolkit/+/319915/

Change-Id: Ic5acbe64fa7b44553b285ab4b1850f8e3c3cfc60
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
automated-tests/src/dali-toolkit-internal/utc-Dali-Accessibility-Controls-BridgeUp.cpp
dali-toolkit/internal/controls/web-view/web-view-impl.cpp

index 8a3d33ff36ec87003cb59dbc01d84f465cd3285c..f95e7775610332fb6509040690e52ff3811cd9b6 100644 (file)
@@ -2409,3 +2409,29 @@ int UtcDaliDumpTree(void)
 
   END_TEST;
 }
+
+int UtcDaliWebViewCheckResumeOnAccessibilityMode(void)
+{
+  ToolkitTestApplication application;
+
+  Dali::Accessibility::TestEnableSC(true);
+
+  WebView view = WebView::New();
+  view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+  view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+  view.SetProperty(Actor::Property::POSITION, Vector2(0, 0));
+  view.SetProperty(Actor::Property::SIZE, Vector2(800, 600));
+  DALI_TEST_CHECK(view);
+
+  application.GetScene().Add(view);
+  application.SendNotification();
+  application.Render();
+
+  view.Resume();
+  DALI_TEST_CHECK(view.HasKeyInputFocus());
+
+  Dali::Accessibility::TestEnableSC(false);
+
+  END_TEST;
+}
+
index a4f99a9c99d47731662afc2631304244df99c064..85a5d4db21c135ee0ae3427bb85f102ad80eb65c 100644 (file)
@@ -462,6 +462,11 @@ void WebView::Resume()
   {
     DALI_LOG_DEBUG_INFO("WebView[%p] Resume()\n", this);
     mWebEngine.Resume();
+
+    if(Dali::Accessibility::IsUp())
+    {
+      SetKeyInputFocus();
+    }
   }
 }
 
@@ -1569,6 +1574,13 @@ void WebView::WebViewAccessible::DoGetChildren(std::vector<Dali::Accessibility::
 
   if(mRemoteChild.GetAddress())
   {
+    auto actor   = GetInternalActor();
+    auto control = Toolkit::Control::DownCast(actor);
+    if(DALI_LIKELY(control))
+    {
+      control.SetKeyInputFocus();
+    }
+
     // DoGetChildren is called at most once per every OnChildrenChanged.
     // We have only one OnChildrenChanged in this case, so EmbedSocket will be called only once.
     Accessibility::Bridge::GetCurrentBridge()->EmbedSocket(GetAddress(), mRemoteChild.GetAddress());