X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fweb-view%2Fweb-view-impl.cpp;h=9edac2ddf76628dd62655662ed49db4bd6241569;hb=HEAD;hp=63216955fba642152ba1d44e1cd93b2862d3de8a;hpb=ee3cc0da8dbf399532ae1f36b85cc1aeb02c940d;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/web-view/web-view-impl.cpp b/dali-toolkit/internal/controls/web-view/web-view-impl.cpp old mode 100755 new mode 100644 index 6321695..319a7e3 --- a/dali-toolkit/internal/controls/web-view/web-view-impl.cpp +++ b/dali-toolkit/internal/controls/web-view/web-view-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 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. @@ -16,10 +16,9 @@ */ // CLASS HEADER -#include "web-view-impl.h" +#include // EXTERNAL INCLUDES -#include #include #include #include @@ -33,24 +32,30 @@ #include #include #include +#include #include #include #include +#include #include #include #include // INTERNAL INCLUDES +#include #include #include #include +#include +#include #include -#include #include +#include #include #include #include +#include namespace Dali { @@ -89,19 +94,76 @@ DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "loadProgressPercentage", FLOAT, DALI_TYPE_REGISTRATION_END() // clang-format on -} // namespace +std::unordered_map>& GetPluginWebViewTable() +{ + static std::unordered_map> pluginWebViewMap; + return pluginWebViewMap; +} + +enum class DisplayAreaCalculateOption +{ + PROPERTY = 0, ///< Calculate display update area by property + CURRENT_PROPERTY = 1, ///< Calculate display update area by current property +}; + +/** + * @brief Helper function to calculate exact display area, offset and size. + * It will be useful when view size is not integer value, or view size is not matched with texture size. + * + * @param[in] self The view itself. + * @param[in] option Option of this calculation. Let we decide what kind of property will be used. + * @return DisplayArea for this view. + */ +Rect CalculateDisplayArea(Dali::Actor self, DisplayAreaCalculateOption option) +{ + bool positionUsesAnchorPoint = self.GetProperty(Actor::Property::POSITION_USES_ANCHOR_POINT); + Vector3 actorSize = (option == DisplayAreaCalculateOption::CURRENT_PROPERTY) ? self.GetCurrentProperty(Actor::Property::SIZE) * self.GetCurrentProperty(Actor::Property::SCALE) + : self.GetProperty(Actor::Property::SIZE) * self.GetProperty(Actor::Property::SCALE); + Vector3 anchorPointOffSet = actorSize * (positionUsesAnchorPoint ? self.GetCurrentProperty(Actor::Property::ANCHOR_POINT) : AnchorPoint::TOP_LEFT); + Vector2 screenPosition = (option == DisplayAreaCalculateOption::CURRENT_PROPERTY) ? self.GetProperty(Actor::Property::SCREEN_POSITION) + : Dali::DevelActor::CalculateScreenPosition(self); + + Dali::Rect displayArea; + displayArea.x = screenPosition.x - anchorPointOffSet.x; + displayArea.y = screenPosition.y - anchorPointOffSet.y; + displayArea.width = actorSize.x; + displayArea.height = actorSize.y; -std::unordered_map> WebView::mPluginWebViewMap; + return displayArea; +} + +constexpr Vector4 FULL_TEXTURE_RECT(0.f, 0.f, 1.f, 1.f); + +/** + * @brief Helper function to calculate exact pixel area value by view and texture size. + * It will be useful when view size is not integer value, or view size is not matched with texture size. + * + * @param[in] viewSize The size of view. + * @param[in] textureWidth The width of texture, that must be integer type. + * @param[in] textureHeight The height of texture, that must be integer type. + * @return PixelArea value that image visual can use. + */ +Vector4 CalculatePixelArea(const Size& viewSize, const uint32_t textureWidth, const uint32_t textureHeight) +{ + float widthRatio = textureWidth == 0u ? 1.0f : viewSize.width / static_cast(textureWidth); + float heightRatio = textureHeight == 0u ? 1.0f : viewSize.height / static_cast(textureHeight); + return Vector4(0.0f, 0.0f, widthRatio, heightRatio); +} + +} // namespace WebView::WebView(const std::string& locale, const std::string& timezoneId) : Control(ControlBehaviour(ACTOR_BEHAVIOUR_DEFAULT | DISABLE_STYLE_CHANGE_SIGNALS)), mVisual(), mWebViewSize(Stage::GetCurrent().GetSize()), mWebEngine(), + mLastRenderedNativeImageWidth(0u), + mLastRenderedNativeImageHeight(0u), mWebViewArea(0, 0, mWebViewSize.width, mWebViewSize.height), mVideoHoleEnabled(false), mMouseEventsEnabled(true), mKeyEventsEnabled(true), + mVisualChangeRequired(false), mScreenshotCapturedCallback{nullptr}, mFrameRenderedCallback{nullptr} { @@ -119,10 +181,13 @@ WebView::WebView(uint32_t argc, char** argv) mVisual(), mWebViewSize(Stage::GetCurrent().GetSize()), mWebEngine(), + mLastRenderedNativeImageWidth(0u), + mLastRenderedNativeImageHeight(0u), mWebViewArea(0, 0, mWebViewSize.width, mWebViewSize.height), mVideoHoleEnabled(false), mMouseEventsEnabled(true), mKeyEventsEnabled(true), + mVisualChangeRequired(false), mScreenshotCapturedCallback{nullptr}, mFrameRenderedCallback{nullptr} { @@ -144,10 +209,10 @@ WebView::~WebView() { if(mWebEngine) { - auto iter = mPluginWebViewMap.find(mWebEngine.GetPlugin()); - if (iter != mPluginWebViewMap.end()) + auto iter = GetPluginWebViewTable().find(mWebEngine.GetPlugin()); + if(iter != GetPluginWebViewTable().end()) { - mPluginWebViewMap.erase(iter); + GetPluginWebViewTable().erase(iter); } mWebEngine.Destroy(); } @@ -157,9 +222,9 @@ Toolkit::WebView WebView::New() { WebView* impl = new WebView(); Toolkit::WebView handle = Toolkit::WebView(*impl); - if (impl->GetPlugin()) + if(impl->GetPlugin()) { - mPluginWebViewMap[impl->GetPlugin()] = handle; + GetPluginWebViewTable()[impl->GetPlugin()] = handle; } impl->Initialize(); return handle; @@ -169,9 +234,9 @@ Toolkit::WebView WebView::New(const std::string& locale, const std::string& time { WebView* impl = new WebView(locale, timezoneId); Toolkit::WebView handle = Toolkit::WebView(*impl); - if (impl->GetPlugin()) + if(impl->GetPlugin()) { - mPluginWebViewMap[impl->GetPlugin()] = handle; + GetPluginWebViewTable()[impl->GetPlugin()] = handle; } impl->Initialize(); return handle; @@ -181,9 +246,9 @@ Toolkit::WebView WebView::New(uint32_t argc, char** argv) { WebView* impl = new WebView(argc, argv); Toolkit::WebView handle = Toolkit::WebView(*impl); - if (impl->GetPlugin()) + if(impl->GetPlugin()) { - mPluginWebViewMap[impl->GetPlugin()] = handle; + GetPluginWebViewTable()[impl->GetPlugin()] = handle; } impl->Initialize(); return handle; @@ -191,8 +256,8 @@ Toolkit::WebView WebView::New(uint32_t argc, char** argv) Toolkit::WebView WebView::FindWebView(Dali::WebEnginePlugin* plugin) { - auto iter = mPluginWebViewMap.find(plugin); - if (iter != mPluginWebViewMap.end()) + auto iter = GetPluginWebViewTable().find(plugin); + if(iter != GetPluginWebViewTable().end()) { return iter->second.GetHandle(); } @@ -220,6 +285,8 @@ void WebView::OnInitialize() self.WheelEventSignal().Connect(this, &WebView::OnWheelEvent); Dali::DevelActor::VisibilityChangedSignal(self).Connect(this, &WebView::OnVisibilityChanged); + mWebViewVisibleState |= WebViewVisibleStateFlag::SELF_SHOW; + mPositionUpdateNotification = self.AddPropertyNotification(Actor::Property::WORLD_POSITION, StepCondition(1.0f, 1.0f)); mSizeUpdateNotification = self.AddPropertyNotification(Actor::Property::SIZE, StepCondition(1.0f, 1.0f)); mScaleUpdateNotification = self.AddPropertyNotification(Actor::Property::WORLD_SCALE, StepCondition(0.1f, 1.0f)); @@ -242,6 +309,18 @@ DevelControl::ControlAccessible* WebView::CreateAccessibleObject() return new WebViewAccessible(Self(), mWebEngine); } +void WebView::OnRelayout(const Vector2& size, RelayoutContainer& container) +{ + if(!mWebEngine) + { + return; + } + + auto displayArea = CalculateDisplayArea(Self(), DisplayAreaCalculateOption::PROPERTY); + + SetDisplayArea(displayArea); +} + Dali::Toolkit::WebSettings* WebView::GetSettings() const { return mWebSettings.get(); @@ -292,7 +371,7 @@ bool WebView::LoadHtmlStringOverrideCurrentEntry(const std::string& html, const return mWebEngine.LoadHtmlStringOverrideCurrentEntry(html, basicUri, unreachableUrl); } -bool WebView::LoadContents(const std::string& contents, uint32_t contentSize, const std::string& mimeType, const std::string& encoding, const std::string& baseUri) +bool WebView::LoadContents(const int8_t* contents, uint32_t contentSize, const std::string& mimeType, const std::string& encoding, const std::string& baseUri) { if(!mWebEngine) return false; @@ -416,7 +495,7 @@ void WebView::EvaluateJavaScript(const std::string& script, std::function viewArea, fl bool WebView::GetScreenshotAsynchronously(Dali::Rect viewArea, float scaleFactor, Dali::Toolkit::WebView::WebViewScreenshotCapturedCallback callback) { - mScreenshotCapturedCallback = callback; + mScreenshotCapturedCallback = std::move(callback); return mWebEngine ? mWebEngine.GetScreenshotAsynchronously(viewArea, scaleFactor, std::bind(&WebView::OnScreenshotCaptured, this, std::placeholders::_1)) : false; } bool WebView::CheckVideoPlayingAsynchronously(Dali::WebEnginePlugin::VideoPlayingCallback callback) { - return mWebEngine ? mWebEngine.CheckVideoPlayingAsynchronously(callback) : false; + return mWebEngine ? mWebEngine.CheckVideoPlayingAsynchronously(std::move(callback)) : false; } void WebView::RegisterGeolocationPermissionCallback(Dali::WebEnginePlugin::GeolocationPermissionCallback callback) { if(mWebEngine) { - mWebEngine.RegisterGeolocationPermissionCallback(callback); + mWebEngine.RegisterGeolocationPermissionCallback(std::move(callback)); } } @@ -624,7 +703,7 @@ void WebView::RegisterPageLoadStartedCallback(Dali::WebEnginePlugin::WebEnginePa { if(mWebEngine) { - mWebEngine.RegisterPageLoadStartedCallback(callback); + mWebEngine.RegisterPageLoadStartedCallback(std::move(callback)); } } @@ -632,7 +711,7 @@ void WebView::RegisterPageLoadInProgressCallback(Dali::WebEnginePlugin::WebEngin { if(mWebEngine) { - mWebEngine.RegisterPageLoadInProgressCallback(callback); + mWebEngine.RegisterPageLoadInProgressCallback(std::move(callback)); } } @@ -640,7 +719,7 @@ void WebView::RegisterPageLoadFinishedCallback(Dali::WebEnginePlugin::WebEngineP { if(mWebEngine) { - mWebEngine.RegisterPageLoadFinishedCallback(callback); + mWebEngine.RegisterPageLoadFinishedCallback(std::move(callback)); } } @@ -648,7 +727,7 @@ void WebView::RegisterPageLoadErrorCallback(Dali::WebEnginePlugin::WebEnginePage { if(mWebEngine) { - mWebEngine.RegisterPageLoadErrorCallback(callback); + mWebEngine.RegisterPageLoadErrorCallback(std::move(callback)); } } @@ -656,7 +735,7 @@ void WebView::RegisterScrollEdgeReachedCallback(Dali::WebEnginePlugin::WebEngine { if(mWebEngine) { - mWebEngine.RegisterScrollEdgeReachedCallback(callback); + mWebEngine.RegisterScrollEdgeReachedCallback(std::move(callback)); } } @@ -664,7 +743,7 @@ void WebView::RegisterUrlChangedCallback(Dali::WebEnginePlugin::WebEngineUrlChan { if(mWebEngine) { - mWebEngine.RegisterUrlChangedCallback(callback); + mWebEngine.RegisterUrlChangedCallback(std::move(callback)); } } @@ -672,20 +751,20 @@ void WebView::RegisterFormRepostDecidedCallback(Dali::WebEnginePlugin::WebEngine { if(mWebEngine) { - mWebEngine.RegisterFormRepostDecidedCallback(callback); + mWebEngine.RegisterFormRepostDecidedCallback(std::move(callback)); } } void WebView::RegisterFrameRenderedCallback(Dali::WebEnginePlugin::WebEngineFrameRenderedCallback callback) { - mFrameRenderedCallback = callback; + mFrameRenderedCallback = std::move(callback); } void WebView::RegisterConsoleMessageReceivedCallback(Dali::WebEnginePlugin::WebEngineConsoleMessageReceivedCallback callback) { if(mWebEngine) { - mWebEngine.RegisterConsoleMessageReceivedCallback(callback); + mWebEngine.RegisterConsoleMessageReceivedCallback(std::move(callback)); } } @@ -693,7 +772,7 @@ void WebView::RegisterResponsePolicyDecidedCallback(Dali::WebEnginePlugin::WebEn { if(mWebEngine) { - mWebEngine.RegisterResponsePolicyDecidedCallback(callback); + mWebEngine.RegisterResponsePolicyDecidedCallback(std::move(callback)); } } @@ -701,7 +780,7 @@ void WebView::RegisterNavigationPolicyDecidedCallback(Dali::WebEnginePlugin::Web { if(mWebEngine) { - mWebEngine.RegisterNavigationPolicyDecidedCallback(callback); + mWebEngine.RegisterNavigationPolicyDecidedCallback(std::move(callback)); } } @@ -709,7 +788,7 @@ void WebView::RegisterNewWindowCreatedCallback(Dali::WebEnginePlugin::WebEngineN { if(mWebEngine) { - mWebEngine.RegisterNewWindowCreatedCallback(callback); + mWebEngine.RegisterNewWindowCreatedCallback(std::move(callback)); } } @@ -717,7 +796,7 @@ void WebView::RegisterCertificateConfirmedCallback(Dali::WebEnginePlugin::WebEng { if(mWebEngine) { - mWebEngine.RegisterCertificateConfirmedCallback(callback); + mWebEngine.RegisterCertificateConfirmedCallback(std::move(callback)); } } @@ -725,7 +804,7 @@ void WebView::RegisterSslCertificateChangedCallback(Dali::WebEnginePlugin::WebEn { if(mWebEngine) { - mWebEngine.RegisterSslCertificateChangedCallback(callback); + mWebEngine.RegisterSslCertificateChangedCallback(std::move(callback)); } } @@ -733,7 +812,7 @@ void WebView::RegisterHttpAuthHandlerCallback(Dali::WebEnginePlugin::WebEngineHt { if(mWebEngine) { - mWebEngine.RegisterHttpAuthHandlerCallback(callback); + mWebEngine.RegisterHttpAuthHandlerCallback(std::move(callback)); } } @@ -741,7 +820,7 @@ void WebView::RegisterContextMenuShownCallback(Dali::WebEnginePlugin::WebEngineC { if(mWebEngine) { - mWebEngine.RegisterContextMenuShownCallback(callback); + mWebEngine.RegisterContextMenuShownCallback(std::move(callback)); } } @@ -749,7 +828,7 @@ void WebView::RegisterContextMenuHiddenCallback(Dali::WebEnginePlugin::WebEngine { if(mWebEngine) { - mWebEngine.RegisterContextMenuHiddenCallback(callback); + mWebEngine.RegisterContextMenuHiddenCallback(std::move(callback)); } } @@ -757,7 +836,7 @@ void WebView::GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceive { if(mWebEngine) { - mWebEngine.GetPlainTextAsynchronously(callback); + mWebEngine.GetPlainTextAsynchronously(std::move(callback)); } } @@ -768,56 +847,85 @@ void WebView::OnFrameRendered() mFrameRenderedCallback(); } - // Make sure that mVisual is created only once. - if (mVisual) - return; - - Dali::Toolkit::ImageUrl nativeImageUrl = Dali::Toolkit::Image::GenerateUrl(mWebEngine.GetNativeImageSource()); - mVisual = Toolkit::VisualFactory::Get().CreateVisual({{Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE}, {Toolkit::ImageVisual::Property::URL, nativeImageUrl.GetUrl()}}); - if(mVisual) + // Make sure that mVisual is created only if required. + if(mVisualChangeRequired || !mVisual) { - DevelControl::RegisterVisual(*this, Toolkit::WebView::Property::URL, mVisual); - EnableBlendMode(!mVideoHoleEnabled); + // Reset flag + mVisualChangeRequired = false; + + auto nativeImageSourcePtr = mWebEngine.GetNativeImageSource(); + + mLastRenderedNativeImageWidth = nativeImageSourcePtr->GetWidth(); + mLastRenderedNativeImageHeight = nativeImageSourcePtr->GetHeight(); + + Dali::Toolkit::ImageUrl nativeImageUrl = Dali::Toolkit::Image::GenerateUrl(nativeImageSourcePtr); + + mVisual = Toolkit::VisualFactory::Get().CreateVisual( + {{Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE}, + {Toolkit::ImageVisual::Property::URL, nativeImageUrl.GetUrl()}, + {Toolkit::ImageVisual::Property::PIXEL_AREA, FULL_TEXTURE_RECT}, + {Toolkit::ImageVisual::Property::WRAP_MODE_U, Dali::WrapMode::CLAMP_TO_EDGE}, + {Toolkit::ImageVisual::Property::WRAP_MODE_V, Dali::WrapMode::CLAMP_TO_EDGE}}); + + if(mVisual) + { + DevelControl::RegisterVisual(*this, Toolkit::WebView::Property::URL, mVisual, DepthIndex::CONTENT); + EnableBlendMode(!mVideoHoleEnabled); + } } } void WebView::OnDisplayAreaUpdated(Dali::PropertyNotification& /*source*/) { if(!mWebEngine) + { return; + } - Actor self(Self()); - - bool positionUsesAnchorPoint = self.GetProperty(Actor::Property::POSITION_USES_ANCHOR_POINT); - Vector3 actorSize = self.GetCurrentProperty(Actor::Property::SIZE) * self.GetCurrentProperty(Actor::Property::SCALE); - Vector3 anchorPointOffSet = actorSize * (positionUsesAnchorPoint ? self.GetCurrentProperty(Actor::Property::ANCHOR_POINT) : AnchorPoint::TOP_LEFT); - Vector2 screenPosition = self.GetProperty(Actor::Property::SCREEN_POSITION); + auto displayArea = CalculateDisplayArea(Self(), DisplayAreaCalculateOption::CURRENT_PROPERTY); - Dali::Rect displayArea; - displayArea.x = screenPosition.x - anchorPointOffSet.x; - displayArea.y = screenPosition.y - anchorPointOffSet.y; - displayArea.width = actorSize.x; - displayArea.height = actorSize.y; + SetDisplayArea(displayArea); +} - Size displaySize = Size(displayArea.width, displayArea.height); - if(mWebViewSize != displaySize) +void WebView::OnVisibilityChanged(Actor actor, bool isVisible, Dali::DevelActor::VisibilityChange::Type type) +{ + if(type == Dali::DevelActor::VisibilityChange::Type::SELF) { - mWebViewSize = displaySize; + if(isVisible) + { + mWebViewVisibleState |= WebViewVisibleStateFlag::SELF_SHOW; + } + else + { + mWebViewVisibleState &= ~WebViewVisibleStateFlag::SELF_SHOW; + } } - - if(mWebViewArea != displayArea) + else if(type == Dali::DevelActor::VisibilityChange::Type::PARENT) { - mWebViewArea = displayArea; - mWebEngine.UpdateDisplayArea(mWebViewArea); + if(isVisible) + { + mWebViewVisibleState |= WebViewVisibleStateFlag::PARENT_SHOW; + // TODO : We should consider double-hide called from parent + } + else + { + mWebViewVisibleState &= ~WebViewVisibleStateFlag::PARENT_SHOW; + } } + ApplyVisibilityCheck(); } -void WebView::OnVisibilityChanged(Actor actor, bool isVisible, Dali::DevelActor::VisibilityChange::Type type) +void WebView::OnWindowVisibilityChanged(Window window, bool visible) { - if(type == Dali::DevelActor::VisibilityChange::Type::SELF) + if(visible) + { + mWebViewVisibleState |= WebViewVisibleStateFlag::WINDOW_SHOW; + } + else { - SetVisibility(isVisible); + mWebViewVisibleState &= ~WebViewVisibleStateFlag::WINDOW_SHOW; } + ApplyVisibilityCheck(); } void WebView::OnScreenshotCaptured(Dali::PixelData pixel) @@ -829,12 +937,71 @@ void WebView::OnScreenshotCaptured(Dali::PixelData pixel) } } +void WebView::SetDisplayArea(const Dali::Rect& displayArea) +{ + Size displaySize = Size(displayArea.width, displayArea.height); + if(mWebViewSize != displaySize) + { + mWebViewSize = displaySize; + } + + if(mWebViewArea != displayArea) + { + // WebEngine visual size changed. we have to re-create visual. + mVisualChangeRequired = true; + + // Change old visual's pixel area matched as changed web view size + if(mVisual) + { + auto pixelArea = CalculatePixelArea(mWebViewSize, mLastRenderedNativeImageWidth, mLastRenderedNativeImageHeight); + Toolkit::GetImplementation(mVisual).DoAction(Toolkit::DevelVisual::Action::UPDATE_PROPERTY, {{Toolkit::ImageVisual::Property::PIXEL_AREA, pixelArea}}); + } + + mWebViewArea = displayArea; + mWebEngine.UpdateDisplayArea(mWebViewArea); + } +} + void WebView::OnSceneConnection(int depth) { + mWebViewVisibleState |= WebViewVisibleStateFlag::SCENE_ON; + mWebViewVisibleState |= WebViewVisibleStateFlag::PARENT_SHOW; + // TODO : We should consider already hided parent + Window window = DevelWindow::Get(Self()); + if(window) + { + // Hold the weak handle of the placement window. + mPlacementWindow = window; + if(window.IsVisible()) + { + mWebViewVisibleState |= WebViewVisibleStateFlag::WINDOW_SHOW; + } + else + { + mWebViewVisibleState &= ~WebViewVisibleStateFlag::WINDOW_SHOW; + } + DevelWindow::VisibilityChangedSignal(window).Connect(this, &WebView::OnWindowVisibilityChanged); + } + ApplyVisibilityCheck(); Control::OnSceneConnection(depth); EnableBlendMode(!mVideoHoleEnabled); } +void WebView::OnSceneDisconnection() +{ + mWebViewVisibleState &= ~WebViewVisibleStateFlag::SCENE_ON; + mWebViewVisibleState &= ~WebViewVisibleStateFlag::WINDOW_SHOW; + mWebViewVisibleState &= ~WebViewVisibleStateFlag::PARENT_SHOW; + Window window = mPlacementWindow.GetHandle(); + if(window) + { + DevelWindow::VisibilityChangedSignal(window).Disconnect(this, &WebView::OnWindowVisibilityChanged); + mPlacementWindow.Reset(); + } + ApplyVisibilityCheck(); + Control::OnSceneDisconnection(); +} + bool WebView::OnTouchEvent(Actor actor, const Dali::TouchEvent& touch) { bool result = false; @@ -1253,8 +1420,15 @@ bool WebView::SetVisibility(bool visible) return mWebEngine ? mWebEngine.SetVisibility(visible) : false; } +void WebView::ApplyVisibilityCheck() +{ + SetVisibility(mWebViewVisibleState == WebViewVisibleStateFlag::VISIBLE); +} + WebView::WebViewAccessible::WebViewAccessible(Dali::Actor self, Dali::WebEngine& webEngine) -: ControlAccessible(self), mRemoteChild{}, mWebEngine{webEngine} +: ControlAccessible(self), + mRemoteChild{}, + mWebEngine{webEngine} { mRemoteChild.SetParent(this); @@ -1285,6 +1459,12 @@ Dali::Accessibility::Attributes WebView::WebViewAccessible::GetAttributes() cons void WebView::WebViewAccessible::DoGetChildren(std::vector& children) { + if(Dali::Accessibility::IsUp() && !mRemoteChild.GetAddress()) + { + DALI_LOG_DEBUG_INFO("Try setting address as it has not not been set on initialize.\n"); + SetRemoteChildAddress(mWebEngine.GetAccessibilityAddress()); + } + if(mRemoteChild.GetAddress()) { // DoGetChildren is called at most once per every OnChildrenChanged.