From 7c78036ead6bb7f2ab62420f4bd169c27aedfb6d Mon Sep 17 00:00:00 2001 From: "venu.musham" Date: Wed, 8 Feb 2023 16:12:53 +0530 Subject: [PATCH 01/16] [M108 Migration][Compatibility] Support HTMLDocument width and height. According to W3C spec document.width and height are deprecated. For Tizen next version's, to support backward compatibility implement document.width and document.height. Reference: https://review.tizen.org/gerrit/278684 Change-Id: I0d656e980d814138683d0cac987b8e77cf609888 Signed-off-by: venu.musham --- third_party/blink/renderer/core/dom/document.cc | 16 ++++++++++++++++ third_party/blink/renderer/core/dom/document.h | 3 +++ third_party/blink/renderer/core/dom/document.idl | 3 +++ 3 files changed, 22 insertions(+) diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc index c33b310..63dfac2 100644 --- a/third_party/blink/renderer/core/dom/document.cc +++ b/third_party/blink/renderer/core/dom/document.cc @@ -8293,6 +8293,22 @@ bool Document::hasFocus() const { return GetPage() && GetPage()->GetFocusController().IsDocumentFocused(*this); } +int Document::width() { + UpdateStyleAndLayout(DocumentUpdateReason::kBeginMainFrame); + if (!GetLayoutView()) + return 0; + + return GetLayoutView()->DocumentRect().Width().ToInt(); +} + +int Document::height() { + UpdateStyleAndLayout(DocumentUpdateReason::kBeginMainFrame); + if (!GetLayoutView()) + return 0; + + return GetLayoutView()->DocumentRect().Height().ToInt(); +} + const AtomicString& Document::BodyAttributeValue( const QualifiedName& name) const { if (auto* bodyElement = body()) diff --git a/third_party/blink/renderer/core/dom/document.h b/third_party/blink/renderer/core/dom/document.h index 2498c9f..f509ac1 100644 --- a/third_party/blink/renderer/core/dom/document.h +++ b/third_party/blink/renderer/core/dom/document.h @@ -1673,6 +1673,9 @@ class CORE_EXPORT Document : public ContainerNode, // May return nullptr when PerformanceManager instrumentation is disabled. DocumentResourceCoordinator* GetResourceCoordinator(); + int width(); + int height(); + const AtomicString& bgColor() const; void setBgColor(const AtomicString&); const AtomicString& fgColor() const; diff --git a/third_party/blink/renderer/core/dom/document.idl b/third_party/blink/renderer/core/dom/document.idl index ffde41e..d4d198e 100644 --- a/third_party/blink/renderer/core/dom/document.idl +++ b/third_party/blink/renderer/core/dom/document.idl @@ -136,6 +136,9 @@ typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement; // HTML obsolete features // https://html.spec.whatwg.org/C/#Document-partial + readonly attribute long width; + readonly attribute long height; + [Measure] readonly attribute HTMLCollection anchors; [Measure] readonly attribute HTMLCollection applets; -- 2.7.4 From 62c07f083a9af6aca663773f2a96a7dd6c5e5bfe Mon Sep 17 00:00:00 2001 From: "ayush.k123" Date: Wed, 15 Feb 2023 09:21:00 +0530 Subject: [PATCH 02/16] [M108 Migration] Migrate changes related to touch events This patch migrates following changes related to touch events: 1. Add helper function for making ui::TouchEvent 2. Set touch events enable/disable preference from ewk api to EflEventHandler Reference: 1. https://review.tizen.org/gerrit/281666 2. https://review.tizen.org/gerrit/282749 Change-Id: I4df1851be7814316c1800dadca9a908a2c87d75f Signed-off-by: Ayush Kumar --- .../rwhv_aura_offscreen_helper_efl.cc | 12 ++++ .../renderer_host/rwhv_aura_offscreen_helper_efl.h | 3 + tizen_src/ewk/efl_integration/eweb_view.cc | 66 ++++++++++------------ tizen_src/ewk/efl_integration/eweb_view.h | 6 -- 4 files changed, 44 insertions(+), 43 deletions(-) diff --git a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc index 1b07939..7005822 100644 --- a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc +++ b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc @@ -1163,4 +1163,16 @@ void RWHVAuraOffscreenHelperEfl::BackgroundColorReceived(int callback_id, web_contents_->GetDelegate()->BackgroundColorReceived(callback_id, bg_color); } +void RWHVAuraOffscreenHelperEfl::SetTouchEventsEnabled(bool enabled) { + if (auto* event_handler = GetEventHandler()) + event_handler->SetTouchEventsEnabled(enabled); +} + +bool RWHVAuraOffscreenHelperEfl::TouchEventsEnabled() { + if (auto* event_handler = GetEventHandler()) + return event_handler->TouchEventsEnabled(); + + return false; +} + } // namespace content diff --git a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.h b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.h index c024976..216e234 100644 --- a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.h +++ b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.h @@ -72,6 +72,9 @@ class CONTENT_EXPORT RWHVAuraOffscreenHelperEfl { gfx::Size GetPhysicalBackingSize() const; void OnGetFocusedNodeBounds(const gfx::RectF& rect); + void SetTouchEventsEnabled(bool enabled); + bool TouchEventsEnabled(); + bool GetHorizontalPanningHold() const { return horizontal_panning_hold_; } void SetHorizontalPanningHold(bool hold) { horizontal_panning_hold_ = hold; } bool GetVerticalPanningHold() const { return vertical_panning_hold_; } diff --git a/tizen_src/ewk/efl_integration/eweb_view.cc b/tizen_src/ewk/efl_integration/eweb_view.cc index 3788a5d3..9ec559c7 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.cc +++ b/tizen_src/ewk/efl_integration/eweb_view.cc @@ -80,6 +80,7 @@ #include "ui/events/event_switches.h" #include "ui/gfx/geometry/dip_util.h" #include "ui/gfx/geometry/vector2d_f.h" +#include "ui/ozone/platform/efl/efl_event_handler.h" #include "ui/platform_window/platform_window_init_properties.h" #include "web_contents_delegate_efl.h" #include "web_contents_efl_delegate_ewk.h" @@ -234,13 +235,6 @@ EWebView* EWebView::FromEvasObject(Evas_Object* eo) { return WebViewDelegateEwk::GetInstance().GetWebViewFromEvasObject(eo); } -#if !defined(USE_AURA) -RenderWidgetHostViewEfl* EWebView::rwhv() const { - return static_cast( - web_contents_->GetRenderWidgetHostView()); -} -#endif - void EWebView::OnViewFocusIn(void* data, Evas*, Evas_Object*, void*) { auto view = static_cast(data); view->SetFocus(EINA_TRUE); @@ -255,7 +249,6 @@ EWebView::EWebView(Ewk_Context* context, Evas_Object* object) : context_(context), evas_object_(object), native_view_(object), - touch_events_enabled_(false), mouse_events_enabled_(false), text_zoom_factor_(1.0), formIsNavigating_(false), @@ -787,7 +780,6 @@ void EWebView::InvokePolicyNavigationCallback( void EWebView::HandleTouchEvents(Ewk_Touch_Event_Type type, const Eina_List* points, const Evas_Modifier* modifiers) { -#if !defined(USE_AURA) const Eina_List* l; void* data; EINA_LIST_FOREACH(points, l, data) { @@ -796,41 +788,45 @@ void EWebView::HandleTouchEvents(Ewk_Touch_Event_Type type, // Chromium doesn't expect (and doesn't like) these events. continue; } - if (rwhv()) { + if (rwhva()) { Evas_Coord_Point pt; pt.x = point->x; pt.y = point->y; + + int delta_y = 0; + evas_object_geometry_get(evas_object(), nullptr, &delta_y, nullptr, + nullptr); ui::TouchEvent touch_event = - MakeTouchEvent(pt, point->state, point->id, evas_object()); - rwhv()->HandleTouchEvent(&touch_event); + ui::MakeTouchEvent(pt, point->state, point->id, 0, delta_y); + rwhva()->OnTouchEvent(&touch_event); } } -#endif } bool EWebView::TouchEventsEnabled() const { - return touch_events_enabled_; + return rwhva()->offscreen_helper()->TouchEventsEnabled(); } // TODO: Touch events use the same mouse events in EFL API. // Figure out how to distinguish touch and mouse events on touch&mice devices. // Currently mouse and touch support is mutually exclusive. void EWebView::SetTouchEventsEnabled(bool enabled) { - if (touch_events_enabled_ == enabled) + if (!rwhva() || !rwhva()->offscreen_helper()) { + LOG(WARNING) << "RWHV is not created yet!"; return; + } - touch_events_enabled_ = enabled; -#if !defined(USE_AURA) - GetWebContentsViewEfl()->SetTouchEventsEnabled(enabled); -#endif -#if !defined(EWK_BRINGUP) // FIXME: m94 bringup - // there is no flag touch_enabled in web preferences - GetSettings()->getPreferences().touch_enabled = enabled; + if (rwhva()->offscreen_helper()->TouchEventsEnabled() == enabled) + return; + + rwhva()->offscreen_helper()->SetTouchEventsEnabled(enabled); + + GetSettings()->getPreferences().touch_event_feature_detection_enabled = + enabled; GetSettings()->getPreferences().double_tap_to_zoom_enabled = enabled; GetSettings()->getPreferences().editing_behavior = - enabled ? content::EDITING_BEHAVIOR_ANDROID - : content::EDITING_BEHAVIOR_UNIX; -#endif + enabled ? blink::mojom::EditingBehavior::kEditingAndroidBehavior + : blink::mojom::EditingBehavior::kEditingUnixBehavior, UpdateWebKitPreferences(); } @@ -839,13 +835,16 @@ bool EWebView::MouseEventsEnabled() const { } void EWebView::SetMouseEventsEnabled(bool enabled) { + if (!rwhva() || !rwhva()->offscreen_helper()) { + LOG(WARNING) << "RWHV is not created yet!"; + return; + } + if (mouse_events_enabled_ == enabled) return; mouse_events_enabled_ = enabled; -#if !defined(USE_AURA) - GetWebContentsViewEfl()->SetTouchEventsEnabled(!enabled); -#endif + rwhva()->offscreen_helper()->SetTouchEventsEnabled(!enabled); } namespace { @@ -953,12 +952,6 @@ bool EWebView::SetUserAgentAppName(const char* application_name) { return true; } -void EWebView::set_magnifier(bool status) { -#if !defined(USE_AURA) - rwhv()->set_magnifier(status); -#endif -} - #if BUILDFLAG(IS_TIZEN) bool EWebView::SetPrivateBrowsing(bool incognito) { if (context_->GetImpl()->browser_context()->IsOffTheRecord() == incognito) @@ -1252,13 +1245,13 @@ void EWebView::PopupMenuClose() { void EWebView::HandleLongPressGesture( const content::ContextMenuParams& params) { -#if !defined(USE_AURA) // This menu is created in renderer process and it does not now anything about // view scaling factor and it has another calling sequence, so coordinates is // not updated. content::ContextMenuParams convertedParams = params; gfx::Point convertedPoint = - rwhv()->ConvertPointInViewPix(gfx::Point(params.x, params.y)); + rwhva()->offscreen_helper()->ConvertPointInViewPix( + gfx::Point(params.x, params.y)); convertedParams.x = convertedPoint.x(); convertedParams.y = convertedPoint.y(); @@ -1274,7 +1267,6 @@ void EWebView::HandleLongPressGesture( if (show_context_menu_now) ShowContextMenuInternal(convertedParams); } -#endif } void EWebView::ShowContextMenu(const content::ContextMenuParams& params) { diff --git a/tizen_src/ewk/efl_integration/eweb_view.h b/tizen_src/ewk/efl_integration/eweb_view.h index bcf8a89..eda7a4a 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.h +++ b/tizen_src/ewk/efl_integration/eweb_view.h @@ -311,8 +311,6 @@ class EWebView { return EWebViewCallbacks::CallBack(evas_object_); } - void set_magnifier(bool status); - // ewk_view api void SetURL(const GURL& url, bool from_api = false); const GURL& GetURL() const; @@ -699,9 +697,6 @@ class EWebView { #if BUILDFLAG(IS_TIZEN) && !defined(EWK_BRINGUP) bool LaunchCamera(std::u16string mimetype); #endif -#if !defined(USE_AURA) - content::RenderWidgetHostViewEfl* rwhv() const; -#endif JavaScriptDialogManagerEfl* GetJavaScriptDialogManagerEfl(); void ReleasePopupMenuList(); @@ -738,7 +733,6 @@ class EWebView { std::unique_ptr<_Ewk_Policy_Decision> window_policy_; Evas_Object* evas_object_; Evas_Object* native_view_; - bool touch_events_enabled_; bool mouse_events_enabled_; double text_zoom_factor_; mutable std::string user_agent_; -- 2.7.4 From 26b8e44c18d5dd0dff115b582eede17ba97af20a Mon Sep 17 00:00:00 2001 From: "yh106.jung" Date: Wed, 15 Feb 2023 21:58:41 -0800 Subject: [PATCH 03/16] Post tasks to proper threads This patch posts tasks to proper content browser's threads, not to threadpool. Change-Id: I59efb81e1ac2f470d1c4cf8e84915b73766faec7 Signed-off-by: yh106.jung --- .../browser/browsing_data_remover_efl.cc | 7 +-- .../geolocation_permission_context_efl.cc | 3 +- .../browser/quota_permission_context_efl.cc | 6 +-- .../resource_dispatcher_host_delegate_efl.cc | 3 +- tizen_src/ewk/efl_integration/cookie_manager.cc | 25 ++++------ tizen_src/ewk/efl_integration/eweb_context.cc | 57 ++++++++++------------ tizen_src/ewk/efl_integration/eweb_view.cc | 23 +++------ .../url_request_context_getter_efl.cc | 3 +- 8 files changed, 49 insertions(+), 78 deletions(-) diff --git a/tizen_src/ewk/efl_integration/browser/browsing_data_remover_efl.cc b/tizen_src/ewk/efl_integration/browser/browsing_data_remover_efl.cc index 17b2a62..b6499f6 100644 --- a/tizen_src/ewk/efl_integration/browser/browsing_data_remover_efl.cc +++ b/tizen_src/ewk/efl_integration/browser/browsing_data_remover_efl.cc @@ -7,7 +7,6 @@ #include "base/bind.h" #include "base/logging.h" #include "base/task/bind_post_task.h" -#include "base/task/thread_pool.h" #include "base/threading/thread_task_runner_handle.h" #include "content/common/render_messages_efl.h" #include "content/public/browser/browser_context.h" @@ -116,8 +115,7 @@ void BrowsingDataRemoverEfl::RemoveImpl(int remove_mask, browser_context_->GetStoragePartition(NULL)->GetQuotaManager(); } waiting_for_clear_quota_managed_data_ = true; - base::ThreadPool::PostTask( - FROM_HERE, {BrowserThread::IO}, + content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(&BrowsingDataRemoverEfl::ClearQuotaManagedDataOnIOThread, base::Unretained(this))); } @@ -238,8 +236,7 @@ void BrowsingDataRemoverEfl::CheckQuotaManagedDataDeletionStatus() { quota_managed_origins_to_delete_count_ != 0) return; - base::ThreadPool::PostTask( - FROM_HERE, {BrowserThread::UI}, + content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(&BrowsingDataRemoverEfl::OnQuotaManagedDataDeleted, base::Unretained(this))); } diff --git a/tizen_src/ewk/efl_integration/browser/geolocation/geolocation_permission_context_efl.cc b/tizen_src/ewk/efl_integration/browser/geolocation/geolocation_permission_context_efl.cc index 68db2da..695ffe1 100644 --- a/tizen_src/ewk/efl_integration/browser/geolocation/geolocation_permission_context_efl.cc +++ b/tizen_src/ewk/efl_integration/browser/geolocation/geolocation_permission_context_efl.cc @@ -78,8 +78,7 @@ void GeolocationPermissionContextEfl::RequestPermission( int render_frame_id, const GURL& requesting_frame, base::OnceCallback callback) const { - base::ThreadPool::PostTask( - FROM_HERE, {BrowserThread::UI}, + content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce( &GeolocationPermissionContextEfl::RequestPermissionOnUIThread, weak_ptr_factory_.GetWeakPtr(), render_process_id, render_frame_id, diff --git a/tizen_src/ewk/efl_integration/browser/quota_permission_context_efl.cc b/tizen_src/ewk/efl_integration/browser/quota_permission_context_efl.cc index f24bee9..5aea03e 100644 --- a/tizen_src/ewk/efl_integration/browser/quota_permission_context_efl.cc +++ b/tizen_src/ewk/efl_integration/browser/quota_permission_context_efl.cc @@ -17,8 +17,7 @@ void QuotaPermissionContextEfl::RequestQuotaPermission( int render_process_id, QuotaPermissionContext::PermissionCallback callback) { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - base::ThreadPool::PostTask( - FROM_HERE, {BrowserThread::UI}, + content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(&QuotaPermissionContextEfl::RequestQuotaPermission, this, params, render_process_id, std::move(callback))); return; @@ -48,8 +47,7 @@ void QuotaPermissionContextEfl::DispatchCallback( DCHECK_EQ(false, callback.is_null()); if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)) { - base::ThreadPool::PostTask( - FROM_HERE, {BrowserThread::IO}, + content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(&QuotaPermissionContextEfl::DispatchCallback, std::move(callback), response)); return; diff --git a/tizen_src/ewk/efl_integration/browser/resource_dispatcher_host_delegate_efl.cc b/tizen_src/ewk/efl_integration/browser/resource_dispatcher_host_delegate_efl.cc index 1ed69cb..2be3a74 100644 --- a/tizen_src/ewk/efl_integration/browser/resource_dispatcher_host_delegate_efl.cc +++ b/tizen_src/ewk/efl_integration/browser/resource_dispatcher_host_delegate_efl.cc @@ -137,8 +137,7 @@ void ResourceDispatcherHostDelegateEfl::TriggerNewDownloadStartCallback( // Since called by IO thread callback trigger needs to // be posted to UI thread so that IO thread is unblocked - base::ThreadPool::PostTaskWithTraits( - FROM_HERE, {BrowserThread::UI}, + content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(TriggerNewDownloadStartCallbackOnUIThread, render_process_id, render_view_id, request->url(), user_agent, content_disposition, mime_type, diff --git a/tizen_src/ewk/efl_integration/cookie_manager.cc b/tizen_src/ewk/efl_integration/cookie_manager.cc index 917ebb4..326328e 100644 --- a/tizen_src/ewk/efl_integration/cookie_manager.cc +++ b/tizen_src/ewk/efl_integration/cookie_manager.cc @@ -10,7 +10,6 @@ #include "base/logging.h" #include "base/stl_util.h" #include "base/synchronization/waitable_event.h" -#include "base/task/thread_pool.h" #include "browser/scoped_allow_wait_for_legacy_web_view_api.h" #include "browser_context_efl.h" #include "content/browser/storage_partition_impl.h" @@ -126,8 +125,7 @@ void CookieManager::DeleteCookiesOnIOThread(const std::string& url, void CookieManager::DeleteCookiesAsync(const std::string& url, const std::string& cookie_name) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - base::ThreadPool::PostTask( - FROM_HERE, {BrowserThread::IO}, + content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(&CookieManager::DeleteCookiesOnIOThread, base::Unretained(this), url, cookie_name)); } @@ -153,8 +151,7 @@ void CookieManager::SetStoragePath(const std::string& path, scoped_refptr context_getter = GetContextGetter(); if (context_getter.get()) { - base::ThreadPool::PostTask( - FROM_HERE, {BrowserThread::IO}, + content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(SetStoragePathOnIOThread, context_getter, path, persist_session_cookies, file_storage_type)); } @@ -162,8 +159,7 @@ void CookieManager::SetStoragePath(const std::string& path, void CookieManager::GetAcceptPolicyAsync(Ewk_Cookie_Manager_Policy_Async_Get_Cb callback, void *data) { AutoLock lock(lock_); - base::ThreadPool::PostTask( - FROM_HERE, {BrowserThread::UI}, + content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(&TriggerHostPolicyGetCallbackAsyncOnUIThread, cookie_policy_, callback, data)); } @@ -171,8 +167,7 @@ void CookieManager::GetAcceptPolicyAsync(Ewk_Cookie_Manager_Policy_Async_Get_Cb void CookieManager::GetHostNamesWithCookiesAsync(AsyncHostnamesGetCb callback, void *data) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); host_callback_queue_.push(new EwkGetHostCallback(callback, data)); - base::ThreadPool::PostTask( - FROM_HERE, {BrowserThread::IO}, + content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(&CookieManager::FetchCookiesOnIOThread, GetSharedThis())); } @@ -189,9 +184,9 @@ void CookieManager::FetchCookiesOnIOThread() { void CookieManager::OnFetchComplete(const net::CookieList& cookies) { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - base::ThreadPool::PostTask(FROM_HERE, {BrowserThread::UI}, - base::BindOnce(&CookieManager::OnFetchComplete, - base::Unretained(this), cookies)); + content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, + base::BindOnce(&CookieManager::OnFetchComplete, + base::Unretained(this), cookies)); return; } if (!host_callback_queue_.empty()) { @@ -282,8 +277,7 @@ void CookieManager::AllowFileSchemeCookies(bool allow) { ->GetDefaultStoragePartition() ->GetCookieManagerForBrowserProcess(); - base::ThreadPool::PostTask( - FROM_HERE, {BrowserThread::IO}, + content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(&CookieManager::AllowFileSchemeCookiesOnIOThread, weak_ptr_factory_.GetWeakPtr(), cookie_manager, allow)); } @@ -341,8 +335,7 @@ std::string CookieManager::GetCookiesForURL(const std::string& url) { std::string cookie_value; base::WaitableEvent completion(base::WaitableEvent::ResetPolicy::AUTOMATIC, base::WaitableEvent::InitialState::NOT_SIGNALED); - base::ThreadPool::PostTask( - FROM_HERE, {BrowserThread::IO}, + content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(GetCookieValueOnIOThread, cookie_store, GURL(url), &cookie_value, &completion)); // allow wait temporarily. diff --git a/tizen_src/ewk/efl_integration/eweb_context.cc b/tizen_src/ewk/efl_integration/eweb_context.cc index a8254fc..7cf189b 100644 --- a/tizen_src/ewk/efl_integration/eweb_context.cc +++ b/tizen_src/ewk/efl_integration/eweb_context.cc @@ -12,7 +12,6 @@ #endif #include "base/synchronization/waitable_event.h" -#include "base/task/thread_pool.h" #include "browser/favicon/favicon_database.h" #include "browser/password_manager/password_helper_efl.h" #include "browser/tizen_extensible_host.h" @@ -165,8 +164,8 @@ void OnTemporaryUsageAndQuotaObtained( // We still trigger callback. usage = 0; } - base::ThreadPool::PostTask(FROM_HERE, {BrowserThread::UI}, - base::BindOnce(callback, usage, user_data)); + content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, + base::BindOnce(callback, usage, user_data)); } void OnGetWebDBOrigins(storage::DatabaseQuotaClient* client, @@ -179,8 +178,8 @@ void OnGetWebDBOrigins(storage::DatabaseQuotaClient* client, new _Ewk_Security_Origin(key.origin().GetURL()); origin_list = eina_list_append(origin_list, sec_origin); } - base::ThreadPool::PostTask(FROM_HERE, {BrowserThread::UI}, - base::BindOnce(callback, origin_list, user_data)); + content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, + base::BindOnce(callback, origin_list, user_data)); } void OnGetWebDBUsageForOrigin(Ewk_Web_Database_Usage_Get_Callback callback, @@ -201,8 +200,8 @@ void OnGetFileSystemOrigins( new _Ewk_Security_Origin(key.origin().GetURL()); origin_list = eina_list_append(origin_list, sec_origin); } - base::ThreadPool::PostTask(FROM_HERE, {BrowserThread::UI}, - base::BindOnce(callback, origin_list, user_data)); + content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, + base::BindOnce(callback, origin_list, user_data)); } void OnGetPasswordDataList( @@ -519,14 +518,12 @@ void EWebContext::SetProxyUri(const char* uri) { config.proxy_rules().ParseFromString(proxy_uri_); base::WaitableEvent done(base::WaitableEvent::ResetPolicy::AUTOMATIC, base::WaitableEvent::InitialState::NOT_SIGNALED); - base::ThreadPool::PostTask( - FROM_HERE, {BrowserThread::IO}, - base::BindOnce( - &SetProxyConfigCallbackOnIOThread, &done, - base::RetainedRef( - BrowserContext::GetDefaultStoragePartition(browser_context()) - ->GetURLRequestContext()), - config)); + content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce( + &SetProxyConfigCallbackOnIOThread, &done, + base::RetainedRef( + BrowserContext::GetDefaultStoragePartition(browser_context()) + ->GetURLRequestContext()), + config)); done.Wait(); #endif } @@ -609,8 +606,7 @@ void EWebContext::GetApplicationCacheUsage( content::StoragePartition* partition = BrowserContext::GetStoragePartition(browser_context_.get(), NULL); - base::ThreadPool::PostTask( - FROM_HERE, {BrowserThread::IO}, + content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(&storage::QuotaManager::GetUsageAndQuota, partition->GetQuotaManager(), url, blink::mojom::StorageType::kTemporary, @@ -649,8 +645,7 @@ void EWebContext::LocalStorageUsageForOrigin( void EWebContext::WebStorageDelete() { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - base::ThreadPool::PostTask( - FROM_HERE, {BrowserThread::UI}, + content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(&EWebContext::WebStorageDelete, base::Unretained(this))); return; } @@ -661,8 +656,7 @@ void EWebContext::WebStorageDelete() { void EWebContext::WebStorageDeleteForOrigin(const GURL& origin) { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - base::ThreadPool::PostTask( - FROM_HERE, {BrowserThread::UI}, + content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(&EWebContext::WebStorageDeleteForOrigin, base::Unretained(this), origin)); return; @@ -693,8 +687,7 @@ void EWebContext::WebStorageOriginsAllGet( void EWebContext::IndexedDBDelete() { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - base::ThreadPool::PostTask( - FROM_HERE, {BrowserThread::UI}, + content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(&EWebContext::IndexedDBDelete, base::Unretained(this))); return; } @@ -705,9 +698,9 @@ void EWebContext::IndexedDBDelete() { void EWebContext::WebDBDelete(const GURL& host) { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - base::ThreadPool::PostTask(FROM_HERE, {BrowserThread::UI}, - base::BindOnce(&EWebContext::WebDBDelete, - base::Unretained(this), host)); + content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, + base::BindOnce(&EWebContext::WebDBDelete, + base::Unretained(this), host)); return; } BrowsingDataRemoverEfl* remover = @@ -750,9 +743,9 @@ void EWebContext::GetWebDBUsageForOrigin( void EWebContext::FileSystemDelete(const GURL& host) { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - base::ThreadPool::PostTask(FROM_HERE, {BrowserThread::UI}, - base::BindOnce(&EWebContext::FileSystemDelete, - base::Unretained(this), host)); + content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, + base::BindOnce(&EWebContext::FileSystemDelete, + base::Unretained(this), host)); return; } BrowsingDataRemoverEfl* remover = @@ -812,9 +805,9 @@ Evas_Object* EWebContext::AddFaviconObject(const char* uri, void EWebContext::ClearCandidateData() { #if defined(TIZEN_AUTOFILL_SUPPORT) if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - base::ThreadPool::PostTask(FROM_HERE, {BrowserThread::UI}, - base::BindOnce(&EWebContext::ClearCandidateData, - base::Unretained(this))); + content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, + base::BindOnce(&EWebContext::ClearCandidateData, + base::Unretained(this))); return; } WebDataServiceFactoryEfl* webDataServiceInstance = diff --git a/tizen_src/ewk/efl_integration/eweb_view.cc b/tizen_src/ewk/efl_integration/eweb_view.cc index 9ec559c7..ede6cd4 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.cc +++ b/tizen_src/ewk/efl_integration/eweb_view.cc @@ -591,10 +591,8 @@ void EWebView::Suspend() { rfh->BlockRequestsForFrame(); #endif #if 0 - content::BrowserThread::PostTask( - content::BrowserThread::IO, FROM_HERE, - base::BindOnce(&content::ResourceDispatcherHost::BlockRequestsForFrameFromUI, - rfh)); + content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce( + &content::ResourceDispatcherHost::BlockRequestsForFrameFromUI, rfh)); if (rvh) rvh->Send(new EwkViewMsg_SuspendScheduledTask(rvh->GetRoutingID())); @@ -611,11 +609,9 @@ void EWebView::Resume() { rfh->ResumeBlockedRequestsForFrame(); #endif #if 0 - content::BrowserThread::PostTask( - content::BrowserThread::IO, FROM_HERE, - base::BindOnce( - &content::ResourceDispatcherHost::ResumeBlockedRequestsForFrameFromUI, - rfh)); + content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce( + &content::ResourceDispatcherHost::ResumeBlockedRequestsForFrameFromUI, + rfh)); if (rvh) rvh->Send(new EwkViewMsg_ResumeScheduledTasks(rvh->GetRoutingID())); @@ -2424,8 +2420,7 @@ void EWebView::SyncAcceptLanguages(const std::string& accept_languages) { } void EWebView::HandleRendererProcessCrash() { - base::ThreadPool::PostTask( - FROM_HERE, {BrowserThread::UI}, + content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(&EWebView::InvokeWebProcessCrashedCallback, base::Unretained(this))); } @@ -2741,8 +2736,7 @@ void EWebView::SendDelayedMessages(RenderViewHost* render_view_host) { DCHECK(render_view_host); if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - base::ThreadPool::PostTask( - FROM_HERE, {BrowserThread::UI}, + content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(&EWebView::SendDelayedMessages, base::Unretained(this), render_view_host)); return; @@ -2838,8 +2832,7 @@ void EWebView::InvokeExceededIndexedDatabaseQuotaCallback( const GURL& origin, int64_t current_quota) { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - base::ThreadPool::PostTask( - FROM_HERE, {BrowserThread::UI}, + content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(&EWebView::InvokeExceededIndexedDatabaseQuotaCallback, base::Unretained(this), origin, current_quota)); return; diff --git a/tizen_src/ewk/efl_integration/url_request_context_getter_efl.cc b/tizen_src/ewk/efl_integration/url_request_context_getter_efl.cc index 2d320c3..82a6dce 100644 --- a/tizen_src/ewk/efl_integration/url_request_context_getter_efl.cc +++ b/tizen_src/ewk/efl_integration/url_request_context_getter_efl.cc @@ -249,8 +249,7 @@ void URLRequestContextGetterEfl::SetCookieStoragePath( } if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { - base::ThreadPool::PostTask( - FROM_HERE, {BrowserThread::IO}, + content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE, base::BindOnce(&URLRequestContextGetterEfl::SetCookieStoragePath, this, path, persist_session_cookies, file_storage)); return; -- 2.7.4 From 8e84e05f8e96e85548a31cc6775c15ce6fed74a2 Mon Sep 17 00:00:00 2001 From: "ayush.k123" Date: Wed, 15 Feb 2023 11:28:50 +0530 Subject: [PATCH 04/16] [M108 Migration] Implement ewk_view_main_frame_scrollbar_visible_set This patch implements ewk_view_main_frame_scrollbar_visible_set which is at least required by HbbTV. It also implements ewk_view_main_frame_scrollbar_visible_get and adds a unit test utc_blink_ewk_view_main_frame_scrollbar_visible_set. Reference: https://review.tizen.org/gerrit/280384/ Change-Id: I05a4f74e74d2305975d2cca81d246036c61987e8 Signed-off-by: Ayush Kumar --- .../renderer_host/render_widget_host_impl.cc | 17 +++++ .../renderer_host/render_widget_host_impl.h | 3 + .../renderer_host/render_widget_host_view_aura.cc | 6 ++ .../renderer_host/render_widget_host_view_aura.h | 1 + .../renderer_host/render_widget_host_view_base.h | 2 + content/public/browser/web_contents_delegate.h | 1 + .../public/mojom/widget/platform_widget.mojom | 6 ++ third_party/blink/public/web/web_local_frame.h | 7 ++ .../blink/renderer/core/frame/local_frame_view.cc | 48 +++++++++++++ .../blink/renderer/core/frame/local_frame_view.h | 9 +++ .../blink/renderer/core/frame/visual_viewport.cc | 7 ++ .../renderer/core/frame/web_frame_widget_impl.cc | 19 +++++ .../renderer/core/frame/web_frame_widget_impl.h | 2 + .../renderer/core/frame/web_local_frame_impl.cc | 17 +++++ .../renderer/core/frame/web_local_frame_impl.h | 6 ++ .../blink/renderer/platform/widget/widget_base.cc | 11 +++ .../blink/renderer/platform/widget/widget_base.h | 3 + .../renderer/platform/widget/widget_base_client.h | 2 + .../rwhv_aura_offscreen_helper_efl.cc | 6 ++ .../renderer_host/rwhv_aura_offscreen_helper_efl.h | 1 + tizen_src/ewk/efl_integration/eweb_view.cc | 41 +++++++++++ tizen_src/ewk/efl_integration/eweb_view.h | 7 ++ tizen_src/ewk/efl_integration/public/ewk_view.cc | 18 +++-- .../efl_integration/web_contents_delegate_efl.cc | 4 ++ .../efl_integration/web_contents_delegate_efl.h | 2 + tizen_src/ewk/unittest/BUILD.gn | 1 + ..._view_main_frame_scrollbar_visible_set_func.cpp | 84 ++++++++++++++++++++++ 27 files changed, 327 insertions(+), 4 deletions(-) create mode 100644 tizen_src/ewk/unittest/utc_blink_ewk_view_main_frame_scrollbar_visible_set_func.cpp diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index 2dcf337..4c81a6c 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -1023,6 +1023,23 @@ void RenderWidgetHostImpl::PrintToPdf(int width, const base::FilePath& filename) { blink_widget_->PrintToPdf(width, height, filename); } + +void RenderWidgetHostImpl::SetMainFrameScrollbarVisible(bool visible) { + blink_widget_->SetMainFrameScrollbarVisible(visible); +} + +void RenderWidgetHostImpl::RequestMainFrameScrollbarVisible(int callback_id) { + blink_widget_->RequestMainFrameScrollbarVisible( + base::BindOnce(&RenderWidgetHostImpl::OnGetMainFrameScrollbarVisible, + weak_factory_.GetWeakPtr(), callback_id)); +} + +void RenderWidgetHostImpl::OnGetMainFrameScrollbarVisible(int callback_id, + bool visible) { + if (!view_) + return; + view_->OnGetMainFrameScrollbarVisible(callback_id, visible); +} #endif #if defined(TIZEN_VIDEO_HOLE) diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h index 3e509d3..7ce20f4 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h @@ -450,6 +450,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl void OnGetFocusedNodeBounds(const gfx::RectF& rect); void SetLongPollingGlobalTimeout(uint64_t timeout); void PrintToPdf(int width, int height, const base::FilePath& filename); + void SetMainFrameScrollbarVisible(bool visible); + void RequestMainFrameScrollbarVisible(int callback_id); + void OnGetMainFrameScrollbarVisible(int callback_id, bool visible); #endif #if defined(TIZEN_VIDEO_HOLE) diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index 325ae915..80532e1 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -2280,6 +2280,12 @@ void RenderWidgetHostViewAura::OnGetFocusedNodeBounds(const gfx::RectF& rect) { if (offscreen_helper_) offscreen_helper_->OnGetFocusedNodeBounds(rect); } + +void RenderWidgetHostViewAura::OnGetMainFrameScrollbarVisible(int callback_id, + bool visible) { + if (offscreen_helper_) + offscreen_helper_->OnGetMainFrameScrollbarVisible(callback_id, visible); +} #endif //////////////////////////////////////////////////////////////////////////////// diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h index f2c730d..ad53ed5 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h @@ -431,6 +431,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAura void TextInputStateChanged(const ui::mojom::TextInputState& params) override; void BackgroundColorReceived(int callback_id, SkColor bg_color) override; void OnGetFocusedNodeBounds(const gfx::RectF& rect) override; + void OnGetMainFrameScrollbarVisible(int callback_id, bool visible) override; #endif protected: diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h index 4653432..02b76fa 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h @@ -288,6 +288,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { virtual void BackgroundColorReceived(int callback_id, SkColor bg_color) {} virtual void OnGetFocusedNodeBounds(const gfx::RectF&) {} + + virtual void OnGetMainFrameScrollbarVisible(int callback_id, bool visible) {} #endif // This method will reset the fallback to the first surface after navigation. diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h index acf088d..bfa80ca 100644 --- a/content/public/browser/web_contents_delegate.h +++ b/content/public/browser/web_contents_delegate.h @@ -515,6 +515,7 @@ class CONTENT_EXPORT WebContentsDelegate { virtual void BackgroundColorReceived(int callback_id, SkColor bg_color) {} virtual void OnDidChangeFocusedNodeBounds( const gfx::RectF& focused_node_bounds) {} + virtual void OnGetMainFrameScrollbarVisible(int callback_id, bool visible) {} #endif #if BUILDFLAG(IS_ANDROID) diff --git a/third_party/blink/public/mojom/widget/platform_widget.mojom b/third_party/blink/public/mojom/widget/platform_widget.mojom index 46ca55c..d9cd695 100644 --- a/third_party/blink/public/mojom/widget/platform_widget.mojom +++ b/third_party/blink/public/mojom/widget/platform_widget.mojom @@ -114,6 +114,12 @@ interface Widget { gfx.mojom.Rect window_screen_rect) => (); [EnableIf=is_efl] + SetMainFrameScrollbarVisible(bool visible); + + [EnableIf=is_efl] + RequestMainFrameScrollbarVisible() => (bool visible); + + [EnableIf=is_efl] GetBackgroundColor() => (skia.mojom.SkColor bg_color); [EnableIf=is_efl] diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h index f15c5f8..d3b3529 100644 --- a/third_party/blink/public/web/web_local_frame.h +++ b/third_party/blink/public/web/web_local_frame.h @@ -706,6 +706,13 @@ class BLINK_EXPORT WebLocalFrame : public WebFrame { virtual gfx::PointF GetScrollOffset() const = 0; virtual void SetScrollOffset(const gfx::PointF&) = 0; +#if BUILDFLAG(IS_EFL) + // If set to false, do not draw scrollbars on this frame's view. + virtual void ChangeScrollbarVisibility(bool) = 0; + virtual bool HasHorizontalScrollbar() const = 0; + virtual bool HasVerticalScrollbar() const = 0; +#endif + // The size of the document in this frame. virtual gfx::Size DocumentSize() const = 0; diff --git a/third_party/blink/renderer/core/frame/local_frame_view.cc b/third_party/blink/renderer/core/frame/local_frame_view.cc index c9d4e71..a30a289 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view.cc +++ b/third_party/blink/renderer/core/frame/local_frame_view.cc @@ -188,6 +188,11 @@ #include "ui/gfx/geometry/quad_f.h" #include "ui/gfx/geometry/rect_f.h" +#if BUILDFLAG(IS_EFL) +#include "third_party/blink/renderer/core/scroll/scrollbar_theme_overlay.h" +#include "third_party/blink/renderer/core/scroll/scrollbar_theme_overlay_mobile.h" +#endif + // Used to check for dirty layouts violating document lifecycle rules. // If arg evaluates to true, the program will continue. If arg evaluates to // false, program will crash if DCHECK_IS_ON() or return false from the current @@ -5025,4 +5030,47 @@ void LocalFrameView::UpdateAllPendingTransforms() { }); } +#if BUILDFLAG(IS_EFL) +void LocalFrameView::ChangeScrollbarVisibility(bool visible) { + has_visible_scrollbars_ = visible; + + if (!frame_ && !frame_->IsMainFrame()) + return; + + const VisualViewport& visual_viewport = + frame_->GetPage()->GetVisualViewport(); + + int horizontal_scrollbar_width = 0; + int horizontal_scrollbar_height = 0; + int vertical_scrollbar_width = 0; + int vertical_scrollbar_height = 0; + + if (visible) { + auto& theme = ScrollbarThemeOverlayMobile::GetInstance(); + + const int scrollbar_thickness = theme.ScrollbarThickness( + visual_viewport.ScaleFromDIP(), EScrollbarWidth::kAuto); + horizontal_scrollbar_width = + visual_viewport.Size().width() - scrollbar_thickness; + horizontal_scrollbar_height = scrollbar_thickness; + + vertical_scrollbar_width = scrollbar_thickness; + vertical_scrollbar_height = + visual_viewport.Size().height() - scrollbar_thickness; + } + + cc::Layer* scrollbar_graphics_layer = + visual_viewport.LayerForHorizontalScrollbar(); + if (scrollbar_graphics_layer) { + scrollbar_graphics_layer->SetBounds( + gfx::Size(horizontal_scrollbar_width, horizontal_scrollbar_height)); + } + + scrollbar_graphics_layer = visual_viewport.LayerForVerticalScrollbar(); + if (scrollbar_graphics_layer) { + scrollbar_graphics_layer->SetBounds( + gfx::Size(vertical_scrollbar_width, vertical_scrollbar_height)); + } +} +#endif } // namespace blink diff --git a/third_party/blink/renderer/core/frame/local_frame_view.h b/third_party/blink/renderer/core/frame/local_frame_view.h index bb71479..e6fd44f 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view.h +++ b/third_party/blink/renderer/core/frame/local_frame_view.h @@ -175,6 +175,11 @@ class CORE_EXPORT LocalFrameView final void SetLayoutOverflowSize(const gfx::Size&); +#if BUILDFLAG(IS_EFL) + void ChangeScrollbarVisibility(bool); + bool HasVisibleScrollbars() { return has_visible_scrollbars_; } +#endif + bool DidFirstLayout() const; bool LifecycleUpdatesActive() const; void SetLifecycleUpdatesThrottledForTesting(bool throttled = true); @@ -1026,6 +1031,10 @@ class CORE_EXPORT LocalFrameView final bool can_have_scrollbars_; bool in_post_lifecycle_steps_ = false; +#if BUILDFLAG(IS_EFL) + bool has_visible_scrollbars_ = true; +#endif + bool has_pending_layout_; LayoutSubtreeRootList layout_subtree_root_list_; DepthOrderedLayoutObjectList orthogonal_writing_mode_root_list_; diff --git a/third_party/blink/renderer/core/frame/visual_viewport.cc b/third_party/blink/renderer/core/frame/visual_viewport.cc index 2dc150f..f2fae50 100644 --- a/third_party/blink/renderer/core/frame/visual_viewport.cc +++ b/third_party/blink/renderer/core/frame/visual_viewport.cc @@ -747,6 +747,13 @@ void VisualViewport::UpdateScrollbarLayer(ScrollbarOrientation orientation) { scrollbar_layer->SetIsDrawable(true); } +#if BUILDFLAG(IS_EFL) + if (IsActiveViewport() && LocalMainFrame().View() && + !LocalMainFrame().View()->HasVisibleScrollbars()) { + scrollbar_layer->SetBounds(gfx::Size(0, 0)); + return; + } +#endif scrollbar_layer->SetBounds( orientation == kHorizontalScrollbar ? gfx::Size(size_.width() - ScrollbarThickness(), diff --git a/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc b/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc index fe072e5..873ec6c 100644 --- a/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc +++ b/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc @@ -4199,6 +4199,25 @@ void WebFrameWidgetImpl::PrintToPdf(uint32_t width, width, height, filename, content::RenderFrame::FromWebFrame(focused_frame)); } + +void WebFrameWidgetImpl::SetMainFrameScrollbarVisible(bool visible) { + blink::WebView* view = View(); + if (!view || !view->MainFrame() || !view->MainFrame()->ToWebLocalFrame()) + return; + + view->MainFrame()->ToWebLocalFrame()->ChangeScrollbarVisibility(visible); +} + +bool WebFrameWidgetImpl::RequestMainFrameScrollbarVisible(bool& visible) { + blink::WebView* view = View(); + if (!view || !view->MainFrame() || !view->MainFrame()->ToWebLocalFrame()) + return false; + + auto local_frame = view->MainFrame()->ToWebLocalFrame(); + visible = local_frame->HasHorizontalScrollbar() || + local_frame->HasVerticalScrollbar(); + return true; +} #endif #if BUILDFLAG(IS_TIZEN) diff --git a/third_party/blink/renderer/core/frame/web_frame_widget_impl.h b/third_party/blink/renderer/core/frame/web_frame_widget_impl.h index af3dca2..7ec9d04 100644 --- a/third_party/blink/renderer/core/frame/web_frame_widget_impl.h +++ b/third_party/blink/renderer/core/frame/web_frame_widget_impl.h @@ -716,6 +716,8 @@ class CORE_EXPORT WebFrameWidgetImpl void PrintToPdf(uint32_t width, uint32_t height, const base::FilePath& filename) override; + void SetMainFrameScrollbarVisible(bool visible) override; + bool RequestMainFrameScrollbarVisible(bool& visible) override; #endif #if defined(TIZEN_VIDEO_HOLE) void SetVideoHoleForRender(bool enable) override; diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc index 682a6bb..1e3c21a 100644 --- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc +++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc @@ -2518,6 +2518,23 @@ void WebLocalFrameImpl::DidFinishLoadForPrinting() { Client()->DidFinishLoadForPrinting(); } +#if BUILDFLAG(IS_EFL) +void WebLocalFrameImpl::ChangeScrollbarVisibility(bool visible) { + if (LocalFrameView* view = GetFrameView()) + view->ChangeScrollbarVisibility(visible); +} + +bool WebLocalFrameImpl::HasHorizontalScrollbar() const { + return GetFrame() && GetFrame()->View() && + GetFrame()->View()->LayoutViewport()->HasHorizontalScrollbar(); +} + +bool WebLocalFrameImpl::HasVerticalScrollbar() const { + return GetFrame() && GetFrame()->View() && + GetFrame()->View()->LayoutViewport()->HasVerticalScrollbar(); +} +#endif + HitTestResult WebLocalFrameImpl::HitTestResultForVisualViewportPos( const gfx::Point& pos_in_viewport) { gfx::Point root_frame_point( diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.h b/third_party/blink/renderer/core/frame/web_local_frame_impl.h index ecdea72..ac7d5d2 100644 --- a/third_party/blink/renderer/core/frame/web_local_frame_impl.h +++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.h @@ -266,6 +266,12 @@ class CORE_EXPORT WebLocalFrameImpl final void ReloadImage(const WebNode&) override; bool IsAllowedToDownload() const override; bool IsCrossOriginToOutermostMainFrame() const override; +#if BUILDFLAG(IS_EFL) + void ChangeScrollbarVisibility(bool) override; + bool HasHorizontalScrollbar() const override; + bool HasVerticalScrollbar() const override; +#endif + bool FindForTesting(int identifier, const WebString& search_text, bool match_case, diff --git a/third_party/blink/renderer/platform/widget/widget_base.cc b/third_party/blink/renderer/platform/widget/widget_base.cc index 4f07693..f43e43c 100644 --- a/third_party/blink/renderer/platform/widget/widget_base.cc +++ b/third_party/blink/renderer/platform/widget/widget_base.cc @@ -489,6 +489,17 @@ void WidgetBase::UpdateFocusedNodeBounds( std::move(callback).Run(client_->UpdateFocusedNodeBounds()); } +void WidgetBase::SetMainFrameScrollbarVisible(bool visible) { + client_->SetMainFrameScrollbarVisible(visible); +} + +void WidgetBase::RequestMainFrameScrollbarVisible( + RequestMainFrameScrollbarVisibleCallback callback) { + bool visible = false; + if (client_->RequestMainFrameScrollbarVisible(visible)) + std::move(callback).Run(visible); +} + void WidgetBase::SetLongPollingGlobalTimeout(uint64_t timeout) { client_->SetLongPollingGlobalTimeout(timeout); } diff --git a/third_party/blink/renderer/platform/widget/widget_base.h b/third_party/blink/renderer/platform/widget/widget_base.h index 43344d4..61a926a4 100644 --- a/third_party/blink/renderer/platform/widget/widget_base.h +++ b/third_party/blink/renderer/platform/widget/widget_base.h @@ -147,6 +147,9 @@ class PLATFORM_EXPORT WidgetBase : public mojom::blink::Widget, void PrintToPdf(uint32_t width, uint32_t height, const base::FilePath& filename) override; + void SetMainFrameScrollbarVisible(bool visible) override; + void RequestMainFrameScrollbarVisible( + RequestMainFrameScrollbarVisibleCallback callback) override; #endif #if defined(TIZEN_VIDEO_HOLE) void SetVideoHoleForRender(bool enable) override; diff --git a/third_party/blink/renderer/platform/widget/widget_base_client.h b/third_party/blink/renderer/platform/widget/widget_base_client.h index d34b06f..fd7dbf1 100644 --- a/third_party/blink/renderer/platform/widget/widget_base_client.h +++ b/third_party/blink/renderer/platform/widget/widget_base_client.h @@ -179,6 +179,8 @@ class WidgetBaseClient { virtual void PrintToPdf(uint32_t width, uint32_t height, const base::FilePath& filename) {} + virtual void SetMainFrameScrollbarVisible(bool visible) {} + virtual bool RequestMainFrameScrollbarVisible(bool& visible) { return false; } #endif #if defined(TIZEN_VIDEO_HOLE) virtual void SetVideoHoleForRender(bool enable) {} diff --git a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc index 7005822..aea5901 100644 --- a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc +++ b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc @@ -1153,6 +1153,12 @@ void RWHVAuraOffscreenHelperEfl::ClearLabels() { } #endif +void RWHVAuraOffscreenHelperEfl::OnGetMainFrameScrollbarVisible(int callback_id, + bool visible) { + web_contents_->GetDelegate()->OnGetMainFrameScrollbarVisible(callback_id, + visible); +} + void RWHVAuraOffscreenHelperEfl::OnGetFocusedNodeBounds( const gfx::RectF& rect) { web_contents_->GetDelegate()->OnDidChangeFocusedNodeBounds(rect); diff --git a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.h b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.h index 216e234..e93b196 100644 --- a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.h +++ b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.h @@ -65,6 +65,7 @@ class CONTENT_EXPORT RWHVAuraOffscreenHelperEfl { void BackgroundColorReceived(int callback_id, SkColor bg_color); void Show(); void Hide(); + void OnGetMainFrameScrollbarVisible(int callback_id, bool visible); gfx::Size GetVisibleViewportSize(); gfx::Rect GetViewBounds(); diff --git a/tizen_src/ewk/efl_integration/eweb_view.cc b/tizen_src/ewk/efl_integration/eweb_view.cc index ede6cd4..a614933 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.cc +++ b/tizen_src/ewk/efl_integration/eweb_view.cc @@ -2758,6 +2758,47 @@ void EWebView::ClosePage() { web_contents_->ClosePage(); } +bool EWebView::SetMainFrameScrollbarVisible(bool visible) { + if (web_contents_->GetPrimaryMainFrame()->IsRenderFrameLive() && rwhva()) + rwhva()->host()->SetMainFrameScrollbarVisible(visible); + return true; +} + +bool EWebView::GetMainFrameScrollbarVisible( + Ewk_View_Main_Frame_Scrollbar_Visible_Get_Callback callback, + void* user_data) { + if (!rwhva()) + return false; + + MainFrameScrollbarVisibleGetCallback* callback_ptr = + new MainFrameScrollbarVisibleGetCallback; + callback_ptr->Set(callback, user_data); + int callback_id = + main_frame_scrollbar_visible_callback_map_.Add(callback_ptr); + rwhva()->host()->RequestMainFrameScrollbarVisible(callback_id); + return true; +} + +void EWebView::InvokeMainFrameScrollbarVisibleCallback(int callback_id, + bool visible) { + if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { + content::GetUIThreadTaskRunner({})->PostTask( + FROM_HERE, + base::BindOnce(&EWebView::InvokeMainFrameScrollbarVisibleCallback, + base::Unretained(this), visible, callback_id)); + return; + } + + MainFrameScrollbarVisibleGetCallback* callback = + main_frame_scrollbar_visible_callback_map_.Lookup(callback_id); + if (!callback) + return; + + main_frame_scrollbar_visible_callback_map_.Remove(callback_id); + callback->Run(evas_object(), visible); + main_frame_scrollbar_visible_callback_map_.Remove(callback_id); +} + void EWebView::OnOverscrolled(const gfx::Vector2dF& accumulated_overscroll, const gfx::Vector2dF& latest_overscroll_delta) { const gfx::Vector2dF old_overscroll = diff --git a/tizen_src/ewk/efl_integration/eweb_view.h b/tizen_src/ewk/efl_integration/eweb_view.h index eda7a4a..9d87a7a 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.h +++ b/tizen_src/ewk/efl_integration/eweb_view.h @@ -599,6 +599,13 @@ class EWebView { content::ContextMenuControllerEfl* GetContextMenuController() { return context_menu_.get(); } + + bool SetMainFrameScrollbarVisible(bool visible); + bool GetMainFrameScrollbarVisible( + Ewk_View_Main_Frame_Scrollbar_Visible_Get_Callback callback, + void* user_data); + void InvokeMainFrameScrollbarVisibleCallback(int callback_id, bool visible); + void ResetContextMenuController(); Eina_Bool AddJavaScriptMessageHandler(Evas_Object* view, Ewk_View_Script_Message_Cb callback, diff --git a/tizen_src/ewk/efl_integration/public/ewk_view.cc b/tizen_src/ewk/efl_integration/public/ewk_view.cc index de2255c..6a6cb6d 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_view.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_view.cc @@ -1223,10 +1223,20 @@ Eina_Bool ewk_view_top_controls_state_set(Evas_Object* ewk_view, Ewk_Top_Control return false; } -Eina_Bool ewk_view_main_frame_scrollbar_visible_set(Evas_Object* o, Eina_Bool visible) -{ - LOG_EWK_API_MOCKUP(); - return false; +Eina_Bool ewk_view_main_frame_scrollbar_visible_set(Evas_Object* ewk_view, + Eina_Bool visible) { + EWK_VIEW_IMPL_GET_OR_RETURN(ewk_view, impl, EINA_FALSE); + return impl->SetMainFrameScrollbarVisible(!!visible); +} + +Eina_Bool ewk_view_main_frame_scrollbar_visible_get( + Evas_Object* ewk_view, + Ewk_View_Main_Frame_Scrollbar_Visible_Get_Callback callback, + void* user_data) { + EINA_SAFETY_ON_NULL_RETURN_VAL(callback, EINA_FALSE); + EWK_VIEW_IMPL_GET_OR_RETURN(ewk_view, impl, EINA_FALSE); + + return impl->GetMainFrameScrollbarVisible(callback, user_data); } Eina_Bool ewk_view_set_custom_device_pixel_ratio(Evas_Object* ewkView, Eina_Bool enabled) diff --git a/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc b/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc index b911043..cf2899b 100644 --- a/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc +++ b/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc @@ -656,4 +656,8 @@ void WebContentsDelegateEfl::OnDidGetManifest( } } +void WebContentsDelegateEfl::OnGetMainFrameScrollbarVisible(int callback_id, + bool visible) { + web_view_->InvokeMainFrameScrollbarVisibleCallback(callback_id, visible); +} } // namespace content diff --git a/tizen_src/ewk/efl_integration/web_contents_delegate_efl.h b/tizen_src/ewk/efl_integration/web_contents_delegate_efl.h index 4fbbb1f..2c491c3 100644 --- a/tizen_src/ewk/efl_integration/web_contents_delegate_efl.h +++ b/tizen_src/ewk/efl_integration/web_contents_delegate_efl.h @@ -64,6 +64,8 @@ class WebContentsDelegateEfl : public WebContentsDelegate { int active_match_ordinal, bool final_update) override; void DidRenderFrame() override; + + void OnGetMainFrameScrollbarVisible(int callback_id, bool visible) override; void RequestCertificateConfirm( WebContents* web_contents, int cert_error, diff --git a/tizen_src/ewk/unittest/BUILD.gn b/tizen_src/ewk/unittest/BUILD.gn index 4c47880..691ef67 100644 --- a/tizen_src/ewk/unittest/BUILD.gn +++ b/tizen_src/ewk/unittest/BUILD.gn @@ -334,6 +334,7 @@ test("ewk_unittests") { "utc_blink_ewk_view_javascript_confirm_reply_func.cpp", "utc_blink_ewk_view_load_progress_get_func.cpp", "utc_blink_ewk_view_main_frame_get_func.cpp", + "utc_blink_ewk_view_main_frame_scrollbar_visible_set_func.cpp", "utc_blink_ewk_view_mhtml_data_get_func.cpp", "utc_blink_ewk_view_notification_permission_callback_set_func.cpp", "utc_blink_ewk_view_orientation_send_func.cpp", diff --git a/tizen_src/ewk/unittest/utc_blink_ewk_view_main_frame_scrollbar_visible_set_func.cpp b/tizen_src/ewk/unittest/utc_blink_ewk_view_main_frame_scrollbar_visible_set_func.cpp new file mode 100644 index 0000000..1e33ce6 --- /dev/null +++ b/tizen_src/ewk/unittest/utc_blink_ewk_view_main_frame_scrollbar_visible_set_func.cpp @@ -0,0 +1,84 @@ +// Copyright 2022 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "utc_blink_ewk_base.h" + +class utc_blink_ewk_view_main_frame_scrollbar_visible_set + : public utc_blink_ewk_base { + protected: + void PostSetUp() override { + evas_object_smart_callback_add(GetEwkWebView(), "contents,size,changed", + ContentsSizeChanged, this); + } + + void PreTearDown() override { + evas_object_smart_callback_del(GetEwkWebView(), "contents,size,changed", + ContentsSizeChanged); + } + + static void ContentsSizeChanged(void* data, + Evas_Object* eObject, + void* dataFinished) { + if (data) { + static_cast(data) + ->EventLoopStop(Success); + } + } + + static void ScrollbarVisibleGetCallback(Evas_Object* eObject, + Eina_Bool visible, + void* data) { + utc_check_ne(data, nullptr); + utc_blink_ewk_view_main_frame_scrollbar_visible_set* owner = nullptr; + OwnerFromVoid(data, &owner); + utc_message("[ScrollbarVisibleGetCallback] :: visible = %s\n", + visible == EINA_TRUE ? "EINA_TRUE" : "EINA_FALSE"); + utc_check_eq(owner->expected_visible_, visible); + owner->EventLoopStop(Success); + } + + protected: + Eina_Bool expected_visible_; +}; + +TEST_F(utc_blink_ewk_view_main_frame_scrollbar_visible_set, TURN_OFF) { + Eina_Bool ret = EINA_FALSE; + + // Loading the page triggers a call to ContentsSizeChanged callback. + utc_check_eq(EINA_TRUE, ewk_view_url_set( + GetEwkWebView(), + GetResourceUrl("common/sample_2.html").c_str())); + utc_check_eq(Success, EventLoopStart()); + + // Initially the scrollbar is visible. + expected_visible_ = EINA_TRUE; + ret = ewk_view_main_frame_scrollbar_visible_get( + GetEwkWebView(), ScrollbarVisibleGetCallback, this); + utc_check_eq(ret, EINA_TRUE); + utc_check_eq(Success, EventLoopStart()); + + // Check that changing scrollbar visiblity triggers "contents,size,changed" + // callback. Indeed at this point only ContentsSizeChanged callback can stop + // the next call to EventLoopStart. + ret = ewk_view_main_frame_scrollbar_visible_set(GetEwkWebView(), false); + utc_check_eq(ret, EINA_TRUE); + utc_check_eq(Success, EventLoopStart()); + + // Check that the scrollbar is not visible. + expected_visible_ = EINA_FALSE; + ret = ewk_view_main_frame_scrollbar_visible_get( + GetEwkWebView(), ScrollbarVisibleGetCallback, this); + utc_check_eq(ret, EINA_TRUE); + utc_check_eq(Success, EventLoopStart()); + + // Make the scrollbar visible again. + ret = ewk_view_main_frame_scrollbar_visible_set(GetEwkWebView(), true); + utc_check_eq(ret, EINA_TRUE); + utc_check_eq(Success, EventLoopStart()); + expected_visible_ = EINA_TRUE; + ret = ewk_view_main_frame_scrollbar_visible_get( + GetEwkWebView(), ScrollbarVisibleGetCallback, this); + utc_check_eq(ret, EINA_TRUE); + utc_check_eq(Success, EventLoopStart()); +} -- 2.7.4 From 1fddb3c6b1010c0d18af692ccf12cdf772c08cb3 Mon Sep 17 00:00:00 2001 From: "ayush.k123" Date: Thu, 16 Feb 2023 13:00:09 +0530 Subject: [PATCH 05/16] fixup! [M108 Migration] Enable proper functionality for ewk_policy_decision_* APIs. This change fixes ewk_policy_decision_navigation_type_get_p tct failure by making changes according to upstream change. https://chromium-review.googlesource.com/c/3887581/8/third_party/blink/public/web/web_navigation_type.h Change-Id: Ia1d105c83c5677971889817933aa59221210f9bf Signed-off-by: Ayush Kumar --- tizen_src/ewk/efl_integration/public/ewk_policy_decision.h | 5 +++-- .../utc_blink_ewk_policy_decision_navigation_type_get_func.cpp | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tizen_src/ewk/efl_integration/public/ewk_policy_decision.h b/tizen_src/ewk/efl_integration/public/ewk_policy_decision.h index b82e68e..3bb8d0b 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_policy_decision.h +++ b/tizen_src/ewk/efl_integration/public/ewk_policy_decision.h @@ -69,8 +69,9 @@ enum _Ewk_Policy_Navigation_Type { EWK_POLICY_NAVIGATION_TYPE_FORM_SUBMITTED = 1, /**< Form submitted */ EWK_POLICY_NAVIGATION_TYPE_BACK_FORWARD = 2, /**< Back forward */ EWK_POLICY_NAVIGATION_TYPE_RELOAD = 3, /**< Reload */ - EWK_POLICY_NAVIGATION_TYPE_FORM_RESUBMITTED = 4, /**< Form resubmitted */ - EWK_POLICY_NAVIGATION_TYPE_OTHER = 5 /**< Other */ + EWK_POLICY_NAVIGATION_TYPE_FORM_RESUBMITTED_BACK_FORWARD = 4, /**< Form resubmitted back forward*/ + EWK_POLICY_NAVIGATION_TYPE_FORM_RESUBMITTED_RELOAD = 5, /**< Form resubmitted reload*/ + EWK_POLICY_NAVIGATION_TYPE_OTHER = 6 /**< Other */ }; /** diff --git a/tizen_src/ewk/unittest/utc_blink_ewk_policy_decision_navigation_type_get_func.cpp b/tizen_src/ewk/unittest/utc_blink_ewk_policy_decision_navigation_type_get_func.cpp index ac7a19e..51e7c29 100644 --- a/tizen_src/ewk/unittest/utc_blink_ewk_policy_decision_navigation_type_get_func.cpp +++ b/tizen_src/ewk/unittest/utc_blink_ewk_policy_decision_navigation_type_get_func.cpp @@ -31,7 +31,8 @@ protected: ewk_policy_decision_navigation_type_get(policy) == EWK_POLICY_NAVIGATION_TYPE_FORM_SUBMITTED || ewk_policy_decision_navigation_type_get(policy) == EWK_POLICY_NAVIGATION_TYPE_BACK_FORWARD || ewk_policy_decision_navigation_type_get(policy) == EWK_POLICY_NAVIGATION_TYPE_RELOAD || - ewk_policy_decision_navigation_type_get(policy) == EWK_POLICY_NAVIGATION_TYPE_FORM_RESUBMITTED || + ewk_policy_decision_navigation_type_get(policy) == EWK_POLICY_NAVIGATION_TYPE_FORM_RESUBMITTED_BACK_FORWARD || + ewk_policy_decision_navigation_type_get(policy) == EWK_POLICY_NAVIGATION_TYPE_FORM_RESUBMITTED_RELOAD || ewk_policy_decision_navigation_type_get(policy) == EWK_POLICY_NAVIGATION_TYPE_OTHER)) owner->EventLoopStop(utc_blink_ewk_base::Success); -- 2.7.4 From 1e81a38e934e34342be23bb43db9489aa11cb638 Mon Sep 17 00:00:00 2001 From: v-saha Date: Tue, 7 Feb 2023 10:55:22 +0530 Subject: [PATCH 06/16] [M108 Migration] Apply device scale factor Fix for web page incorrectly displayed on mobile by applying correct device scale factor. Reference: https://review.tizen.org/gerrit/274908 https://review.tizen.org/gerrit/275246 Change-Id: I2aa127a3d5577dcd74507d8fa9e705e88ccb04c8 Signed-off-by: v-saha --- content/browser/web_contents/web_contents_impl.cc | 3 ++ .../ui/display/device_display_info_efl.cc | 38 ++++++++++++++----- .../ui/display/device_display_info_efl.h | 4 +- .../ui/ozone/platform/efl/efl_screen.cc | 43 +++++++++++++++++++++- .../ui/ozone/platform/efl/efl_screen.h | 4 ++ .../ui/ozone/platform/efl/efl_window.cc | 2 + 6 files changed, 81 insertions(+), 13 deletions(-) diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index ec3d50f..106f6f1 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -9654,6 +9654,9 @@ void WebContentsImpl::CreateEflNativeView() { "main_layout"); GLSharedContextEfl::Initialize(root_window); + + auto* ee = ecore_evas_ecore_evas_get(evas_object_evas_get(efl_native_view_)); + ui::EflScreen::UpdateDisplayInfo(ee); } void WebContentsImpl::SetSpatialNavigationEnabled(bool enabled) { diff --git a/tizen_src/chromium_impl/ui/display/device_display_info_efl.cc b/tizen_src/chromium_impl/ui/display/device_display_info_efl.cc index 9e4c91b..a39def2 100644 --- a/tizen_src/chromium_impl/ui/display/device_display_info_efl.cc +++ b/tizen_src/chromium_impl/ui/display/device_display_info_efl.cc @@ -62,7 +62,9 @@ class DISPLAY_EXPORT DeviceDisplayInfoEflImpl { public: static DeviceDisplayInfoEflImpl* GetInstance(); - void Update(int display_width, int display_height, double dip_scale, + bool Update(int display_width, + int display_height, + double dip_scale, int rotation_degrees); void SetRotationDegrees(int rotation_degrees); int GetDisplayWidth() const; @@ -97,13 +99,20 @@ DeviceDisplayInfoEflImpl* DeviceDisplayInfoEflImpl::GetInstance() { return base::Singleton::get(); } -void DeviceDisplayInfoEflImpl::Update(int display_width, int display_height, - double dip_scale, int rotation_degrees) { +bool DeviceDisplayInfoEflImpl::Update(int display_width, + int display_height, + double dip_scale, + int rotation_degrees) { + bool changed = false; { base::AutoLock autolock(display_info_accessor_); - display_width_ = display_width; - display_height_ = display_height; - dip_scale_ = dip_scale; + if (display_width_ != display_width || display_height_ != display_height || + dip_scale_ != dip_scale) { + changed = true; + display_width_ = display_width; + display_height_ = display_height; + dip_scale_ = dip_scale; + } DCHECK_NE(0, display_width_); DCHECK_NE(0, display_height_); @@ -112,11 +121,18 @@ void DeviceDisplayInfoEflImpl::Update(int display_width, int display_height, { base::AutoLock autolock(rotation_accessor_); - rotation_degrees_ = rotation_degrees; + if (rotation_degrees_ != rotation_degrees) { + changed = true; + rotation_degrees_ = rotation_degrees; + } DCHECK_NE(kInvalidRotationDegrees, rotation_degrees_); } + if (!changed) + return false; + NotifyDeviceDisplayInfoChanged(); + return true; } void DeviceDisplayInfoEflImpl::SetRotationDegrees(int rotation_degrees) { @@ -178,9 +194,11 @@ DeviceDisplayInfoEfl::DeviceDisplayInfoEfl() { DCHECK(DeviceDisplayInfoEflImpl::GetInstance()); } -void DeviceDisplayInfoEfl::Update(int display_width, int display_height, - double dip_scale, int rotation_degrees) { - DeviceDisplayInfoEflImpl::GetInstance()->Update( +bool DeviceDisplayInfoEfl::Update(int display_width, + int display_height, + double dip_scale, + int rotation_degrees) { + return DeviceDisplayInfoEflImpl::GetInstance()->Update( display_width, display_height, dip_scale, rotation_degrees); } diff --git a/tizen_src/chromium_impl/ui/display/device_display_info_efl.h b/tizen_src/chromium_impl/ui/display/device_display_info_efl.h index beb26c7..96359f0 100644 --- a/tizen_src/chromium_impl/ui/display/device_display_info_efl.h +++ b/tizen_src/chromium_impl/ui/display/device_display_info_efl.h @@ -22,7 +22,9 @@ class DISPLAY_EXPORT DeviceDisplayInfoEfl { DeviceDisplayInfoEfl& operator=(const DeviceDisplayInfoEfl&) = delete; // Update all info. - void Update(int display_width, int display_height, double dip_scale, + bool Update(int display_width, + int display_height, + double dip_scale, int rotation_degrees); // Sets rotation degrees. Expected values are one of { 0, 90, 180, 270 }. diff --git a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.cc b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.cc index f6aed36..fde4853 100644 --- a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.cc +++ b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.cc @@ -4,10 +4,13 @@ #include "ui/ozone/platform/efl/efl_screen.h" +#include + #include "base/logging.h" #include "base/stl_util.h" #include "ecore_wrapper/ecore_x_wayland_wrapper.h" #include "tizen/system_info.h" +#include "ui/display/device_display_info_efl.h" #include "ui/display/display.h" #include "ui/display/display_finder.h" #include "ui/display/display_observer.h" @@ -16,6 +19,14 @@ namespace ui { +namespace { + +const int kDisplayId = 0; + +std::vector screen_list; + +} // namespace + EflScreen::EflScreen() { int width = 0, height = 0; #if defined(USE_WAYLAND) @@ -24,12 +35,40 @@ EflScreen::EflScreen() { #else ecore_x_window_size_get(ecore_x_window_root_first_get(), &width, &height); #endif - display::Display display(0); + display::Display display(kDisplayId); display.set_bounds(gfx::Rect(width, height)); display_list_.AddDisplay(display, display::DisplayList::Type::PRIMARY); + + screen_list.push_back(this); } -EflScreen::~EflScreen() = default; +EflScreen::~EflScreen() { + screen_list.erase(std::remove(screen_list.begin(), screen_list.end(), this)); +} + +// static +void EflScreen::UpdateDisplayInfo(Ecore_Evas* ee) { + int width = 0, height = 0, dpi = 0; + ecore_evas_screen_geometry_get(ee, nullptr, nullptr, &width, &height); + ecore_evas_screen_dpi_get(ee, &dpi, nullptr); + + display::DeviceDisplayInfoEfl display_info; + const float device_scale_factor = + display::Display::HasForceDeviceScaleFactor() + ? display::Display::GetForcedDeviceScaleFactor() + : display_info.ComputeDIPScale(dpi); + int rotation = ecore_evas_rotation_get(ee); + if (!display_info.Update(width, height, device_scale_factor, rotation)) + return; + + display::Display display(kDisplayId); + display.set_bounds(gfx::Rect(width, height)); + display.SetRotationAsDegree(rotation); + display.set_device_scale_factor(device_scale_factor); + + for (auto* screen : screen_list) + screen->display_list_.UpdateDisplay(display); +} const std::vector& EflScreen::GetAllDisplays() const { return display_list_.displays(); diff --git a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.h b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.h index ebfabd7..4c06614 100644 --- a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.h +++ b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.h @@ -13,6 +13,8 @@ #include "ui/gfx/geometry/point.h" #include "ui/ozone/public/platform_screen.h" +typedef struct _Ecore_Evas Ecore_Evas; + namespace ui { // A PlatformScreen implementation for EFL. @@ -25,6 +27,8 @@ class EflScreen : public PlatformScreen { ~EflScreen() override; + static void UpdateDisplayInfo(Ecore_Evas* ee); + // PlatformScreen overrides: const std::vector& GetAllDisplays() const override; display::Display GetPrimaryDisplay() const override; diff --git a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.cc b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.cc index 4b94f31..5db5cb9 100644 --- a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.cc +++ b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.cc @@ -316,6 +316,8 @@ void EflWindow::Initialize(const PlatformWindowInitProperties& properties) { #if BUILDFLAG(IS_TIZEN_TV) CreateMouseCursor(); #endif + + EflScreen::UpdateDisplayInfo(ee_); } #if BUILDFLAG(IS_TIZEN_TV) -- 2.7.4 From 2540e206b50ea0d36afb6639d77d86dd7e761ffc Mon Sep 17 00:00:00 2001 From: "ayush.k123" Date: Fri, 10 Feb 2023 08:42:20 +0530 Subject: [PATCH 07/16] [M108 Migration][NativeControl] Select Picker This CL 1. Includes changes required for select picker feature and its refactoring. 2. Fixes Backward/Foward buttons in SelectPicker TC. 3. Makes changes to handle popup resize in a better way. 4. Segregates SelectPicker into ewk independant base classes 5. Removes Listbox rendering for Multiple Select for TV Reference: https://review.tizen.org/gerrit/280120/ https://review.tizen.org/gerrit/280208/ https://review.tizen.org/gerrit/280225/ https://review.tizen.org/gerrit/280633/ https://review.tizen.org/gerrit/281109/ Change-Id: I104484fe74197e104537c01f53b57dc9e65546e3 Signed-off-by: Ayush Kumar --- third_party/blink/public/web/web_view.h | 29 + .../blink/renderer/core/exported/web_view_impl.cc | 236 +++ .../blink/renderer/core/exported/web_view_impl.h | 35 + .../core/html/forms/external_popup_menu.cc | 6 + .../chromium_impl/content/browser/browser_efl.gni | 10 + .../browser/select_picker/form_navigable_picker.cc | 207 +++ .../browser/select_picker/form_navigable_picker.h | 73 + .../browser/select_picker/select_picker_base.cc | 231 +++ .../browser/select_picker/select_picker_base.h | 78 + .../select_picker/select_picker_mobile_base.cc | 164 ++ .../select_picker/select_picker_mobile_base.h | 39 + .../browser/select_picker/select_picker_tv_base.cc | 55 + .../browser/select_picker/select_picker_tv_base.h | 31 + .../browser/select_picker/select_picker_util.cc | 62 + .../browser/select_picker/select_picker_util.h | 43 + .../core/layout/layout_theme_chromium_tizen.cc | 2 +- tizen_src/ewk/efl_integration/BUILD.gn | 9 +- .../browser/select_picker/select_picker_mobile.cc | 45 + .../browser/select_picker/select_picker_mobile.h | 34 + .../browser/select_picker/select_picker_tv.cc | 49 + .../browser/select_picker/select_picker_tv.h | 34 + .../browser/selectpicker/popup_menu_item.cc | 77 - .../browser/selectpicker/popup_menu_item.h | 144 -- .../browser/selectpicker/popup_menu_item_private.h | 35 - .../browser/selectpicker/popup_picker.cc | 492 ------ .../browser/selectpicker/popup_picker.h | 68 - .../browser/web_view_browser_message_filter.cc | 11 + tizen_src/ewk/efl_integration/eweb_view.cc | 249 +-- tizen_src/ewk/efl_integration/eweb_view.h | 31 +- .../renderer/render_frame_observer_efl.cc | 42 +- .../renderer/render_frame_observer_efl.h | 3 - tizen_src/ewk/efl_integration/resource/BUILD.gn | 9 +- tizen_src/ewk/efl_integration/resource/control.edc | 9 +- .../ewk/efl_integration/resource/controlTV.edc | 1833 ++++++++++++++++++++ .../resource/images/highlight_stroke.png | Bin 0 -> 1134 bytes .../resource/images/obe_list_scroll_down.png | Bin 0 -> 3183 bytes .../resource/images/obe_list_scroll_down_f.png | Bin 0 -> 3186 bytes .../resource/images/obe_list_scroll_up.png | Bin 0 -> 3198 bytes .../resource/images/obe_list_scroll_up_f.png | Bin 0 -> 3200 bytes .../web_contents_efl_delegate_ewk.cc | 2 +- .../efl_integration/web_contents_observer_efl.cc | 7 +- 41 files changed, 3407 insertions(+), 1077 deletions(-) create mode 100644 tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.cc create mode 100644 tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.h create mode 100644 tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.cc create mode 100644 tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.h create mode 100644 tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.cc create mode 100644 tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.h create mode 100644 tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.cc create mode 100644 tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.h create mode 100644 tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.cc create mode 100644 tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.h create mode 100644 tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.cc create mode 100644 tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.h create mode 100644 tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.cc create mode 100644 tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.h delete mode 100644 tizen_src/ewk/efl_integration/browser/selectpicker/popup_menu_item.cc delete mode 100644 tizen_src/ewk/efl_integration/browser/selectpicker/popup_menu_item.h delete mode 100644 tizen_src/ewk/efl_integration/browser/selectpicker/popup_menu_item_private.h delete mode 100644 tizen_src/ewk/efl_integration/browser/selectpicker/popup_picker.cc delete mode 100644 tizen_src/ewk/efl_integration/browser/selectpicker/popup_picker.h create mode 100644 tizen_src/ewk/efl_integration/resource/controlTV.edc create mode 100644 tizen_src/ewk/efl_integration/resource/images/highlight_stroke.png create mode 100644 tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_down.png create mode 100644 tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_down_f.png create mode 100644 tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_up.png create mode 100644 tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_up_f.png diff --git a/third_party/blink/public/web/web_view.h b/third_party/blink/public/web/web_view.h index 91135d7..f8ad0aa 100644 --- a/third_party/blink/public/web/web_view.h +++ b/third_party/blink/public/web/web_view.h @@ -366,6 +366,20 @@ class BLINK_EXPORT WebView { virtual void SetDeviceColorSpaceForTesting( const gfx::ColorSpace& color_space) = 0; +#if BUILDFLAG(IS_EFL) + enum class TraverseFocusThrough : char { + EditableElement = 1 << 0, + SelectElement = 1 << 1, + EditableAndSelectElements = EditableElement | SelectElement + }; + virtual bool MoveFocusToPrevious( + TraverseFocusThrough = + TraverseFocusThrough::EditableAndSelectElements) = 0; + virtual bool MoveFocusToNext( + TraverseFocusThrough = + TraverseFocusThrough::EditableAndSelectElements) = 0; +#endif + // Scheduling ----------------------------------------------------------- virtual PageScheduler* Scheduler() const = 0; @@ -498,4 +512,19 @@ class BLINK_EXPORT WebView { } // namespace blink +#if BUILDFLAG(IS_EFL) +static inline blink::WebView::TraverseFocusThrough operator|( + blink::WebView::TraverseFocusThrough a, + blink::WebView::TraverseFocusThrough b) { + return static_cast( + static_cast(a) | static_cast(b)); +} +static inline blink::WebView::TraverseFocusThrough operator&( + blink::WebView::TraverseFocusThrough a, + blink::WebView::TraverseFocusThrough b) { + return static_cast( + static_cast(a) & static_cast(b)); +} +#endif + #endif // THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_VIEW_H_ diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc index ab133fb..dc80bce 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc @@ -196,7 +196,11 @@ #if BUILDFLAG(IS_EFL) #include "third_party/blink/renderer/core/dom/container_node.h" +#include "third_party/blink/renderer/core/dom/parent_node.h" #include "third_party/blink/renderer/core/dom/static_node_list.h" +#include "third_party/blink/renderer/core/html/forms/html_form_element.h" +#include "third_party/blink/renderer/core/html/forms/html_input_element.h" +#include "third_party/blink/renderer/core/html/forms/html_select_element.h" #endif #if BUILDFLAG(IS_TIZEN) @@ -4021,6 +4025,238 @@ void WebViewImpl::ScrollFocusedNodeIntoView() { if (Element* element = FocusedElement()) element->scrollIntoViewIfNeeded(true /*centerIfNeeded*/); } + +bool WebViewImpl::FiltersInSelectElement(WebView::TraverseFocusThrough filter) { + return static_cast((char)filter & + (char)WebView::TraverseFocusThrough::SelectElement); +} + +bool WebViewImpl::FiltersInEditableElement( + WebView::TraverseFocusThrough filter) { + return static_cast( + (char)filter & (char)WebView::TraverseFocusThrough::EditableElement); +} + +bool WebViewImpl::IsFormNavigationTextInput(Element& element) const { + if (element.HasTagName(html_names::kInputTag) && + DynamicTo(element)->IsReadOnly()) { + return false; + } + + LayoutObject* renderer = element.GetLayoutObject(); + return renderer && + (IsEditable(element) || renderer->IsTextControlIncludingNG()); +} + +bool WebViewImpl::IsSelectElement(const Element& element) const { + return element.GetLayoutObject() && + element.HasTagName(html_names::kSelectTag); +} + +gfx::Rect WebViewImpl::GetElementBounds(const Element& element) const { + element.GetDocument().UpdateStyleAndLayout(DocumentUpdateReason::kFocus); + gfx::Rect absolute_rect = ToPixelSnappedRect(element.Node::BoundingBox()); + return (element.GetDocument().View() + ? element.GetDocument().View()->FrameToViewport(absolute_rect) + : gfx::Rect()); +} + +bool WebViewImpl::PerformClickOnElement(Element& element) { + if (gfx::Rect() == GetElementBounds(element)) + return false; + + // Set focus to false to compare it with focusedElement of document. + element.Focus(); + + Element* focus_element = FocusedElement(); + + if (!focus_element || focus_element != &element) + return false; + + // SimulatedClickCreationScope::kFromAccessibility simulates MouseUpDown + // Events + focus_element->DispatchSimulatedClick( + nullptr, SimulatedClickCreationScope::kFromAccessibility); + + if (IsFormNavigationTextInput(*focus_element)) { + LocalFrame* focused_frame = DynamicTo(FocusedCoreFrame()); + WebTextInputInfo info = + focused_frame->GetInputMethodController().TextInputInfo(); + focused_frame->GetInputMethodController().SetEditableSelectionOffsets( + PlainTextRange(info.selection_start, info.selection_end)); + } + + return true; +} + +Element* WebViewImpl::NextTextOrSelectElement(Element* element, + TraverseFocusThrough filter) { + if (!element) + return 0; + + Element* next_element = element; + + if (next_element->IsFrameOwnerElement()) { + HTMLFrameOwnerElement& htmlFrameOwnerElement = + *DynamicTo(next_element); + + // Checks if the frame is empty or not. + if (!htmlFrameOwnerElement.ContentFrame()) + return 0; + + Document* owner_document = htmlFrameOwnerElement.contentDocument(); + if (!owner_document || !(next_element = owner_document->body())) + return 0; + + // Checks if content editable flag on body has set. + if (IsEditable(*next_element) && FiltersInEditableElement(filter)) + return next_element; + } + + while ((next_element = ElementTraversal::Next(*next_element))) { + if (next_element->HasTagName(html_names::kIFrameTag) || + next_element->HasTagName(html_names::kFrameTag)) { + Element* frame_owner_element = next_element; + + next_element = NextTextOrSelectElement(next_element, filter); + if (!next_element) { + next_element = frame_owner_element; + continue; + } + } + if (FiltersInSelectElement(filter) && IsSelectElement(*next_element)) + break; + } + + // If couldn't find anything in the current document scope, + // try finding in other document scope if present any. + if (!next_element) { + if (element->GetDocument().GetFrame() != MainFrameImpl()->GetFrame() && + !element->IsFrameOwnerElement()) { + next_element = NextTextOrSelectElement( + ElementTraversal::Next(*element->GetDocument().LocalOwner()), filter); + } + } + + return next_element; +} + +Element* WebViewImpl::PreviousTextOrSelectElement(Element* element, + TraverseFocusThrough filter) { + if (!element) + return 0; + + Element* previous_element = element; + + if (previous_element->IsFrameOwnerElement()) { + HTMLFrameOwnerElement& htmlFrameOwnerElement = + *DynamicTo(previous_element); + // Checks if the frame is empty or not. + if (!htmlFrameOwnerElement.ContentFrame()) + return 0; + + Document* owner_document = htmlFrameOwnerElement.contentDocument(); + if (!owner_document) + return 0; + + previous_element = ParentNode::lastElementChild(*owner_document); + while (previous_element && ElementTraversal::FirstWithin(*previous_element)) + previous_element = ParentNode::lastElementChild(*previous_element); + + if (!previous_element) + return 0; + + if (previous_element->IsFocusable()) { + if (FiltersInEditableElement(filter) && + IsFormNavigationTextInput(*previous_element)) + return previous_element; + if (FiltersInSelectElement(filter) && IsSelectElement(*previous_element)) + return previous_element; + } + } + + while ((previous_element = ElementTraversal::Previous(*previous_element))) { + if (previous_element->HasTagName(html_names::kIFrameTag) || + previous_element->HasTagName(html_names::kFrameTag)) { + Element* frame_owner_element = previous_element; + + previous_element = PreviousTextOrSelectElement(previous_element, filter); + if (!previous_element) { + previous_element = frame_owner_element; + continue; + } + } + + if (!previous_element->IsFocusable()) + continue; + + if (FiltersInEditableElement(filter) && + IsFormNavigationTextInput(*previous_element)) { + break; + } + + if (FiltersInSelectElement(filter) && IsSelectElement(*previous_element)) + break; + } + + // If couldn't find anything in the current document scope, + // try finding in other document scope if present any. + if (!previous_element && + element->GetDocument().GetFrame() != MainFrameImpl()->GetFrame() && + !element->IsFrameOwnerElement()) { + previous_element = PreviousTextOrSelectElement( + ElementTraversal::Previous(*element->GetDocument().LocalOwner()), + filter); + } + + return previous_element; +} + +bool WebViewImpl::MoveFocusToNext(TraverseFocusThrough filter) { + Element* focus_element = FocusedElement(); + if (!focus_element || (!IsFormNavigationTextInput(*focus_element) && + !IsSelectElement(*focus_element))) { + return false; + } + + Element* next_element = NextTextOrSelectElement(focus_element, filter); + if (!next_element) + return false; + + // Scroll the element into center of screen. + next_element->scrollIntoViewIfNeeded(true /*centerIfNeeded*/); + + bool handled = PerformClickOnElement(*next_element); + + if (FocusedFrame() && IsFormNavigationTextInput(*next_element)) + FocusedFrame()->ExecuteCommand(WebString::FromUTF8("MoveToEndOfDocument")); + + return handled; +} + +bool WebViewImpl::MoveFocusToPrevious(TraverseFocusThrough filter) { + Element* focus_element = FocusedElement(); + + if (!focus_element || (!IsFormNavigationTextInput(*focus_element) && + !IsSelectElement(*focus_element))) { + return false; + } + + Element* previous_element = + PreviousTextOrSelectElement(focus_element, filter); + if (!previous_element) + return false; + + // Scroll the element into center of screen. + previous_element->scrollIntoViewIfNeeded(true /*centerIfNeeded*/); + + bool handled = PerformClickOnElement(*previous_element); + + if (FocusedFrame() && IsFormNavigationTextInput(*previous_element)) + FocusedFrame()->ExecuteCommand(WebString::FromUTF8("MoveToEndOfDocument")); + + return handled; +} #endif #if defined(TIZEN_VIDEO_HOLE) diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h index 5c3d4a2..11556ab 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.h +++ b/third_party/blink/renderer/core/exported/web_view_impl.h @@ -151,6 +151,14 @@ class CORE_EXPORT WebViewImpl final : public WebView, void SetNoStatePrefetchClient(WebNoStatePrefetchClient*) override; WebSettings* GetSettings() override; WebString PageEncoding() const override; +#if BUILDFLAG(IS_EFL) + bool MoveFocusToNext( + TraverseFocusThrough = + TraverseFocusThrough::EditableAndSelectElements) override; + bool MoveFocusToPrevious( + TraverseFocusThrough = + TraverseFocusThrough::EditableAndSelectElements) override; +#endif void SetTabKeyCyclesThroughElements(bool value) override; bool IsActive() const override; void SetIsActive(bool value) override; @@ -410,6 +418,10 @@ class CORE_EXPORT WebViewImpl final : public WebView, void MainFrameLayoutUpdated(); void ResizeAfterLayout(); void DidCommitCompositorFrameForLocalMainFrame(); +#if BUILDFLAG(IS_EFL) + bool FiltersInSelectElement(WebView::TraverseFocusThrough filter); + bool FiltersInEditableElement(WebView::TraverseFocusThrough filter); +#endif void DidChangeContentsSize(); void PageScaleFactorChanged(); void OutermostMainFrameScrollOffsetChanged(); @@ -683,6 +695,17 @@ class CORE_EXPORT WebViewImpl final : public WebView, scheduler::WebAgentGroupScheduler& agent_group_scheduler, const SessionStorageNamespaceId& session_storage_namespace_id, absl::optional page_base_background_color); + +#if BUILDFLAG(IS_EFL) + enum FormInputAction { + FormInputNone = 0x00, + FormInputPrevText = 0x01, + FormInputPrevSelect = 0x02, + FormInputNextText = 0x04, + FormInputNextSelect = 0x08, + }; +#endif + ~WebViewImpl() override; void ConfigureAutoResizeMode(); @@ -911,6 +934,18 @@ class CORE_EXPORT WebViewImpl final : public WebView, web_pref::WebPreferences web_preferences_; blink::RendererPreferences renderer_preferences_; +#if BUILDFLAG(IS_EFL) + bool IsFormNavigationTextInput(Element&) const; + bool IsSelectElement(const Element&) const; + bool PerformClickOnElement(Element&); + Element* NextTextOrSelectElement( + Element*, + TraverseFocusThrough = TraverseFocusThrough::EditableAndSelectElements); + Element* PreviousTextOrSelectElement( + Element*, + TraverseFocusThrough = TraverseFocusThrough::EditableAndSelectElements); + gfx::Rect GetElementBounds(const Element&) const; +#endif // The local root whose document has |popup_mouse_wheel_event_listener_| // registered. diff --git a/third_party/blink/renderer/core/html/forms/external_popup_menu.cc b/third_party/blink/renderer/core/html/forms/external_popup_menu.cc index e28ce00..d953952 100644 --- a/third_party/blink/renderer/core/html/forms/external_popup_menu.cc +++ b/third_party/blink/renderer/core/html/forms/external_popup_menu.cc @@ -252,7 +252,13 @@ void ExternalPopupMenu::DidAcceptIndices(const Vector& indices) { list_indices.push_back(ToPopupMenuItemIndex(indices[i], *owner_element)); owner_element->SelectMultipleOptionsByPopup(list_indices); } + +#if !BUILDFLAG(IS_EFL) + // Reset disconnects popup_client which will hide the popup menu. + // Which is not the expected behavior for EFL port after choosing a item in + // select menu. Reset(); +#endif } void ExternalPopupMenu::DidCancel() { diff --git a/tizen_src/chromium_impl/content/browser/browser_efl.gni b/tizen_src/chromium_impl/content/browser/browser_efl.gni index 3c93549..5532b96 100644 --- a/tizen_src/chromium_impl/content/browser/browser_efl.gni +++ b/tizen_src/chromium_impl/content/browser/browser_efl.gni @@ -99,6 +99,16 @@ external_content_browser_efl_sources = [ "//tizen_src/chromium_impl/content/browser/selection/selection_handle_efl.h", "//tizen_src/chromium_impl/content/browser/selection/selection_magnifier_efl.cc", "//tizen_src/chromium_impl/content/browser/selection/selection_magnifier_efl.h", + "//tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.cc", + "//tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.h", + "//tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.cc", + "//tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.h", + "//tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.cc", + "//tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.h", + "//tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.cc", + "//tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.h", + "//tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.cc", + "//tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.h", "//tizen_src/chromium_impl/content/browser/tracing/tracing_controller_efl.cc", "//tizen_src/chromium_impl/content/browser/tracing/tracing_controller_efl.h", "//tizen_src/chromium_impl/content/browser/web_contents/web_contents_impl_efl.cc", diff --git a/tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.cc b/tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.cc new file mode 100644 index 0000000..2d3d543 --- /dev/null +++ b/tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.cc @@ -0,0 +1,207 @@ +// Copyright 2016 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/select_picker/form_navigable_picker.h" + +#include "base/files/file_path.h" +#include "base/path_service.h" +#include "content/browser/renderer_host/render_frame_host_impl.h" +#include "content/common/paths_efl.h" +#include "tizen_src/ewk/efl_integration/common/web_contents_utils.h" + +#if BUILDFLAG(IS_TIZEN) +#include +#endif + +namespace { +const char* const kMouseClicked1 = "mouse,clicked,1"; +const char* const kImagePrevBgObj = "elm.image.prev_bg"; +const char* const kImageNextBgObj = "elm.image.next_bg"; +const char* const kImageDoneBgObj = "elm.image.done_bg"; +const char* const kDimmObj = "dimm"; +} // namespace + +FormNavigablePicker::FormNavigablePicker(Evas_Object* evas_object, + int selected_index, + bool is_multi_select) + : SelectPickerBase(evas_object, selected_index, is_multi_select), + form_navigator_info_{0, 0, true, true} { + ecore_events_filter_ = + ecore_event_filter_add(nullptr, EcoreEventFilterCallback, nullptr, this); + if (!ecore_events_filter_) + LOG(ERROR) << "Unable to create ecore events filter"; +} + +void FormNavigablePicker::RegisterCallbacks() { + auto edje_obj = elm_layout_edje_get(layout_); + edje_object_signal_callback_add(edje_obj, kMouseClicked1, kImagePrevBgObj, + NavigateToPrevCallback, this); + edje_object_signal_callback_add(edje_obj, kMouseClicked1, kImageNextBgObj, + NavigateToNextCallback, this); + edje_object_signal_callback_add(edje_obj, kMouseClicked1, kImageDoneBgObj, + ListClosedCallback, this); + edje_object_signal_callback_add(edje_obj, kMouseClicked1, kDimmObj, + ListClosedCallback, this); +#if BUILDFLAG(IS_TIZEN) + eext_object_event_callback_add(layout_, EEXT_CALLBACK_BACK, HWBackKeyCallback, + this); +#endif + evas_object_event_callback_add(evas_object_, EVAS_CALLBACK_KEY_UP, + KeyUpCallback, this); + evas_object_propagate_events_set(layout_, false); +} + +void FormNavigablePicker::UnregisterCallbacks() { + auto edje_obj = elm_layout_edje_get(layout_); + edje_object_signal_callback_del(edje_obj, kMouseClicked1, kImagePrevBgObj, + NavigateToPrevCallback); + edje_object_signal_callback_del(edje_obj, kMouseClicked1, kImageNextBgObj, + NavigateToNextCallback); + edje_object_signal_callback_del(edje_obj, kMouseClicked1, kImageDoneBgObj, + ListClosedCallback); + edje_object_signal_callback_del(edje_obj, kMouseClicked1, kDimmObj, + ListClosedCallback); +#if defined(OS_TIZEN) + eext_object_event_callback_del(layout_, EEXT_CALLBACK_BACK, + HWBackKeyCallback); +#endif + evas_object_event_callback_del(evas_object_, EVAS_CALLBACK_KEY_UP, + KeyUpCallback); + if (ecore_events_filter_) + ecore_event_filter_del(ecore_events_filter_); +} + +void FormNavigablePicker::ShowButtons() { + auto edje_obj = elm_layout_edje_get(layout_); + edje_object_signal_emit(edje_obj, "show,prev_button,signal", ""); + edje_object_signal_emit(edje_obj, "show,next_button,signal", ""); + edje_object_signal_emit(edje_obj, "show,picker,signal", ""); +} + +void FormNavigablePicker::UpdateFormNavigation(int form_element_count, + int current_node_index) { + form_navigator_info_ = {form_element_count, current_node_index}; + UpdateNavigationButtons(); +} + +void FormNavigablePicker::UpdateNavigationButtons() { + auto edje_obj = elm_layout_edje_get(layout_); + if (form_navigator_info_.index > 0 && !form_navigator_info_.is_prev) { + edje_object_signal_emit(edje_obj, "enable,prev_button,signal", ""); + form_navigator_info_.is_prev = true; + } else if (form_navigator_info_.index == 0) { + edje_object_signal_emit(edje_obj, "disable,prev_button,signal", ""); + form_navigator_info_.is_prev = false; + } + if (form_navigator_info_.index < form_navigator_info_.count - 1 && + !form_navigator_info_.is_next) { + edje_object_signal_emit(edje_obj, "enable,next_button,signal", ""); + form_navigator_info_.is_next = true; + } else if (form_navigator_info_.index == form_navigator_info_.count - 1) { + edje_object_signal_emit(edje_obj, "disable,next_button,signal", ""); + form_navigator_info_.is_next = false; + } +} + +void FormNavigablePicker::RegisterCallbacks(const char* edj, bool overlay) { + base::FilePath edj_dir; + base::FilePath control_edj; + base::PathService::Get(PathsEfl::EDJE_RESOURCE_DIR, &edj_dir); + control_edj = edj_dir.Append(FILE_PATH_LITERAL(edj)); + if (!elm_layout_file_set(layout_, control_edj.AsUTF8Unsafe().c_str(), + "elm/picker")) { + LOG(ERROR) << "error elm_layout_file_set, " << edj; + } else { + if (overlay) + elm_theme_overlay_add(nullptr, control_edj.AsUTF8Unsafe().c_str()); + RegisterCallbacks(); + } + ShowButtons(); +} + +Evas_Object* FormNavigablePicker::AddBackground() { + Evas_Object* bg = elm_bg_add(layout_); + elm_object_part_content_set(layout_, "bg", bg); + return bg; +} + +void FormNavigablePicker::AddDoneButton() { + edje_object_part_text_set(elm_layout_edje_get(layout_), "elm.text.done", + "Done"); +} + +void FormNavigablePicker::UpdatePickerData( + int selected_index, + std::vector items, + bool is_multiple_selection) { + RequestFormNavigationInformation(); + SelectPickerBase::UpdatePickerData(selected_index, std::move(items), + is_multiple_selection); +} + +void FormNavigablePicker::NavigateToNextCallback(void* data, + Evas_Object* obj, + const char* emission, + const char* source) { + auto picker = static_cast(data); + picker->FormNavigate(true); +} + +void FormNavigablePicker::NavigateToPrevCallback(void* data, + Evas_Object* obj, + const char* emission, + const char* source) { + auto picker = static_cast(data); + picker->FormNavigate(false); +} + +void FormNavigablePicker::KeyUpCallback(void* data, + Evas* e, + Evas_Object* obj, + void* event_info) { + auto key_struct = static_cast(event_info); + if (!web_contents_utils::MapsToHWBackKey(key_struct->keyname)) + return; +#if BUILDFLAG(IS_TIZEN) + HWBackKeyCallback(data, obj, event_info); +#endif +} + +#if BUILDFLAG(IS_TIZEN) +void FormNavigablePicker::HWBackKeyCallback(void* data, + Evas_Object* obj, + void* event_info) { + ListClosedCallback(data, obj, 0, 0); +} +#endif + +void FormNavigablePicker::ListClosedCallback(void* data, + Evas_Object* obj, + const char* emission, + const char* source) { + auto picker = static_cast(data); + if (picker->is_multiple_selection_) + picker->DidMultipleSelectPopupMenuItem(); + else + picker->DidSelectPopupMenuItem(); + picker->HidePopupMenu(); +} + +Eina_Bool FormNavigablePicker::EcoreEventFilterCallback(void* user_data, + void* /*loop_data*/, + int type, + void* event) { + auto picker = static_cast(user_data); + if (type == ECORE_EVENT_KEY_DOWN && picker->IsVisible()) { + std::string key_name = static_cast(event)->keyname; + if (!key_name.compare("Up") || !key_name.compare("Left")) { + picker->FormNavigate(false); + return ECORE_CALLBACK_CANCEL; + } else if (!key_name.compare("Right") || !key_name.compare("Down")) { + picker->FormNavigate(true); + return ECORE_CALLBACK_CANCEL; + } + } + return ECORE_CALLBACK_PASS_ON; +} diff --git a/tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.h b/tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.h new file mode 100644 index 0000000..983db71 --- /dev/null +++ b/tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.h @@ -0,0 +1,73 @@ +// Copyright 2016 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_SELECT_PICKER_FORM_NAVIGABLE_PICKER_H_ +#define CONTENT_BROWSER_SELECT_PICKER_FORM_NAVIGABLE_PICKER_H_ + +#include "content/browser/select_picker/select_picker_base.h" + +class FormNavigablePicker : public SelectPickerBase { + public: + virtual ~FormNavigablePicker() override {} + + FormNavigablePicker(const FormNavigablePicker&) = delete; + FormNavigablePicker& operator=(const FormNavigablePicker&) = delete; + + void UpdateFormNavigation(int form_element_count, + int current_node_index) override; + void UpdatePickerData(int selected_index, + std::vector items, + bool is_multiple_selection) override; + + protected: + explicit FormNavigablePicker(Evas_Object* evas_object, + int selected_index, + bool is_multi_select); + void RegisterCallbacks(const char* edj, bool overlay); + void RegisterCallbacks(); + void UnregisterCallbacks(); + Evas_Object* AddBackground(); + void AddDoneButton(); + void ShowButtons(); + + virtual void FormNavigate(bool direction) = 0; + virtual void RequestFormNavigationInformation() = 0; + virtual void HidePopupMenu() = 0; + + private: + void UpdateNavigationButtons(); + static void KeyUpCallback(void* data, + Evas* e, + Evas_Object* obj, + void* event_info); +#if BUILDFLAG(IS_TIZEN) + static void HWBackKeyCallback(void* data, Evas_Object* obj, void* event_info); +#endif + static void ListClosedCallback(void* data, + Evas_Object* obj, + const char* emission, + const char* source); + static void NavigateToPrevCallback(void* data, + Evas_Object* obj, + const char* emission, + const char* source); + static void NavigateToNextCallback(void* data, + Evas_Object* obj, + const char* emission, + const char* source); + static Eina_Bool EcoreEventFilterCallback(void* data, + void* loop_data, + int type, + void* event); + + Ecore_Event_Filter* ecore_events_filter_; + struct FormNavigatorInfo { + int count; + int index; + bool is_prev; + bool is_next; + } form_navigator_info_; +}; + +#endif // CONTENT_BROWSER_SELECT_PICKER_FORM_NAVIGABLE_PICKER_H_ diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.cc b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.cc new file mode 100644 index 0000000..a4668c7 --- /dev/null +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.cc @@ -0,0 +1,231 @@ +// Copyright 2016 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/select_picker/select_picker_base.h" + +#include "base/strings/utf_string_conversions.h" +#include "content/browser/select_picker/select_picker_util.h" +#include "content/browser/web_contents/web_contents_view_aura.h" + +namespace { + +const char* const kSelectedCbName = "selected"; +const char* const kUnselectedCbName = "unselected"; +const char* const kElmText = "elm.text"; + +template +void InsertSorted(std::vector& vec, const T value) { + vec.insert(std::upper_bound(vec.begin(), vec.end(), value), value); +} + +template +size_t SearchValue(const std::vector& vec, const T value) { + auto it = find(vec.begin(), vec.end(), value); + if (it == vec.end()) + return std::string::npos; + return std::distance(vec.begin(), it); +} + +template +void RemoveValue(std::vector& vec, const T value) { + vec.erase(std::remove(vec.begin(), vec.end(), value), vec.end()); +} + +char* LabelGetCallback(void* data, Evas_Object* obj, const char* part) { + auto callback_data = static_cast(data); + if (!strncmp(part, kElmText, strlen(kElmText))) + return elm_entry_utf8_to_markup((callback_data->GetLabel()).c_str()); + return nullptr; +} +} // namespace + +SelectPickerBase::SelectPickerBase(Evas_Object* evas_object, + int selected_index, + bool is_multiple_selection) + : evas_object_(evas_object), + popup_list_(nullptr), + selected_index_(selected_index), + is_multiple_selection_(is_multiple_selection) { + window_ = + elm_object_top_widget_get(elm_object_parent_widget_get(evas_object_)); + layout_ = elm_layout_add(window_); +} + +SelectPickerBase::~SelectPickerBase() { + DestroyPopupList(); + elm_genlist_item_class_free(group_class_); + elm_genlist_item_class_free(item_class_); + evas_object_del(layout_); +} + +void SelectPickerBase::InitializeItemClass() { + item_class_ = elm_genlist_item_class_new(); + item_class_->item_style = GetItemStyle(); + item_class_->func.text_get = LabelGetCallback; + item_class_->func.content_get = nullptr; + item_class_->func.state_get = nullptr; + item_class_->func.del = nullptr; +} + +void SelectPickerBase::InitializeGroupClass() { + group_class_ = elm_genlist_item_class_new(); + group_class_->item_style = "group_index"; + group_class_->func.text_get = LabelGetCallback; + group_class_->func.content_get = nullptr; + group_class_->func.state_get = nullptr; + group_class_->func.del = nullptr; +} + +const char* SelectPickerBase::GetItemStyle() const { + return "default"; +} + +void SelectPickerBase::UpdatePickerData( + int selected_index, + std::vector items, + bool is_multiple_selection) { + ClearData(); + selected_index_ = selected_index; + is_multiple_selection_ = is_multiple_selection; + CreateAndPopulatePopupList(std::move(items)); +} + +gfx::Rect SelectPickerBase::GetGeometryDIP() const { + return gfx::Rect(); +} + +void SelectPickerBase::DestroyPopupList() { + if (popup_list_) { + if (is_multiple_selection_) { + evas_object_smart_callback_del(popup_list_, kSelectedCbName, + MenuItemActivatedCallback); + evas_object_smart_callback_del(popup_list_, kUnselectedCbName, + MenuItemDeactivatedCallback); + } + elm_genlist_clear(popup_list_); + evas_object_del(popup_list_); + } + for (const auto& item : select_picker_data_) + delete item; +} + +void SelectPickerBase::ClearData() { + DestroyPopupList(); + select_picker_data_.clear(); + selected_indexes_.clear(); +} + +void SelectPickerBase::ItemSelectedCallback(void* data, + Evas_Object* obj, + void* event_info) { + auto callback_data = static_cast(data); + callback_data->GetSelectPicker()->ItemSelected(callback_data, event_info); +} + +void SelectPickerBase::ItemSelected(GenlistCallbackData* data, + void* event_info) { + if (data->IsEnabled()) { + selected_index_ = data->GetIndex(); + DidSelectPopupMenuItem(); + } +} + +void SelectPickerBase::DidSelectPopupMenuItem() { + if (select_picker_data_.empty()) + return; + // When user select empty space then no index is selected, so selectedIndex + // value is -1. In that case we should call valueChanged() with -1 index. + // That in turn call popupDidHide() in didChangeSelectedIndex() for reseting + // the value of m_popupIsVisible in RenderMenuList. + if (selected_index_ != -1 && + selected_index_ >= static_cast(select_picker_data_.size())) + return; + // In order to reuse RenderFrameHostImpl::DidSelectPopupMenuItems() method + // in Android, put selectedIndex into std::vector. + std::vector selectedIndices; + selectedIndices.push_back(selected_index_); + if (wcva()) + wcva()->wcva_helper()->DidSelectPopupMenuItems(selectedIndices); +} + +void SelectPickerBase::MenuItemActivatedCallback(void* data, + Evas_Object* obj, + void* event_info) { + auto picker = static_cast(data); + auto selected = static_cast(event_info); + // Subtract 1 from value returned by elm_genlist_item_index_get + // to match webkit expectation (index starting from 0). + int index = elm_genlist_item_index_get(selected) - 1; + if (picker->is_multiple_selection_) { + size_t pos = SearchValue(picker->selected_indexes_, index); + if (pos == std::string::npos) + InsertSorted(picker->selected_indexes_, index); + else + RemoveValue(picker->selected_indexes_, index); + } + picker->DidMultipleSelectPopupMenuItem(); +} + +void SelectPickerBase::MenuItemDeactivatedCallback(void* data, + Evas_Object* obj, + void* event_info) { + auto picker = static_cast(data); + auto deselectedItem = static_cast(event_info); + // Subtract 1 from value returned by elm_genlist_item_index_get + // to match webkit expectation (index starting from 0). + int deselectedIndex = elm_genlist_item_index_get(deselectedItem) - 1; + size_t pos = SearchValue(picker->selected_indexes_, deselectedIndex); + if (pos == std::string::npos) + InsertSorted(picker->selected_indexes_, deselectedIndex); + else + RemoveValue(picker->selected_indexes_, deselectedIndex); + picker->DidMultipleSelectPopupMenuItem(); +} + +void SelectPickerBase::DidMultipleSelectPopupMenuItem() { + if (!wcva() || select_picker_data_.empty()) + return; + wcva()->wcva_helper()->DidSelectPopupMenuItems(selected_indexes_); +} + +void SelectPickerBase::InitializeSelectedPickerData( + std::vector items) { + bool need_scroll_to_top = true; + for (size_t index = 0; index < items.size(); index++) { + bool checked = items[index]->checked; + auto data = new GenlistCallbackData( + index, this, std::move(items[index]), popup_list_, item_class_, + group_class_, is_multiple_selection_, ItemSelectedCallback); + + if (is_multiple_selection_ && checked) { + selected_indexes_.push_back(index); + if (need_scroll_to_top) { + data->ScrollToTop(); + need_scroll_to_top = false; + } + } + select_picker_data_.push_back(data); + } + + if (is_multiple_selection_) { + evas_object_smart_callback_add(popup_list_, kSelectedCbName, + MenuItemActivatedCallback, this); + evas_object_smart_callback_add(popup_list_, kUnselectedCbName, + MenuItemDeactivatedCallback, this); + } else if (selected_index_ >= 0) { + select_picker_data_[selected_index_]->ScrollToTop(); + } +} + +void SelectPickerBase::Show() { + evas_object_show(layout_); +} + +void SelectPickerBase::Hide() { + evas_object_hide(layout_); +} + +bool SelectPickerBase::IsVisible() const { + return evas_object_visible_get(layout_); +} diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.h b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.h new file mode 100644 index 0000000..95d62a6 --- /dev/null +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.h @@ -0,0 +1,78 @@ +// Copyright 2016 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_SELECT_PICKER_SELECT_PICKER_BASE_H_ +#define CONTENT_BROWSER_SELECT_PICKER_SELECT_PICKER_BASE_H_ + +#include +#include + +#include "third_party/blink/public/mojom/choosers/popup_menu.mojom.h" +#include "ui/gfx/geometry/rect.h" + +class GenlistCallbackData; + +namespace content { +class WebContentsViewAura; +} + +class SelectPickerBase { + public: + virtual ~SelectPickerBase(); + + SelectPickerBase(const SelectPickerBase&) = delete; + SelectPickerBase& operator=(const SelectPickerBase&) = delete; + + virtual void UpdateFormNavigation(int form_element_count, + int current_node_index) {} + virtual void UpdatePickerData(int selected_index, + std::vector items, + bool is_multiple_selection); + virtual gfx::Rect GetGeometryDIP() const; + + void Show(); + void Hide(); + bool IsVisible() const; + void InitializeItemClass(); + void InitializeGroupClass(); + virtual void Init(std::vector items, + const gfx::Rect& bounds) = 0; + + protected: + explicit SelectPickerBase(Evas_Object* evas_object, + int selected_index, + bool is_multiple_selection); + virtual const char* GetItemStyle() const; + virtual void ClearData(); + virtual void CreateAndPopulatePopupList( + std::vector items) = 0; + virtual void ItemSelected(GenlistCallbackData* data, void* event_info); + void InitializeSelectedPickerData( + std::vector items); + void DidSelectPopupMenuItem(); + void DidMultipleSelectPopupMenuItem(); + + virtual content::WebContentsViewAura* wcva() const { return nullptr; } + + Evas_Object* evas_object_; + Evas_Object* popup_list_; + Evas_Object* layout_; + Evas_Object* window_; + int selected_index_; + bool is_multiple_selection_; + Elm_Genlist_Item_Class* item_class_; + + private: + static void ItemSelectedCallback(void*, Evas_Object*, void*); + static void MenuItemActivatedCallback(void*, Evas_Object*, void*); + static void MenuItemDeactivatedCallback(void*, Evas_Object*, void*); + + void DestroyPopupList(); + + Elm_Genlist_Item_Class* group_class_; + std::vector select_picker_data_; + std::vector selected_indexes_; +}; + +#endif // CONTENT_BROWSER_SELECT_PICKER_SELECT_PICKER_BASE_H_ diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.cc b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.cc new file mode 100644 index 0000000..55ae1ab --- /dev/null +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.cc @@ -0,0 +1,164 @@ +// Copyright 2014-17 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/select_picker/select_picker_mobile_base.h" + +#include "content/browser/select_picker/select_picker_util.h" + +#include "tizen/system_info.h" +#include "ui/display/display.h" +#include "ui/display/screen.h" +#include "ui/gfx/geometry/dip_util.h" +#include "ui/gfx/geometry/rect.h" +#include "ui/gfx/geometry/rect_conversions.h" + +namespace { + +const char* const kChangedCbName = "changed"; + +void RadioIconChangedCallback(void* data, Evas_Object* obj, void* event_info) { + auto callback_data = static_cast(data); + callback_data->SetSelection(true); +} + +} // namespace + +SelectPickerMobileBase::SelectPickerMobileBase(Evas_Object* evas_object, + int selected_index, + bool is_multiple_selection) + : FormNavigablePicker(evas_object, selected_index, is_multiple_selection), + radio_main_(nullptr) { + evas_object_size_hint_weight_set(layout_, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(window_, layout_); + evas_object_propagate_events_set(layout_, false); +} + +SelectPickerMobileBase::~SelectPickerMobileBase() { + Hide(); + DestroyRadioList(); +} + +void SelectPickerMobileBase::Init(std::vector items, + const gfx::Rect& bounds) { + // Request form navigation information as early as possible, + // given that is renderer will ping-back with actual requested data. + RequestFormNavigationInformation(); + + RegisterCallbacks("control.edj", false); + CreateAndPopulatePopupList(std::move(items)); + AddBackground(); + AddDoneButton(); + + // Need to update evas objects here in order to get proper geometry + // at AdjustViewPortHeightToPopupMenu. + evas_norender(evas_object_evas_get(window_)); +} + +void SelectPickerMobileBase::DestroyRadioList() { + if (!radio_main_) + return; + + if (is_multiple_selection_) + evas_object_smart_callback_del(popup_list_, kChangedCbName, + RadioIconChangedCallback); + elm_genlist_clear(radio_main_); + evas_object_del(radio_main_); +} + +void SelectPickerMobileBase::ClearData() { + DestroyRadioList(); + FormNavigablePicker::ClearData(); +} + +Evas_Object* SelectPickerMobileBase::IconGetCallback(void* data, + Evas_Object* obj, + const char* part) { + auto callback_data = static_cast(data); + auto picker = + static_cast(callback_data->GetSelectPicker()); + if (callback_data->IsEnabled() && !strcmp(part, "elm.swallow.end")) { + Evas_Object* radio = elm_radio_add(obj); + elm_object_focus_allow_set(radio, false); + elm_radio_state_value_set(radio, callback_data->GetIndex()); + elm_radio_group_add(radio, picker->radio_main_); + + evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_propagate_events_set(radio, EINA_FALSE); + + elm_radio_value_set(picker->radio_main_, picker->selected_index_); + evas_object_smart_callback_add(radio, kChangedCbName, + RadioIconChangedCallback, (void*)data); + return radio; + } + return nullptr; +} + +void SelectPickerMobileBase::ItemSelected(GenlistCallbackData* data, + void* event_info) { + // Efl highlights item by default. We only want radio button to be checked. + Evas_Object* radio_icon = elm_object_item_part_content_get( + (Elm_Object_Item*)event_info, "elm.swallow.end"); + data->SetSelection(false); + + if (data->IsEnabled()) { + elm_radio_value_set(radio_icon, data->GetIndex()); + selected_index_ = data->GetIndex(); + DidSelectPopupMenuItem(); + } +} + +void SelectPickerMobileBase::CreateAndPopulatePopupList( + std::vector items) { + popup_list_ = elm_genlist_add(layout_); + elm_genlist_mode_set(popup_list_, ELM_LIST_COMPRESS); + elm_object_style_set(popup_list_, "solid/default"); + evas_object_size_hint_weight_set(popup_list_, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(popup_list_, EVAS_HINT_FILL, EVAS_HINT_FILL); + + elm_object_focus_allow_set(popup_list_, false); + + item_class_->func.content_get = + is_multiple_selection_ ? nullptr : IconGetCallback; + + elm_genlist_multi_select_set(popup_list_, is_multiple_selection_); + + if (!is_multiple_selection_) { + radio_main_ = elm_radio_add(popup_list_); + if (!radio_main_) { + LOG(ERROR) << "elm_radio_add failed."; + return; + } + + elm_radio_state_value_set(radio_main_, 0); + elm_radio_value_set(radio_main_, 0); + + InitializeSelectedPickerData(std::move(items)); + if (selected_index_ >= 0) { + elm_radio_value_set(radio_main_, selected_index_); + } + + evas_object_smart_callback_add(popup_list_, kChangedCbName, + RadioIconChangedCallback, this); + } else { + InitializeSelectedPickerData(std::move(items)); + } + + elm_object_part_content_set(layout_, "elm.swallow.content", popup_list_); +} + +gfx::Rect SelectPickerMobileBase::GetGeometryDIP() const { + if (IsMobileProfile()) { + int x, y, w, h; + edje_object_part_geometry_get(elm_layout_edje_get(layout_), "bg", &x, &y, + &w, &h); + return gfx::ToEnclosingRect(gfx::ConvertRectToDips( + gfx::Rect(x, y, w, h), display::Screen::GetScreen() + ->GetPrimaryDisplay() + .device_scale_factor())); + } else { + return gfx::Rect(); + } +} diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.h b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.h new file mode 100644 index 0000000..a60b360 --- /dev/null +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.h @@ -0,0 +1,39 @@ +// Copyright 2022 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_SELECT_PICKER_SELECT_PICKER_MOBILE_BASE_H_ +#define CONTENT_BROWSER_SELECT_PICKER_SELECT_PICKER_MOBILE_BASE_H_ + +#include "content/browser/select_picker/form_navigable_picker.h" + +class GenlistCallbackData; + +class SelectPickerMobileBase : public FormNavigablePicker { + public: + explicit SelectPickerMobileBase(Evas_Object* evas_object, + int selected_index, + bool is_multiple_selection); + virtual ~SelectPickerMobileBase() override; + + SelectPickerMobileBase(const SelectPickerMobileBase&) = delete; + SelectPickerMobileBase& operator=(const SelectPickerMobileBase&) = delete; + + private: + static Evas_Object* IconGetCallback(void*, Evas_Object*, const char*); + + // SelectPickerBase + gfx::Rect GetGeometryDIP() const override; + void Init(std::vector items, + const gfx::Rect& bounds) override; + void ItemSelected(GenlistCallbackData* data, void* event_info) override; + void ClearData() override; + void CreateAndPopulatePopupList( + std::vector items) override; + + void DestroyRadioList(); + + Evas_Object* radio_main_; +}; + +#endif // CONTENT_BROWSER_SELECT_PICKER_SELECT_PICKER_MOBILE_BASE_H_ diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.cc b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.cc new file mode 100644 index 0000000..1422a45 --- /dev/null +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.cc @@ -0,0 +1,55 @@ +// Copyright 2022 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/select_picker/select_picker_tv_base.h" + +namespace { +// Size of element and do resize only when - // the picker overlaps the element will prevent Blink from doing re-layout. - // Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=15488. - rwhva()->offscreen_helper()->SetCustomViewportSize(gfx::Size( - rect.width(), is_popup_menu_visible ? rect.height() - picker_height - : rect.height() + picker_height)); + rwhva()->offscreen_helper()->SetCustomViewportSize( + is_popup_menu_visible + ? gfx::Size(view_rect.width(), + view_rect.height() - picker_height + bottom_height) + : gfx::Size()); } void EWebView::SetScaleChangedCallback(Ewk_View_Scale_Changed_Callback callback, @@ -2676,6 +2549,12 @@ bool EWebView::HandleResize(int width, int height) { if (!native_view_) return false; evas_object_resize(native_view_, width, height); + + if (select_picker_) { + AdjustViewPortHeightToPopupMenu(true /* is_popup_menu_visible */); + ScrollFocusedNodeIntoView(); + } + return true; } diff --git a/tizen_src/ewk/efl_integration/eweb_view.h b/tizen_src/ewk/efl_integration/eweb_view.h index 9d87a7a..ee88fa3 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.h +++ b/tizen_src/ewk/efl_integration/eweb_view.h @@ -21,9 +21,9 @@ #include "base/containers/id_map.h" #include "base/synchronization/waitable_event.h" #include "browser/input_picker/input_picker.h" -#include "browser/selectpicker/popup_picker.h" #include "content/browser/date_time_chooser_efl.h" #include "content/browser/renderer_host/event_with_latency_info.h" +#include "content/browser/select_picker/select_picker_base.h" #include "content/browser/selection/selection_controller_efl.h" #include "content/browser/web_contents/web_contents_view_aura.h" #include "content/browser/web_contents/web_contents_view_aura_helper_efl.h" @@ -381,19 +381,11 @@ class EWebView { void SetContentSecurityPolicy(const char* policy, Ewk_CSP_Header_Type type); void HandlePopupMenu(std::vector items, int selectedIndex, - bool multiple); + bool multiple, + const gfx::Rect& bounds); void HidePopupMenu(); - void UpdateFormNavigation(int formElementCount, - int currentNodeIndex, - bool prevState, - bool nextState); - void FormNavigate(bool direction); - bool FormIsNavigating() const { return formIsNavigating_; } - void SetFormIsNavigating(bool formIsNavigating); - Eina_Bool PopupMenuUpdate(Eina_List* items, int selectedIndex); - Eina_Bool DidSelectPopupMenuItem(int selectedIndex); - Eina_Bool DidMultipleSelectPopupMenuItem(std::vector& selectedIndices); - void PopupMenuClose(); + void DidSelectPopupMenuItems(std::vector& indices); + void DidCancelPopupMenu(); void HandleLongPressGesture(const content::ContextMenuParams&); void ShowContextMenu(const content::ContextMenuParams&); void CancelContextMenu(int request_id); @@ -408,6 +400,7 @@ class EWebView { Eina_Hash* headers, const char* body); + SelectPickerBase* GetSelectPicker() const { return select_picker_.get(); } content::SelectionControllerEfl* GetSelectionController() const; content::PopupControllerEfl* GetPopupController() const { return popup_controller_.get(); @@ -706,7 +699,6 @@ class EWebView { #endif JavaScriptDialogManagerEfl* GetJavaScriptDialogManagerEfl(); - void ReleasePopupMenuList(); // Changes viewport without resizing Evas_Object representing webview // and its corresponding RWHV to let Blink renders custom viewport // while showing picker. @@ -747,16 +739,6 @@ class EWebView { std::unique_ptr<_Ewk_Auth_Challenge> auth_challenge_; std::string selected_text_cached_; - Eina_List* popupMenuItems_; - Popup_Picker* popupPicker_; - bool formIsNavigating_; - typedef struct { - int count; - int position; - bool prevState; - bool nextState; - } formNavigation; - formNavigation formNavigation_; std::unique_ptr context_menu_; #if !defined(EWK_BRINGUP) // FIXME: m71 bringup std::unique_ptr file_chooser_; @@ -863,6 +845,7 @@ class EWebView { content::AcceptLanguagesHelper::AcceptLangsChangedCallback accept_langs_changed_callback_; + std::unique_ptr select_picker_; std::unique_ptr host_; std::unique_ptr focus_client_; std::unique_ptr window_parenting_client_; diff --git a/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc b/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc index 154762e..19fc4e7 100644 --- a/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc +++ b/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc @@ -83,9 +83,6 @@ bool RenderFrameObserverEfl::OnMessageReceived(const IPC::Message& message) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(RenderFrameObserverEfl, message) IPC_MESSAGE_HANDLER(EwkFrameMsg_LoadNotFoundErrorPage, OnLoadNotFoundErrorPage) -#if !defined(EWK_BRINGUP) // FIXME: m67 bringup - IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) -#endif IPC_MESSAGE_HANDLER(EwkFrameMsg_MoveToNextOrPreviousSelectElement, OnMoveToNextOrPreviousSelectElement) IPC_MESSAGE_HANDLER(EwkFrameMsg_RequestSelectCollectionInformation, OnRequestSelectCollectionInformation); IPC_MESSAGE_UNHANDLED(handled = false) @@ -93,25 +90,6 @@ bool RenderFrameObserverEfl::OnMessageReceived(const IPC::Message& message) { return handled; } -void RenderFrameObserverEfl::OnSelectPopupMenuItems( - bool canceled, - const std::vector& selected_indices) { -#if !defined(EWK_BRINGUP) // FIXME: m67 bringup - RenderFrameImpl* render_frame_impl_ = static_cast(render_frame()); - ExternalPopupMenu* external_popup_menu_ = render_frame_impl_->external_popup_menu_.get(); - if (external_popup_menu_ == NULL) - return; - // It is possible to receive more than one of these calls if the user presses - // a select faster than it takes for the show-select-popup IPC message to make - // it to the browser UI thread. Ignore the extra-messages. - // TODO(jcivelli): http:/b/5793321 Implement a better fix, as detailed in bug. - canceled = canceled || !hasHTMLTagNameSelect(GetFocusedElement(render_frame()->GetWebFrame())); - external_popup_menu_->DidSelectItems(canceled, selected_indices); - if (canceled) - render_frame_impl_->DidHideExternalPopupMenu(); -#endif -} - void RenderFrameObserverEfl::OnLoadNotFoundErrorPage(std::string errorUrl) { #if !defined(EWK_BRINGUP) // FIXME: m108 bringup blink::WebLocalFrame* frame = render_frame()->GetWebFrame(); @@ -128,13 +106,13 @@ void RenderFrameObserverEfl::OnLoadNotFoundErrorPage(std::string errorUrl) { } void RenderFrameObserverEfl::OnMoveToNextOrPreviousSelectElement(bool direction) { -#if !defined(EWK_BRINGUP) // FIXME: m67 bringup - content::RenderView* render_view_ = render_frame()->GetRenderView(); - if (direction) - render_view_->GetWebView()->moveFocusToNext(WebView::TraverseFocusThrough::SelectElement); - else - render_view_->GetWebView()->moveFocusToPrevious(WebView::TraverseFocusThrough::SelectElement); -#endif + if (direction) { + render_frame()->GetWebView()->MoveFocusToNext( + WebView::TraverseFocusThrough::SelectElement); + } else { + render_frame()->GetWebView()->MoveFocusToPrevious( + WebView::TraverseFocusThrough::SelectElement); + } } void RenderFrameObserverEfl::OnRequestSelectCollectionInformation() { @@ -181,11 +159,11 @@ void RenderFrameObserverEfl::DidChangeScrollOffset() { if (render_frame()->GetRenderView()->GetMainRenderFrame() != render_frame()) return; blink::WebLocalFrame* frame = render_frame()->GetWebFrame(); - blink::WebSize contentsSize = frame->ContentsSize(); + blink::WebSize documentSize = frame->DocumentSize(); blink::WebRect visibleContentRect = frame->VisibleContentRect(); blink::WebSize maximumScrollOffset( - contentsSize.width - visibleContentRect.width, - contentsSize.height - visibleContentRect.height); + documentSize.width - visibleContentRect.width, + documentSize.height - visibleContentRect.height); if (max_scroll_offset_ != maximumScrollOffset) { max_scroll_offset_ = maximumScrollOffset; diff --git a/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.h b/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.h index 045c65d..9f3dfe2 100644 --- a/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.h +++ b/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.h @@ -60,9 +60,6 @@ class RenderFrameObserverEfl : public RenderFrameObserver { RenderFrame* frame) override; private: - void OnSelectPopupMenuItems(bool canceled, - const std::vector& selected_indices); - void OnLoadNotFoundErrorPage(std::string errorUrl); void OnMoveToNextOrPreviousSelectElement(bool direction); diff --git a/tizen_src/ewk/efl_integration/resource/BUILD.gn b/tizen_src/ewk/efl_integration/resource/BUILD.gn index 33f8000..493a38c 100644 --- a/tizen_src/ewk/efl_integration/resource/BUILD.gn +++ b/tizen_src/ewk/efl_integration/resource/BUILD.gn @@ -9,9 +9,7 @@ template("edje_res_ewk") { action_foreach(edje_target_name) { script = "//tizen_src/build/cmd_execution.py" sources = invoker.sources - outputs = [ - "$root_out_dir/resources/{{source_name_part}}.edj", - ] + outputs = [ "$root_out_dir/resources/{{source_name_part}}.edj" ] args = [ "$edje_compiler", "-id", @@ -22,9 +20,7 @@ template("edje_res_ewk") { } source_set(target_name) { - deps = [ - ":$edje_target_name", - ] + deps = [ ":$edje_target_name" ] } } @@ -34,5 +30,6 @@ edje_res_ewk("edje_resources_ewk") { "AutofillPopup.edc", "JavaScriptPopup.edc", "control.edc", + "controlTV.edc", ] } diff --git a/tizen_src/ewk/efl_integration/resource/control.edc b/tizen_src/ewk/efl_integration/resource/control.edc index 9f3e959..8989867 100644 --- a/tizen_src/ewk/efl_integration/resource/control.edc +++ b/tizen_src/ewk/efl_integration/resource/control.edc @@ -239,8 +239,8 @@ collections { } description { state: "show" 0.0; inherit: "default" 0.0; - rel1 { relative: 0.0 0.48;} - rel2 { relative: 1.0 1.0; offset: 0 2; } + rel1 { relative: 0.0 0.5; } + rel2 { relative: 1.0 1.0; } } description { state: "imf_panel" 0.0; inherit: "show" 0.0; @@ -461,6 +461,7 @@ collections { scale: 1; description { state: "default" 0.0; align: 0.0 0.0; + fixed: 0 1; rel1 { relative: 0.0 1.0; to: "elm.image.panel"; } rel2 { relative: 1.0 1.0;} } @@ -554,6 +555,10 @@ collections { target: "bg"; target: "elm.image.panel"; target: "elm.swallow.content"; + after: "show,picker,done"; + } + program { name: "show,picker,done"; + action: SIGNAL_EMIT "show,picker,done" ""; } program { name: "show,picker_delay"; signal: "show,picker_delay,signal"; diff --git a/tizen_src/ewk/efl_integration/resource/controlTV.edc b/tizen_src/ewk/efl_integration/resource/controlTV.edc new file mode 100644 index 0000000..0ff54ea --- /dev/null +++ b/tizen_src/ewk/efl_integration/resource/controlTV.edc @@ -0,0 +1,1833 @@ +#define COLORSELECTOR_BG_WIDTH_INC 300 +#define COLORSELECTOR_POPUP_TOP_PADDING_HEIGHT_INC 26 +#define COLORSELECTOR_POPUP_HEIGHT_INC 194 +#define COLORSELECTOR_POPUP_SEPARATOR_INC 1 +#define COLORSELECTOR_POPUP_COLORSELECTOR_HEIGHT_INC 148 + +#define FIXED_SIZE(_WIDTH, _HEIGHT) \ + min: _WIDTH _HEIGHT; max: _WIDTH _HEIGHT; fixed: 1 1; + +#define BASIC_CURVE 0.3 0.0 0.0 1.0 +#define BLACK_COLOR 0 0 0 +#define DO_NOT_SCROLL_IF_SPACE_IS_MORE_THAN_THIS_VALUE 1 +#define FOCUS_HIGHLIGHT_BORDER 5 5 5 5; +#define LIST_FONT_SIZE 38 +#define SPEED 30 +#define STATE_STRING_LEN 10 +#define WHITE_COLOR 255 255 255 +#define ZERO_VER 0.0 + +#define OPACITY_100 255 +#define OPACITY_97 248 +#define OPACITY_90 230 +#define OPACITY_70 179 +#define OPACITY_50 128 +#define OPACITY_40 102 +#define OPACITY_30 77 +#define OPACITY_20 51 +#define OPACITY_18 46 +#define OPACITY_15 39 +#define OPACITY_13 34 +#define OPACITY_10 26 +#define OPACITY_9 23 +#define OPACITY_7 18 +#define OPACITY_5 13 +#define OPACITY_0 0 + +#define TEXT_NORMAL_FONT "SamsungOneUI_300" +#define TEXT_FOCUSED_MAIN_FONT "SamsungOneUI_600" +#define TEXT_SELECTED_FONT "SamsungOneUI_300" +#define TEXT_SELECTED_FOCUSED_FONT "SamsungOneUI_600" +#define TEXT_DIMMED_FONT "SamsungOneUI_300" + +#define RESOLUTION_W 1920 +#define RESOLUTION_H 1080 + +#define SCROLL_PAD_WIDTH (0.052084*RESOLUTION_W) +#define LT_PADDING (0.018225*RESOLUTION_W) +#define LT_PADDING_2 (0.020833*RESOLUTION_W) +#define RT_PADDING (0.018225*RESOLUTION_W) +#define RT_PADDING_2 (0.010416*RESOLUTION_W) +#define MD_PADDING (0.026042*RESOLUTION_W) + + +#define GENLIST_ITEM_HT (0.074075*RESOLUTION_H) +#define GENLIST_TEXT_HT (0.055556*RESOLUTION_H) +#define ICON_WD (0.019792*RESOLUTION_W) +#define ICON_HT (0.035186*RESOLUTION_H) + +color_classes { + color_class { name: "TEXT_NORMAL_MAIN_B"; + color: 0 0 0 OPACITY_100; + color2: 0 0 0 OPACITY_40; + } + color_class { name: "TEXT_FOCUSED_MAIN_B"; + color: WHITE_COLOR OPACITY_100; + color2: WHITE_COLOR OPACITY_40; + } + color_class { name: "TEXT_SELECTED_B"; + color: 62 174 254 OPACITY_100; + color2: 62 174 254 OPACITY_40; + } + color_class { name: "TEXT_SELECTED_FOCUSED_B"; + color: 62 174 254 OPACITY_100; + color2: 62 174 254 OPACITY_40; + } + color_class { name: "TEXT_DIMMED_B"; + color: WHITE_COLOR OPACITY_20; + color2: WHITE_COLOR OPACITY_9; + } + color_class { name: "FOCUS_LAYER_COLOR_B"; + color: 255 255 255 OPACITY_10; + } + color_class { name: "LIST_NORMAL_B"; + color: 37 37 37 OPACITY_0; + } + color_class { name: "LIST_DIMMED_B"; + color: 21 21 21 OPACITY_0; + } + color_class { name: "WHITE_OPACITY_0"; + color: WHITE_COLOR OPACITY_0; + } + color_class { name: "WHITE_OPACITY_100"; + color: WHITE_COLOR OPACITY_100; + } +} +collections { + + +group { name: "elm/scroll/base/styleA"; + alias: "elm/scroller/base/styleA"; + alias: "elm/list/base/styleA"; + alias: "elm/genlist/base/styleA"; + alias: "elm/scroll/base/arrow"; + alias: "elm/list/base/arrow"; + alias: "elm/genlist/base/arrow"; + + images.image: "obe_list_scroll_up.png" COMP; + images.image: "obe_list_scroll_up_f.png" COMP; + images.image: "obe_list_scroll_down.png" COMP; + images.image: "obe_list_scroll_down_f.png" COMP; + + data.item: "focus_highlight" "on"; + + parts { + + part { name: "sb_vbar_show"; type: RECT; + scale: 1; + description { state: "default" 0.0; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + + part { name: "sb_vbar"; type: RECT; + scale: 1; + description { state: "default" 0.0; + fixed: 1 0; + min: (0.007813*RESOLUTION_W) (0.00185*RESOLUTION_H); + align: 0.0 0.0; + rel1.to_x: "arrow_right"; + rel2.relative: 1.0 0.0; + rel2.to_y: "sb_hbar"; + visible: 0; + } + } + + part { name: "sb_vbar_base"; type: RECT; + scale: 1; + clip_to: "sb_vbar"; + description { state: "default" 0.0; + visible: 0; + rel1.relative: 0.0 1.0; + rel1.to: "sb_vbar_a1"; + rel2.relative: 1.0 0.0; + rel2.to: "sb_vbar_a2"; + } + } + + part { name: "elm.dragable.vbar"; type: RECT; + clip_to: "sb_vbar"; + scale: 1; + dragable.x: 0 0 0; + dragable.y: 1 1 0; + dragable.confine: "sb_vbar_base"; + description { state: "default" 0.0; + fixed: 1 1; + min: (0.007813*RESOLUTION_W) (0.00185*RESOLUTION_H); + rel1.relative: 0.5 0.5; + rel1.to: "sb_vbar_base"; + rel2.relative: 0.5 0.5; + rel2.to: "sb_vbar_base"; + visible: 0; + color:255 0 0 128; + } + } + + part { name: "sb_vbar_a1"; type: RECT; + scale: 1; + clip_to: "sb_vbar"; + description { state: "default" 0.0; + fixed: 1 1; + min: (0.007813*RESOLUTION_W) (0.013889*RESOLUTION_H); + align: 0.5 0.0; + aspect: 1.0 1.0; aspect_preference: HORIZONTAL; + visible: 0; + rel1.to: "sb_vbar"; + rel2.to: "sb_vbar"; + rel2.relative: 1.0 0.0; + color:0 255 255 128; + } + } + + part { name: "sb_vbar_a2"; type: RECT; + scale: 1; + clip_to: "sb_vbar"; + description { state: "default" 0.0; + fixed: 1 1; + min: (0.007813*RESOLUTION_W) (0.013889*RESOLUTION_H); + align: 0.5 1.0; + aspect: 1.0 1.0; aspect_preference: HORIZONTAL; + visible: 0; + rel1.to: "sb_vbar"; + rel1.relative: 0.0 1.0; + rel2.to: "sb_vbar"; + color:0 255 255 128; + } + } + + part { name: "sb_hbar_show"; type: RECT; + scale: 1; + description { state: "default" 0.0; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + + part { name: "sb_hbar"; type: RECT; mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + fixed: 0 1; + min: 1 0; + align: 0.0 1.0; + rel1.to_y: "arrow_down"; + rel2.relative: 0.0 1.0; + rel2.to_x: "arrow_right"; + rel2.to_y: "arrow_down"; + rel2.relative: 0.0 0.0; + visible: 0; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + min: 0 0; + max: 999 0; + } + } + + part { name: "clipper"; type: RECT; + description { state: "default" 0.0; + rel1.to: "elm.swallow.background"; + rel2.to: "elm.swallow.background"; + color:255 255 255 255; + visible:1; + } + } + + part { name: "elm.swallow.background"; type: SWALLOW; + scale: 1; + clip_to: "clipper"; + description { state: "default" 0.0; + rel1.to: "arrow_up.background"; + rel1.relative: 0.0 1.0; + rel2.relative: 1.0 0.0; + rel2.to: "arrow_down.background"; + } + } + + part { name: "elm.swallow.content"; type: SWALLOW; + clip_to: "clipper"; + scale: 1; + description { state: "default" 0.0; + rel1.to:"elm.swallow.background"; + rel2.to:"elm.swallow.background"; + } + } + + part { name: "elm.swallow.overlay"; type: SWALLOW; + clip_to: "clipper"; + description { state: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel2.to: "elm.swallow.content"; + } + } + + part { name: "runner_vbar"; type: RECT; mouse_events: 0; + scale: 1; + clip_to: "sb_vbar_show"; + description { state: "default" 0.0; + rel1.to: "sb_vbar_base"; + rel2.to: "sb_vbar_base"; + min: (0.001563*RESOLUTION_W) (0.0037*RESOLUTION_H); + max: (0.001563*RESOLUTION_W) -1; + visible: 1; + color:255 255 255 128; + } + } + + part { name: "runner_vbar_clip"; type: RECT; + scale: 1; + clip_to: "sb_vbar_show"; + description { state: "default" 0.0; + min: 1 1; + max: 1 999; + rel1.to: "runner_vbar"; + rel2.to: "runner_vbar"; + visible: 0; + color:0 255 255 128; + } + } + + part { name: "elm.padding.arrow_up_spacer"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + min: 0 0; + max: -1 0; + fixed: 0 1; + align: 0.5 0.0; + } + } + part { name: "elm.padding.arrow_left_spacer"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + min: 0 0; + max: 0 -1; + fixed: 1 0; + rel1.to_y: "arrow_up"; + rel1.relative: 0.0 1.0; + rel2.to_y: "arrow_down"; + rel2.relative: 0.0 0.0; + align: 0.0 0.5; + } + } + part { name: "elm.padding.arrow_right_spacer"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + min: 0 0; + max: 0 -1; + fixed: 0 1; + rel1.to_y: "elm.padding.arrow_left_spacer"; + rel2.to_y: "elm.padding.arrow_left_spacer"; + align: 1.0 0.5; + } + } + + part { name: "arrow_right"; type: RECT; + clip_to: "sb_hbar_show"; + scale: 1; + description { state: "default" 0.0; + rel1.to: "elm.padding.arrow_right_spacer"; + rel2.to: "elm.padding.arrow_right_spacer"; + rel2.relative: 0.0 1.0; + align: 1.0 0.5; + } + } + + part { name: "arrow_up.background"; type: RECT; + clip_to: "sb_vbar_show"; + scale: 1; + description { state: "default" 0.0; + rel1.to: "elm.padding.arrow_up_spacer"; + rel1.relative: 0.0 1.0; + rel2.to: "sb_vbar_show"; + align: 0.5 0.0; + FIXED_SIZE((0.38021*RESOLUTION_W), (0.05 *RESOLUTION_H)) + visible:0; + } + } + + part { name: "arrow_up"; type: IMAGE; + clip_to: "sb_vbar_show"; + scale: 1; + description { state: "default" 0.0; + rel1.to:"arrow_up.background"; + rel2.to:"arrow_up.background"; + image.normal: "obe_list_scroll_up.png"; + color:255 255 255 127; + } + description { state: "over" 0.0; + inherit: "default" 0.0; + image.normal: "obe_list_scroll_up_f.png"; + color:255 255 255 255; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "obe_list_scroll_up.png"; + color:255 255 255 76; + } + description { state: "invisible" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + + + part { name: "elm.padding.arrow_down_spacer"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + min: 0 0; + max: -1 0; + fixed: 0 1; + align: 0.5 1.0; + } + } + + + part { name: "arrow_down.background"; type: RECT; + clip_to: "sb_vbar_show"; + scale: 1; + description { state: "default" 0.0; + rel1.to: "elm.padding.arrow_down_spacer"; + rel2.to: "elm.padding.arrow_down_spacer"; + rel2.relative: 1.0 0.0; + align: 0.5 1.0; + visible:0; + FIXED_SIZE((0.38021*RESOLUTION_W), (0.05 *RESOLUTION_H)) + } + } + + part {name: "arrow_down"; type: IMAGE; + clip_to: "sb_vbar_show"; + scale: 1; + description { state: "default" 0.0; + rel1.to: "arrow_down.background"; + rel2.to: "arrow_down.background"; + image.normal: "obe_list_scroll_down.png"; + color:255 255 255 127; + } + description { state: "over" 0.0; + inherit: "default" 0.0; + image.normal: "obe_list_scroll_down_f.png"; + color:255 255 255 255; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "obe_list_scroll_down.png"; + color:255 255 255 76; + } + description { state: "invisible" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + + part {name: "runner_glow_vbar"; type: RECT; mouse_events: 0; + scale: 1; + clip_to: "runner_vbar_clip"; + description { state: "default" 0.0; + rel1.to_x: "runner_vbar_clip"; + rel1.to_y: "base_vbar"; + rel2.to_x: "runner_vbar_clip"; + rel2.to_y: "base_vbar"; + visible: 0; + } + } + + part {name: "base_vbar"; type: RECT; mouse_events: 0; + scale: 1; + clip_to: "sb_vbar_show"; + description { state: "default" 0.0; + rel1.to: "elm.dragable.vbar"; + rel2.to: "elm.dragable.vbar"; + fixed: 1 1; + visible: 0; + } + } + + part {name: "bevel_vbar"; type: RECT; mouse_events: 0; + scale: 1; + clip_to: "sb_vbar_show"; + description { state: "default" 0.0; + min: (0.0026*RESOLUTION_W) (0.0046296*RESOLUTION_H); + visible: 0; + } + } + } + + programs { + program { + signal: "load"; source: ""; + action: STATE_SET "hidden" 0.0; + target: "sb_vbar"; + target: "sb_vbar_show"; + } + + program { + signal: "elm,action,show,vbar"; source: "elm"; + action: STATE_SET "default" 0.0; + target: "sb_vbar"; + target: "sb_vbar_show"; + } + + program { + signal: "elm,action,hide,vbar"; source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "sb_vbar"; + target: "sb_vbar_show"; + } + + program { + signal: "mouse,down,1*"; source: "arrow_up"; + action: STATE_SET "clicked" 0.0; + target: "sb_vbar_a1"; + target: "arrow_up"; + after: "up_fade"; + after: "mouse_click_up_arrow"; + } + + program { name: "up_fade"; + source: ""; + action: STATE_SET "default" 0.0; + target: "sb_vbar_a1"; + transition: LINEAR 1; + target: "arrow_up"; + } + + program { + signal: "mouse,down,1*"; source: "arrow_up"; + action: DRAG_VAL_STEP 0.0 -1.0; + target: "elm.dragable.vbar"; + } + + program { + signal: "mouse,up,1"; source: "arrow_up"; + action: STATE_SET "default" 0.0; + target: "sb_vbar_a1"; + target: "arrow_up"; + after: "sound_on_select"; + } + + program { name: "sound_on_select"; + action: RUN_PLUGIN "select"; + } + + program { + signal: "mouse,down,1*"; source: "arrow_down"; + action: STATE_SET "clicked" 0.0; + target: "sb_vbar_a2"; + target: "arrow_down"; + after: "down_fade"; + after: "mouse_click_down_arrow"; + } + + program { name: "down_fade"; + source: ""; + action: STATE_SET "default" 0.0; + target: "sb_vbar_a2"; + transition: LINEAR 1; + target: "arrow_down"; + } + + program { + signal: "mouse,down,1*"; source: "arrow_down"; + action: DRAG_VAL_STEP 0.0 1.0; + target: "elm.dragable.vbar"; + } + + program { + signal: "mouse,up,1"; source: "arrow_down"; + action: STATE_SET "default" 0.0; + target: "sb_vbar_a2"; + target: "arrow_down"; + after: "sound_on_select"; + } + + program { + signal: "mouse,down,1*"; source: "sb_vbar_p1"; + action: DRAG_VAL_PAGE 0.0 -1.0; + target: "elm.dragable.vbar"; + } + + program { + signal: "mouse,down,1*"; source: "sb_vbar_p2"; + action: DRAG_VAL_PAGE 0.0 1.0; + target: "elm.dragable.vbar"; + } + program { name: "sound_on_focus"; + action: RUN_PLUGIN "focus"; + } + program { + signal: "elm,scroll,arrow_up,hide"; source: "elm"; + action: STATE_SET "invisible" 0.0; + target: "arrow_up"; + } + // == use this signal "elm,scroll,arrow_up,show" if you need to show the up_ARROW + program { + signal: "elm,scroll,arrow_up,show"; source: "elm"; + action: STATE_SET "default" 0.0; + target: "arrow_up"; + } + // == use this signal "elm,scroll,arrow_down,hide" if you need to hide the down_ARROW + program { + signal: "elm,scroll,arrow_down,hide"; source: "elm"; + action: STATE_SET "invisible" 0.0; + target: "arrow_down"; + } + // == use this signal "elm,scroll,arrow_down,show" if you need to show the down_ARROW + program { + signal: "elm,scroll,arrow_down,show"; source: "elm"; + action: STATE_SET "default" 0.0;; + target: "arrow_down"; + } + + program { + signal: "elm,action,looping,left"; source: "elm"; + action: STATE_SET "effect_right" 0.0; + transition: LINEAR 0.3; + target: "elm.swallow.content"; + after: "looping,left,done"; + } + + program { name: "looping,left,done"; + action: SIGNAL_EMIT "elm,looping,left,done" "elm"; + } + + program { + signal: "elm,action,looping,left,end"; source: "elm"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.3; + target: "elm.swallow.content"; + after: "looping,left,end"; + } + + program { name: "looping,left,end"; + action: SIGNAL_EMIT "elm,looping,left,end" "elm"; + } + + program { + signal: "elm,action,looping,right"; source: "elm"; + action: STATE_SET "effect_left" 0.0; + transition: LINEAR 0.3; + target: "elm.swallow.content"; + after: "looping,right,done"; + } + + program { name: "looping,right,done"; + action: SIGNAL_EMIT "elm,looping,right,done" "elm"; + } + + program { + signal: "elm,action,looping,right,end"; source: "elm"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.3; + target: "elm.swallow.content"; + after: "looping,right,end"; + } + + program { name: "looping,right,end"; + action: SIGNAL_EMIT "elm,looping,right,end" "elm"; + } + + program { + signal: "elm,action,looping,up"; source: "elm"; + action: STATE_SET "effect_down" 0.0; + transition: LINEAR 0.2; + target: "elm.swallow.content"; + after: "looping,up,next"; + } + + program { name: "looping,up,next"; + action: STATE_SET "effect_up" 0.0; + target: "elm.swallow.content"; + after: "looping,up,done"; + } + + program { name: "looping,up,done"; + action: SIGNAL_EMIT "elm,looping,up,done" "elm"; + } + + program { + signal: "elm,action,looping,up,end"; source: "elm"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.2; + target: "elm.swallow.content"; + after: "looping,up,end"; + } + + program { name: "looping,up,end"; + action: SIGNAL_EMIT "elm,looping,up,end" "elm"; + } + + program { + signal: "elm,action,looping,down"; source: "elm"; + action: STATE_SET "effect_up" 0.0; + transition: LINEAR 0.2; + target: "elm.swallow.content"; + after: "looping,down,next"; + } + + program { name: "looping,down,next"; + action: STATE_SET "effect_down" 0.0; + target: "elm.swallow.content"; + after: "looping,down,done"; + } + + program { name: "looping,down,done"; + action: SIGNAL_EMIT "elm,looping,down,done" "elm"; + } + + program { + signal: "elm,action,looping,down,end"; source: "elm"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.2; + target: "elm.swallow.content"; + after: "looping,down,end"; + } + + program { name: "looping,down,end"; + action: SIGNAL_EMIT "elm,looping,down,end" "elm"; + } + program { name: "mouse_click_down_arrow"; + action: SIGNAL_EMIT "mouse,click,down,arrow" ""; + } + + program { name: "mouse_click_up_arrow"; + action: SIGNAL_EMIT "mouse,click,up,arrow" ""; + } + + program { name: "up_over_show"; + signal: "mouse,in"; source: arrow_up; + action: STATE_SET "over" 0.0; + target: arrow_up; + after: "sound_on_focus"; + after:"mouse_in_up"; + } + program { name: "down_over_show"; + signal: "mouse,in"; source: arrow_down; + action: STATE_SET "over" 0.0; + target: arrow_down; + after: "sound_on_focus"; + after:"mouse_in_down"; + } + + program { name: "up_over_hide"; + signal: "mouse,out"; source: arrow_up; + action: STATE_SET "default" 0.0; + target: arrow_up; + after:"mouse_out_up"; + } + + program { name: "down_over_hide"; + signal: "mouse,out"; source: arrow_down; + action: STATE_SET "default" 0.0; + target: arrow_down; + after:"mouse_out_down"; + } + + program { name: "mouse_in_down"; + action: SIGNAL_EMIT "mouse,in,down,arrow" ""; + } + + program { name: "mouse_out_down"; + action: SIGNAL_EMIT "mouse,out,down,arrow" ""; + } + program { name: "mouse_in_up"; + action: SIGNAL_EMIT "mouse,in,up,arrow" ""; + } + + program { name: "mouse_out_up"; + action: SIGNAL_EMIT "mouse,out,up,arrow" ""; + } + } +} + + group { name: "elm/genlist/item/APP_STYLE/default"; + images { + image: "highlight_stroke.png" COMP; + } + data.item: "texts" "elm.text"; + script { + public isSelected = 0; + public isDimmed = 0; + public isFocused = 0; + public curVer; + + public g_duration = 0, g_stopslide = 1, g_timer_id, g_anim_id, g_is_rtl; + + public slide_to_end_anim(val, Float:pos) { + new stopflag; + new id; + stopflag = get_int(g_stopslide); + if (stopflag == 1) return; + + new Float:vl = get_float(curVer); + + if(get_int(isSelected)) { + set_tween_state(PART:"elm.text", pos, "selected_slide_begin", vl, "selected_slide_end", vl); + set_state(PART:"elm.text.loopback", "selected_focused", vl); + } else { + set_tween_state(PART:"elm.text", pos, "slide_begin", vl, "slide_end", vl); + set_state(PART:"elm.text.loopback", "focused", vl); + } + + if (pos >= 1.0) { + id = timer(0.0, "slide_to_begin", 1); + } + set_int(g_timer_id, id); + } + + public slide_to_end() { + new stopflag; + new id; + new Float:duration; + stopflag = get_int(g_stopslide); + if (stopflag == 1) + return; + + duration = get_float(g_duration); + id = anim(duration, "slide_to_end_anim", 1); + set_int(g_anim_id, id); + } + + public slide_to_begin() { + new stopflag; + new id; + stopflag = get_int(g_stopslide); + if (stopflag == 1) + return; + + new Float:vl = get_float(curVer); + + if(get_int(isSelected)) { + set_state(PART:"elm.text", "selected_slide_begin", vl); + } else { + set_state(PART:"elm.text", "slide_begin", vl); + } + id = timer(0.0, "slide_to_end", 1); + set_int(g_timer_id, id); + } + + public start_slide() { + new id; + set_int(g_stopslide, 1); + id = get_int(g_anim_id); + cancel_anim(id); + id = get_int(g_timer_id); + cancel_timer(id); + + new x, y, w, h; + set_int(g_stopslide, 0); + SetDuration(); + get_geometry(PART:"space_at_right", x, y, w, h) + if(w > (DO_NOT_SCROLL_IF_SPACE_IS_MORE_THAN_THIS_VALUE)) + return; + + new Float:vl = get_float(curVer); + + if(get_int(isSelected)) { + if( get_int( g_is_rtl ) == 1 ) { + set_state(PART:"elm.text", "selected_slide_end", vl); + } else { + set_state(PART:"elm.text", "selected_slide_begin", vl); + } + set_state(PART:"elm.text.loopback", "selected_focused", vl); + } else { + if( get_int( g_is_rtl ) == 1 ) { + set_state(PART:"elm.text", "slide_end", vl); + } else { + set_state(PART:"elm.text", "slide_begin", vl); + } + set_state(PART:"elm.text.loopback", "focused", vl); + } + + slide_to_end(); + } + + public stop_slide() { + new id; + set_int(g_stopslide, 1); + id = get_int(g_anim_id); + cancel_anim(id); + id = get_int(g_timer_id); + cancel_timer(id); + } + + public SetDuration() { + new x, y, w, h; + get_geometry(PART:"text.size.estimate", x, y, w, h); + new Float:t = w / SPEED; + set_float(g_duration, t); + } + + } + + parts { + + part { name: "base"; type: RECT; + scale: 1; + repeat_events: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + min: 0 GENLIST_ITEM_HT; + color_class: "LIST_NORMAL_B"; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + } + description { state: "dimmed" 0.0; + inherit: "default" 0.0; + color_class: "LIST_DIMMED_B"; + } + } + + part { name: "focus_layer"; type: RECT; + scale: 1; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + color_class : "WHITE_OPACITY_0"; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + color_class : "FOCUS_LAYER_COLOR_B"; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + } + description { state: "dimmed" 0.0; + inherit: "default" 0.0; + } + } + + part { name: "clip_rect"; type: RECT; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + min: 1 GENLIST_TEXT_HT; + max: -1 GENLIST_TEXT_HT; + align: 0.0 0.5; + rel1.to: "pad.text_left"; + rel1.relative: 1.0 0.0; + rel2.to: "pad.text_right"; + rel2.relative: 0.0 1.0; + } + } + + part { name: "pad.text_left"; type: SPACER; mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + align: 0.0 0.0; + min: (0.020833*RESOLUTION_W) GENLIST_ITEM_HT; + max: (0.020833*RESOLUTION_W) GENLIST_ITEM_HT; + } + } + + part { name: "pad.text_right"; type: SPACER; mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + align: 1.0 0.0; + min: (0.020833*RESOLUTION_W) GENLIST_ITEM_HT; + max: (0.020833*RESOLUTION_W) GENLIST_ITEM_HT; + } + } + + part { name: "elm.text"; type: TEXT; mouse_events: 0; + ignore_flags: ON_HOLD; + scale: 1; + clip_to: "clip_rect"; + effect: OUTLINE; + description { state: "default" 0.0; + min: 1 GENLIST_TEXT_HT; + max: -1 GENLIST_TEXT_HT; + align: 0.0 0.5; + rel1.to: "pad.text_left"; + rel1.relative: 1.0 0.0; + rel2.to: "pad.text_right"; + rel2.relative: 0.0 1.0; + color_class: "TEXT_NORMAL_MAIN_B"; + text { + font: TEXT_NORMAL_FONT; + size: LIST_FONT_SIZE; + align: 0.5 0.5; + min: 0 1; + } + } + description { state: "default.rtl" 0.0; + inherit: "default" 0.0; + text.ellipsis: 1; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + color_class: "TEXT_FOCUSED_MAIN_B"; + text.font: TEXT_FOCUSED_MAIN_FONT; + } + description { state: "focused.rtl" 0.0; + inherit: "focused" 0.0; + text.ellipsis: 1; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color_class: "TEXT_SELECTED_B"; + text.font: TEXT_SELECTED_FONT; + } + description { state: "selected.rtl" 0.0; + inherit: "selected" 0.0; + text.ellipsis: 1; + } + description { state: "selected_focused" 0.0; + inherit: "default" 0.0; + color_class: "TEXT_SELECTED_FOCUSED_B"; + text.font: TEXT_SELECTED_FOCUSED_FONT; + } + description { state: "selected_focused.rtl" 0.0; + inherit: "selected_focused" 0.0; + text.ellipsis: 1; + } + description { state: "dimmed" 0.0; + inherit: "default" 0.0; + color_class: "TEXT_DIMMED_B"; + text.font: TEXT_DIMMED_FONT; + } + description { state: "dimmed.rtl" 0.0; + inherit: "dimmed" 0.0; + text.ellipsis: 1; + } + description { state: "slide_begin" 0.0; + inherit: "focused" 0.0; + rel1.to_x: "elm.pad0.50px"; + rel1.to_y: "base"; + rel1.relative: 1.0 0.0; + rel2.to_y: "base"; + rel2.relative: 0.0 1.0; + align: 0.0 0.5; + text.align: 0.0 0.5; + text.min: 1 1; + text.ellipsis: -1; + text.text_class: "sublist_text_icon_foc_b"; + } + description { state: "selected_slide_begin" 0.0; + inherit: "selected_focused" 0.0; + rel1.to_x: "elm.pad0.50px"; + rel1.to_y: "base"; + rel1.relative: 1.0 0.0; + rel2.to_y: "base"; + rel2.relative: 0.0 1.0; + align: 0.0 0.5; + text.min: 1 1; + text.ellipsis: -1; + text.text_class: "sublist_text_icon_sel_foc_b"; + } + description { state: "slide_end" 0.0; + inherit: "slide_begin" 0.0; + rel2.to_x: "elm.pad0.50px"; + rel2.to_y: "base"; + rel2.relative: 0.0 1.0; + rel2.to_y: "base"; + rel2.relative: 0.0 1.0; + align: 1.0 0.5; + text.text_class: "sublist_text_icon_foc_b"; + } + description { state: "selected_slide_end" 0.0; + inherit: "selected_slide_begin" 0.0; + rel2.to_x: "elm.pad0.50px"; + rel2.to_y: "base"; + rel2.relative: 0.0 1.0; + rel2.to_y: "base"; + rel2.relative: 0.0 1.0; + align: 1.0 0.5; + text.text_class: "sublist_text_icon_sel_foc_b"; + } + } + + part { name: "focus_image_clipper"; type: RECT; + scale: 1; + description { state: "default" 0.0; + fixed: 0 1; + rel1.to: "base"; + rel2.to: "base"; + color_class : "WHITE_OPACITY_0"; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + color_class : "WHITE_OPACITY_100"; + } + } + + part { name: "bg"; type: IMAGE; + scale: 1; + clip_to: "focus_image_clipper"; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + image { + normal: "highlight_stroke.png"; + border: FOCUS_HIGHLIGHT_BORDER; + border_scale: 1; + middle: 0; + } + } + } + + part { name: "elm.pad0.50px"; type: SPACER; mouse_events: 0; repeat_events: 1; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + min: SCROLL_PAD_WIDTH GENLIST_ITEM_HT; + max: SCROLL_PAD_WIDTH GENLIST_ITEM_HT; + rel1.to: "pad.text_left"; + rel1.relative: 1.0 0.0; + rel2.to: "pad.text_left"; + rel2.relative: 1.0 1.0; + align: 1.0 0.5; + } + } + + part { name: "elm.pad1.50px"; type: SPACER; mouse_events: 0; repeat_events: 1; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + min: SCROLL_PAD_WIDTH GENLIST_ITEM_HT; + max: SCROLL_PAD_WIDTH GENLIST_ITEM_HT; + rel1.to_x: "elm.text"; + rel1.to_y: "base"; + rel1.relative: 1.0 0.0; + rel2.to_y: "base"; + rel2.relative: 0.0 1.0; + align: 0.0 0.5; + } + } + + part { name: "elm.text.loopback"; type: TEXT; mouse_events: 0; + scale: 1; + clip_to: "clip_rect"; + ignore_flags: ON_HOLD; + effect: OUTLINE; + description { state: "default" 0.0; + fixed: 1 1; + align: 0.0 0.5; + rel1.to_x: "elm.pad1.50px"; + rel1.to_y: "base"; + rel1.relative: 1.0 0.0; + rel2.to_x: "elm.pad1.50px"; + rel2.to_y: "base"; + rel2.relative: 1.0 1.0; + visible: 0; + color_class: "TEXT_FOCUSED_MAIN_B"; + text { + text_source: "elm.text"; + source: "elm.text"; + min: 1 1; + font: TEXT_FOCUSED_MAIN_FONT; + size: LIST_FONT_SIZE; + align: -1 0.5; + ellipsis: -1; + } + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "selected_focused" 0.0; + inherit: "default" 0.0; + visible: 1; + color_class: "TEXT_SELECTED_FOCUSED_B"; + text.font: TEXT_SELECTED_FOCUSED_FONT; + } + } + + part { name: "text.size.estimate"; type: TEXT; mouse_events: 0; + scale: 1; + clip_to: "clip_rect"; + description { state: "default" 0.0; + fixed: 1 1; + rel1.to: "pad.text_left"; + rel1.relative: 1.0 0.0; + align: 0.0 0.0; + visible: 0; + text { + text_source: "elm.text"; + source: "elm.text"; + min: 1 1; + align: 0.0 0.5; + font: TEXT_FOCUSED_MAIN_FONT; + size : LIST_FONT_SIZE; + ellipsis: -1; + } + color_class : "TEXT_FOCUSED_MAIN_B"; + } + } + + part { name: "space_at_right"; type: SPACER; mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + rel1.to_x: "text.size.estimate"; + rel1.to_y: "base"; + rel1.relative: 1.0 0.0; + rel2.to: "pad.text_right"; + rel2.relative: 0.0 1.0; + align: 0.0 0.0; + } + } + } + + programs { + + program { name: "init"; + signal: "load"; + script { + set_int(isSelected, 0); + set_int(isDimmed, 0); + set_int(isFocused, 0); + set_float(curVer, 0); + } + after: "set_states"; + } + + program { name: "anim_focus"; + action: STATE_SET "focused" 0.0; + target: "focus_layer"; + target: "focus_image_clipper"; + transition: CUBIC_BEZIER 0.334 BASIC_CURVE; + } + + program { name: "anim_unfocus"; + action: STATE_SET "default" 0.0; + target: "focus_layer"; + target: "focus_image_clipper"; + transition: CUBIC_BEZIER 0.334 BASIC_CURVE; + } + + program { name: "set_states"; + script { + new Float:vl = get_float(curVer); + if(get_int(isFocused) == 1) { + set_state(PART:"base", "focused", vl); + run_program(PROGRAM:"anim_focus"); + } else if(get_int(isDimmed) == 1) { + set_state(PART:"base", "dimmed", vl); + run_program(PROGRAM:"anim_unfocus"); + } else if(get_int(isSelected) == 1) { + set_state(PART:"base", "selected", vl); + run_program(PROGRAM:"anim_unfocus"); + } else { + set_state(PART:"base", "default", vl); + run_program(PROGRAM:"anim_unfocus"); + } + + if(get_int(isDimmed) == 1) + { + set_state(PART:"elm.text.loopback", "default", vl); + + if(get_int(g_is_rtl) == 1) + set_state(PART:"elm.text", "dimmed.rtl", vl); + else + set_state(PART:"elm.text", "dimmed", vl); + } + else if( (get_int(isSelected) == 1) && (get_int(isFocused) == 1) ) + { + set_state(PART:"elm.text.loopback", "selected_focused", vl); + + if(get_int(g_is_rtl) == 1) + set_state(PART:"elm.text", "selected_focused.rtl", vl); + else + set_state(PART:"elm.text", "selected_focused", vl); + + } + else if(get_int(isFocused) == 1) + { + set_state(PART:"elm.text.loopback", "focused", vl); + + if(get_int(g_is_rtl) == 1) + set_state(PART:"elm.text", "focused.rtl", vl); + else + set_state(PART:"elm.text", "focused", vl); + } + else if(get_int(isSelected) == 1) + { + set_state(PART:"elm.text.loopback", "default", vl); + + if(get_int(g_is_rtl) == 1) + set_state(PART:"elm.text", "selected.rtl", vl); + else + set_state(PART:"elm.text", "selected", vl); + } + else + { + set_state(PART:"elm.text.loopback", "default", vl); + + if(get_int(g_is_rtl) == 1) + set_state(PART:"elm.text", "default.rtl", vl); + else + set_state(PART:"elm.text", "default", vl); + } + + } + } + + program { name: "to_rtl"; + signal: "edje,state,rtl"; source: "edje"; + script { + set_int( g_is_rtl , 1 ); + } + } + + program { name: "to_ltr"; + signal: "edje,state,ltr"; source: "edje"; + script { + set_int( g_is_rtl , 0 ); + } + } + + program { name: "start_slide_signal"; + signal: "text,slide,start"; source: ""; + in: 0.5 0.0; + script { + if(get_int(isFocused) == 1) { + start_slide(); + } + } + } + + program { name: "stop_slide_signal"; + signal: "text,slide,stop"; source: ""; + script { + stop_slide(); + } + } + + program { name: "default_common"; + signal: "elm,state,default"; source: "elm"; + script { + set_int(isFocused, 0); + } + after: "set_states"; + } + + program { name: "focus_common"; + signal: "elm,state,focused"; source: "elm"; + script { + set_int(isFocused, 1); + if(get_int(isDimmed) == 1) { + run_program(PROGRAM:"set_states"); + } else { + run_program(PROGRAM:"text_focus"); + } + } + } + + program { name: "sound_on_focus"; + signal: "elm,action,focused,sound"; source: "elm"; + action: RUN_PLUGIN "focus"; + } + + program { name: "sound_on_select"; + signal: "elm,action,selected,sound"; source: "elm"; + action: RUN_PLUGIN "select"; + } + + program { name: "sound_on_hold"; + signal: "elm,action,longpressed,sound"; source: "elm"; + action: RUN_PLUGIN "hold"; + } + + program { name: "unfocus_common"; + signal: "elm,state,unfocused"; source: "elm"; + script { + set_int(isFocused, 0); + if(get_int(isDimmed) == 1) { + run_program(PROGRAM:"set_states"); + } else { + run_program(PROGRAM:"stop_slide"); + } + } + } + + program { name: "selected_common"; + signal: "elm,state,selected"; source: "elm"; + script { + if(get_int(isDimmed) == 0) { + set_int(isSelected, 1); + } + } + after: "set_states"; + } + + program { name: "unselected_common"; + signal: "elm,state,unselected"; source: "elm"; + script { + set_int(isSelected, 0); + } + after: "set_states"; + } + + program { name: "text_focus"; + after: "start_slide"; + } + + program { name: "start_slide"; + script { + run_program(PROGRAM:"set_states"); + emit("text,slide,start", ""); + } + } + + program { name: "stop_slide"; + script { + emit("text,slide,stop", ""); + } + after: "set_states"; + } + + program { name: "enable"; + signal: "elm,state,enabled"; source: "elm"; + script { + set_int(isDimmed, 0); + } + after: "set_states"; + } + + program { name: "disable"; + signal: "elm,state,disabled"; source: "elm"; + script { + set_int(isDimmed, 1); + } + after: "set_states"; + } + + program { name: "undimmed"; + signal: "elm,state,undimmed"; source: "elm"; + script { + set_int(isDimmed, 0); + } + after: "set_states"; + } + + program { name: "dimmed"; + signal: "elm,state,dimmed"; source: "elm"; + script { + set_int(isDimmed, 1); + } + after: "set_states"; + } + } + } + group { name: "elm/picker"; + images { + image: "I01_picker_panel_bg.png" COMP; + image: "I01_picker_btn_02_normal.png" COMP; + image: "I01_picker_btn_02_press.png" COMP; + image: "I01_picker_btn_normal.png" COMP; + image: "I01_picker_arrow_left.png" COMP; + image: "I01_picker_arrow_right.png" COMP; + } + parts { + part { name: "bg"; + type: SWALLOW; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + rel1 { relative: 0.0 1.0; } + rel2 { relative: 1.0 1.0; } + } + description { state: "show" 0.0; + inherit: "default" 0.0; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0; offset: 0 2; } + } + description { state: "imf_panel" 0.0; + inherit: "show" 0.0; + visible: 0; + } + } + part { name: "elm.image.panel"; + type: IMAGE; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + min: 0 43; + fixed: 0 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "bg"; } + rel2 { relative: 1.0 0.0; to: "bg"; } + image.normal: "I01_picker_panel_bg.png"; + } + description { state: "show" 0.0; + inherit: "default" 0.0; + } + description { state: "imf_panel" 0.0; + inherit: "default" 0.0; + align: 0.0 1.0; + rel1 { relative: 0.0 1.0; to: "bg"; offset: 0 2; } + rel2 { relative: 1.0 1.0; to: "bg"; offset: 0 2; } + } + } + part { name: "padding.prev_bg.left"; + type: RECT; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 10 0; + fixed: 1 0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "elm.image.panel"; } + rel2 { relative: 0.0 1.0; to: "elm.image.panel"; } + } + } + part { name: "elm.image.prev_bg"; + type: IMAGE; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 36 32; + max: 36 32; + fixed: 1 1; + align: 0.0 0.5; + rel1 { relative: 1.0 0.0; to_x: "padding.prev_bg.left"; to_y: "elm.image.panel"; } + rel2 { relative: 1.0 1.0; to_x: "padding.prev_bg.left"; to_y: "elm.image.panel"; } + image.normal: "I01_picker_btn_02_normal.png"; + image.border: 5 5 5 5; + } + description { state: "press" 0.0; + inherit: "default" 0.0; + visible: 1; + image.normal: "I01_picker_btn_02_press.png"; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "disable" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 150; + } + } + part { name: "elm.image.prev_arrow"; + type: IMAGE; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 16 16; + max: 16 16; + fixed: 1 1; + align: 0.5 0.5; + rel1 { relative: 0.0 0.0; to: "elm.image.prev_bg"; } + rel2 { relative: 1.0 1.0; to: "elm.image.prev_bg"; } + image.normal: "I01_picker_arrow_left.png"; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "disable" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 150; + } + } + part { name: "padding.prev_bg.right"; + type: RECT; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 16 0; + fixed: 1 0; + align: 0.0 0.0; + rel1 { relative: 1.0 0.0; to: "elm.image.prev_bg"; } + rel2 { relative: 1.0 1.0; to: "elm.image.prev_bg"; } + } + } + part { name: "elm.image.next_bg"; + type: IMAGE; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 36 32; + max: 36 32; + fixed: 1 1; + align: 0.0 0.5; + rel1 { relative: 1.0 0.0; to_x: "padding.prev_bg.right"; to_y: "elm.image.panel"; } + rel2 { relative: 1.0 1.0; to_x: "padding.prev_bg.right"; to_y: "elm.image.panel"; } + image.normal: "I01_picker_btn_02_normal.png"; + image.border: 5 5 5 5; + } + description { state: "press" 0.0; + inherit: "default" 0.0; + visible: 1; + image.normal: "I01_picker_btn_02_press.png"; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "disable" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 150; + } + } + part { name: "elm.image.next_arrow"; + type: IMAGE; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 16 16; + max: 16 16; + fixed: 1 1; + align: 0.5 0.5; + rel1 { relative: 0.0 0.0; to: "elm.image.next_bg"; } + rel2 { relative: 1.0 1.0; to: "elm.image.next_bg"; } + image.normal: "I01_picker_arrow_right.png"; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "disable" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 150; + } + } + part { name: "padding.done_bg.right"; + type: RECT; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 10 0; + fixed: 1 0; + align: 1.0 0.0; + rel1 { relative: 1.0 0.0; to: "elm.image.panel"; } + rel2 { relative: 1.0 1.0; to: "elm.image.panel"; } + } + } + part { name: "elm.image.done_bg"; + type: IMAGE; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + min: 66 32; + max: 66 32; + fixed: 1 1; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to_x: "padding.done_bg.right"; to_y: "elm.image.panel"; } + rel2 { relative: 0.0 1.0; to_x: "padding.done_bg.right"; to_y: "elm.image.panel"; } + image.normal: "I01_picker_btn_02_normal.png"; + image.border: 5 5 5 5; + } + description { state: "press" 0.0; + inherit: "default" 0.0; + image.normal: "I01_picker_btn_02_press.png"; + } + } + part { name: "elm.text.done"; + type: TEXT; + repeat_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 1; + fixed: 1 1; + rel1.to: "elm.image.done_bg"; + rel2.to: "elm.image.done_bg"; + color: 255 255 255 255; + text { + font: "Tizen:style=Medium"; + size: 16; + min: 1 1; + align: 0.5 0.5; + ellipsis: -1; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + align: 0.0 0.0; + fixed: 0 1; + rel1 { relative: 0.0 1.0; to: "elm.image.panel"; } + rel2 { relative: 1.0 1.0;} + } + description { state: "show" 0.0; + inherit: "default" 0.0; + } + description { state: "imf_panel" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + } + + programs { + program { + name: "prev_button_press"; + signal: "mouse,down,1"; + source: "elm.image.prev_bg"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.image.prev_bg", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.image.prev_bg", "press", 0.0); + } + } + program { + name: "prev_button_release"; + signal: "mouse,up,1"; + source: "elm.image.prev_bg"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.image.prev_bg", st, 30, vl); + if (!strcmp(st, "press")) + set_state(PART:"elm.image.prev_bg", "visible", 0.0); + } + } + program { + name: "next_button_press"; + signal: "mouse,down,1"; + source: "elm.image.next_bg"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.image.next_bg", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.image.next_bg", "press", 0.0); + } + } + program { + name: "next_button_release"; + signal: "mouse,up,1"; + source: "elm.image.next_bg"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.image.next_bg", st, 30, vl); + if (!strcmp(st, "press")) + set_state(PART:"elm.image.next_bg", "visible", 0.0); + } + } + program { + name: "done_button_press"; + signal: "mouse,down,1"; + source: "elm.image.done_bg"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.image.done_bg", st, 30, vl); + if (!strcmp(st, "default")) + set_state(PART:"elm.image.done_bg", "press", 0.0); + } + } + program { + name: "done_button_release"; + signal: "mouse,up,1"; + source: "elm.image.done_bg"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.image.done_bg", st, 30, vl); + if (!strcmp(st, "press")) + set_state(PART:"elm.image.done_bg", "default", 0.0); + } + } + program { name: "show,picker"; + signal: "show,picker,signal"; + transition: LINEAR 0.4; + action: STATE_SET "show" 0.0; + target: "bg"; + target: "elm.image.panel"; + target: "elm.swallow.content"; + } + program { name: "show,picker_delay"; + signal: "show,picker_delay,signal"; + action: STATE_SET "show" 0.0; + in: 0.5 0.0; + target: "bg"; + target: "elm.image.panel"; + target: "elm.swallow.content"; + } + program { name: "hide,picker"; + signal: "hide,picker,signal"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "elm.image.panel"; + target: "elm.swallow.content"; + } + program { name: "show,prev_button"; + signal: "show,prev_button,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.image.prev_bg"; + target: "elm.image.prev_arrow"; + } + program { name: "hide,prev_button"; + signal: "hide,prev_button,signal"; + action: STATE_SET "default" 0.0; + target: "elm.image.prev_bg"; + target: "elm.image.prev_arrow"; + } + program { name: "enable,prev_button"; + signal: "enable,prev_button,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.image.prev_bg"; + target: "elm.image.prev_arrow"; + } + program { name: "disable,prev_button"; + signal: "disable,prev_button,signal"; + action: STATE_SET "disable" 0.0; + target: "elm.image.prev_bg"; + target: "elm.image.prev_arrow"; + } + program { name: "show,next_button"; + signal: "show,next_button,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.image.next_bg"; + target: "elm.image.next_arrow"; + } + program { name: "hide,next_button"; + signal: "hide,next_button,signal"; + action: STATE_SET "default" 0.0; + target: "elm.image.next_bg"; + target: "elm.image.next_arrow"; + } + program { name: "enable,next_button"; + signal: "enable,next_button,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.image.next_bg"; + target: "elm.image.next_arrow"; + } + program { name: "disable,next_button"; + signal: "disable,next_button,signal"; + action: STATE_SET "disable" 0.0; + target: "elm.image.next_bg"; + target: "elm.image.next_arrow"; + } + program { name: "show,imf_panel"; + signal: "show,imf_panel,signal"; + action: STATE_SET "imf_panel" 0.0; + target: "bg"; + target: "elm.image.panel"; + target: "elm.swallow.content"; + } + } + } +} diff --git a/tizen_src/ewk/efl_integration/resource/images/highlight_stroke.png b/tizen_src/ewk/efl_integration/resource/images/highlight_stroke.png new file mode 100644 index 0000000000000000000000000000000000000000..aeed88a3ed247d4c88c999e728c9f8b1d622d58a GIT binary patch literal 1134 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWuD@%xak-5hW46K32*3xq68pHF_1f1wh>l3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|8l;|;8yV;tSX!AHTNxNBK!Fm_wxX0Ys~{IQs9ivwtx`rwNr9EVetCJh zUb(Seeo?xG?WUP)qwZeFo6%mkOz;^d;tf|AVqJOz-6iAnjT zCALaHmqNUdTj1*pH#n~t8c@I>)2~P@&^OdG(9g{U`3tPNxFjeQ;S8**i$f|4QuTvU zi}Op1l7aD&rVP^z3_JW5ffNE=W95>cT$-DjSK{ens{|C$OUX>JGBI~^b~Uwdu{1F> zF*F3SoDG~D-OQYgj9e_uESz0ndOh=sOA_;vQ(<~D5qh2R>a}t%N=+=uFAB-e&w<5W zKt_H^esM;Afr7I$IJOit!ZY(y^2>`gLBR`kZE8_wS!#+~QGTuhIDD)!vADt2$kfcz z!ps!t24j%>9i1#poQw?2P0dUl9gU35m7sc4u=pLS*9@m#eV}9XL6M6T*)Sns3IZ|V zNf*e0C;rqtV2UpSChhB~FD?MH#XV0K$B>F!Z>DeLI;McVLW5Qb+&|sM?S622wU;bPPU#!g2CrjiZs{EhZ8_0fTydU J%Q~loCIBZ;fo%W) literal 0 HcmV?d00001 diff --git a/tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_down.png b/tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_down.png new file mode 100644 index 0000000000000000000000000000000000000000..23cc8ee38e6bb807988c12b2c49f1da64d500007 GIT binary patch literal 3183 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 literal 0 HcmV?d00001 diff --git a/tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_up_f.png b/tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_up_f.png new file mode 100644 index 0000000000000000000000000000000000000000..252633752a7ac81f5f5520454b61a242da07ef9b GIT binary patch literal 3200 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::move(items), selected_item, - allow_multiple_selection); + allow_multiple_selection, bounds); } void WebContentsEflDelegateEwk::HidePopupMenu() { diff --git a/tizen_src/ewk/efl_integration/web_contents_observer_efl.cc b/tizen_src/ewk/efl_integration/web_contents_observer_efl.cc index c48e996..8917a69 100644 --- a/tizen_src/ewk/efl_integration/web_contents_observer_efl.cc +++ b/tizen_src/ewk/efl_integration/web_contents_observer_efl.cc @@ -335,8 +335,11 @@ void WebContentsObserverEfl::OnRequestSelectCollectionInformationUpdateACK( int current_node_index, bool prev_state, bool next_state) { - web_view_->UpdateFormNavigation(form_element_count, current_node_index, - prev_state, next_state); + if (!web_view_->GetSelectPicker()) + return; + + web_view_->GetSelectPicker()->UpdateFormNavigation(form_element_count, + current_node_index); } void WebContentsObserverEfl::OnDidChangeMaxScrollOffset(int max_scroll_x, -- 2.7.4 From 1e02ce79e20fde26e8b1b5f8414e1ea526f90440 Mon Sep 17 00:00:00 2001 From: "ayush.k123" Date: Thu, 16 Feb 2023 10:30:11 +0530 Subject: [PATCH 08/16] [M108 Migration] Remove EWK_BRINGUP from ewk APIs and HttpUserAgentSettingsEfl This patch migrates the following changes: 1. Remove EWK_BRINGUP from HttpUserAgentSettingsEfl 2. Remove EWK_BRINGUP for ewk_view_plain_text_get() 3. Remove EWK_BRINGUP from ewk_hit_test_private.cc It also cleans up code in eweb_view.h Reference: https://review.tizen.org/gerrit/283824 https://review.tizen.org/gerrit/282993 https://review.tizen.org/gerrit/281104 https://review.tizen.org/gerrit/280592 Change-Id: If85b186ec8dc30064fd008e74c897064b03fff17 Signed-off-by: Ayush Kumar --- third_party/blink/renderer/core/exported/BUILD.gn | 10 ++++++++++ .../third_party/blink/renderer/core/core_efl.gni | 5 +++++ .../ewk/efl_integration/common/render_messages_ewk.h | 3 +-- tizen_src/ewk/efl_integration/eweb_view.cc | 16 ++++++---------- tizen_src/ewk/efl_integration/eweb_view.h | 6 ------ .../ewk/efl_integration/http_user_agent_settings_efl.cc | 6 +----- .../ewk/efl_integration/private/ewk_hit_test_private.cc | 9 ++++----- .../renderer/render_frame_observer_efl.cc | 17 +++++++++++++++++ .../renderer/render_frame_observer_efl.h | 1 + 9 files changed, 45 insertions(+), 28 deletions(-) diff --git a/third_party/blink/renderer/core/exported/BUILD.gn b/third_party/blink/renderer/core/exported/BUILD.gn index 7c48a03..2fb2584 100644 --- a/third_party/blink/renderer/core/exported/BUILD.gn +++ b/third_party/blink/renderer/core/exported/BUILD.gn @@ -4,6 +4,11 @@ import("//third_party/blink/renderer/core/core.gni") import("//third_party/blink/renderer/core/exported/build.gni") +if (use_efl) { + import( + "//tizen_src/chromium_impl/third_party/blink/renderer/core/core_efl.gni") +} + static_library("test_support") { testonly = true @@ -21,6 +26,11 @@ static_library("test_support") { blink_core_sources("exported") { sources = blink_core_sources_exported + # TODO: Move this to tizen_src/ewk/efl_integration/BUILD.gn + if (use_efl) { + sources += external_webkit_core_exported_sources + } + deps = [ "//build:chromeos_buildflags", "//third_party/blink/renderer/core:core_generated", diff --git a/tizen_src/chromium_impl/third_party/blink/renderer/core/core_efl.gni b/tizen_src/chromium_impl/third_party/blink/renderer/core/core_efl.gni index bacbb9c..ab38f8b 100644 --- a/tizen_src/chromium_impl/third_party/blink/renderer/core/core_efl.gni +++ b/tizen_src/chromium_impl/third_party/blink/renderer/core/core_efl.gni @@ -19,3 +19,8 @@ external_webkit_core_layout_sources = [ # For //third_party/blink/renderer/core:core_generated target external_webkit_core_generated_deps = [ "//tizen_src/chromium_impl/tizen:system-info" ] + +external_webkit_core_exported_sources = [ + "//third_party/blink/public/test/test_web_frame_content_dumper.h", + "//third_party/blink/renderer/core/exported/test_web_frame_content_dumper.cc", +] diff --git a/tizen_src/ewk/efl_integration/common/render_messages_ewk.h b/tizen_src/ewk/efl_integration/common/render_messages_ewk.h index 0d397e1..f4b972d 100644 --- a/tizen_src/ewk/efl_integration/common/render_messages_ewk.h +++ b/tizen_src/ewk/efl_integration/common/render_messages_ewk.h @@ -156,8 +156,7 @@ IPC_MESSAGE_ROUTED2(EwkViewMsg_SetScroll, int, /* horizontal position */ int /* vertical position */) -IPC_MESSAGE_ROUTED1(EwkViewMsg_PlainTextGet, - int /* callback id */) +IPC_MESSAGE_ROUTED1(EwkFrameMsg_GetPlainText, int /* callback id */) IPC_MESSAGE_ROUTED1(EwkSettingsMsg_UpdateWebKitPreferencesEfl, WebPreferencesEfl) diff --git a/tizen_src/ewk/efl_integration/eweb_view.cc b/tizen_src/ewk/efl_integration/eweb_view.cc index 8569807..cfa4506 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.cc +++ b/tizen_src/ewk/efl_integration/eweb_view.cc @@ -1805,17 +1805,13 @@ int EWebView::SetEwkViewPlainTextGetCallback( bool EWebView::PlainTextGet(Ewk_View_Plain_Text_Get_Callback callback, void* user_data) { - RenderViewHost* render_view_host = web_contents_->GetRenderViewHost(); - if (!render_view_host) + auto* render_frame_host = web_contents_->GetPrimaryMainFrame(); + if (!render_frame_host) return false; -#if !defined(EWK_BRINGUP) // FIXME: m94 bringup - int plain_text_get_callback_id = - SetEwkViewPlainTextGetCallback(callback, user_data); - return render_view_host->Send(new EwkViewMsg_PlainTextGet( - render_view_host->GetRoutingID(), plain_text_get_callback_id)); -#else - return false; -#endif + + auto callback_id = SetEwkViewPlainTextGetCallback(callback, user_data); + return render_frame_host->Send(new EwkFrameMsg_GetPlainText( + render_frame_host->GetRoutingID(), callback_id)); } void EWebView::InvokePlainTextGetCallback(const std::string& content_text, diff --git a/tizen_src/ewk/efl_integration/eweb_view.h b/tizen_src/ewk/efl_integration/eweb_view.h index ee88fa3..27fb2af 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.h +++ b/tizen_src/ewk/efl_integration/eweb_view.h @@ -5,12 +5,6 @@ #ifndef EWEB_VIEW_H #define EWEB_VIEW_H -#if !defined(EWK_BRINGUP) // FIXME: m67 bringup -// FIXME: appfw/app_service.h is no more in Tizen 2.3, figure out what to -// include instead. -#include -#endif - #include #include #include diff --git a/tizen_src/ewk/efl_integration/http_user_agent_settings_efl.cc b/tizen_src/ewk/efl_integration/http_user_agent_settings_efl.cc index 0f33529..ae9e1c1 100644 --- a/tizen_src/ewk/efl_integration/http_user_agent_settings_efl.cc +++ b/tizen_src/ewk/efl_integration/http_user_agent_settings_efl.cc @@ -18,9 +18,5 @@ std::string HttpUserAgentSettingsEfl::GetAcceptLanguage() const { } std::string HttpUserAgentSettingsEfl::GetUserAgent() const { -#if !defined(EWK_BRINGUP) // FIXME: m73 bringup - return content::GetContentClientExport()->GetUserAgent(); -#else - return std::string(); -#endif + return content::GetContentClientExport()->browser()->GetUserAgent(); } diff --git a/tizen_src/ewk/efl_integration/private/ewk_hit_test_private.cc b/tizen_src/ewk/efl_integration/private/ewk_hit_test_private.cc index ead2b27..2e55044c 100644 --- a/tizen_src/ewk/efl_integration/private/ewk_hit_test_private.cc +++ b/tizen_src/ewk/efl_integration/private/ewk_hit_test_private.cc @@ -44,11 +44,10 @@ _Ewk_Hit_Test::Hit_Test_Node_Data::~Hit_Test_Node_Data() { //(warning) deep copy of skia buffer. _Ewk_Hit_Test::Hit_Test_Image_Buffer::Hit_Test_Image_Buffer(const Hit_Test_Params::Image_Data& data): fileNameExtension(data.fileNameExtension) { -#if !defined(EWK_BRINGUP) // FIXME: m67 bringup - // FIXME: [M63_3239] - // error: ‘const class SkBitmap’ has no member named ‘deepCopyTo’ - data.imageBitmap.deepCopyTo(&(imageBitmap)); -#endif + if (imageBitmap.tryAllocPixels(data.imageBitmap.info())) { + data.imageBitmap.readPixels(imageBitmap.info(), imageBitmap.getPixels(), + imageBitmap.rowBytes(), 0, 0); + } } diff --git a/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc b/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc index 19fc4e7..30e9096 100644 --- a/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc +++ b/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc @@ -16,6 +16,7 @@ #include "third_party/blink/public/platform/url_conversion.h" #include "third_party/blink/public/platform/web_url_error.h" #include "third_party/blink/public/platform/web_url_request.h" +#include "third_party/blink/public/test/test_web_frame_content_dumper.h" #include "third_party/blink/public/web/web_document.h" #include "third_party/blink/public/web/web_element.h" #include "third_party/blink/public/web/web_element_collection.h" @@ -85,6 +86,7 @@ bool RenderFrameObserverEfl::OnMessageReceived(const IPC::Message& message) { IPC_MESSAGE_HANDLER(EwkFrameMsg_LoadNotFoundErrorPage, OnLoadNotFoundErrorPage) IPC_MESSAGE_HANDLER(EwkFrameMsg_MoveToNextOrPreviousSelectElement, OnMoveToNextOrPreviousSelectElement) IPC_MESSAGE_HANDLER(EwkFrameMsg_RequestSelectCollectionInformation, OnRequestSelectCollectionInformation); + IPC_MESSAGE_HANDLER(EwkFrameMsg_GetPlainText, OnGetPlainText); IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; @@ -224,4 +226,19 @@ void RenderFrameObserverEfl::WillReleaseScriptContext( render_frame()->GetWebFrame(), context, world_id); } +void RenderFrameObserverEfl::OnGetPlainText(int callback_id) { + std::string content; + + // WebFrameContentDumper should only be used for testing purposes. + // See http://crbug.com/585164. + if (auto* web_view = render_frame()->GetWebView()) { + content = blink::TestWebFrameContentDumper::DumpWebViewAsText( + web_view, std::numeric_limits::max()) + .Utf8(); + } + + Send(new EwkHostMsg_PlainTextGetContents(render_frame()->GetRoutingID(), + content, callback_id)); +} + } // namespace content diff --git a/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.h b/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.h index 9f3dfe2..0d9098b 100644 --- a/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.h +++ b/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.h @@ -64,6 +64,7 @@ class RenderFrameObserverEfl : public RenderFrameObserver { void OnMoveToNextOrPreviousSelectElement(bool direction); void OnRequestSelectCollectionInformation(); + void OnGetPlainText(int callback_id); gfx::Size max_scroll_offset_; gfx::Size last_scroll_offset_; -- 2.7.4 From 0aa761b53006cc12cbfb1e5303cae49ba2656037 Mon Sep 17 00:00:00 2001 From: Bakka Uday Kiran Date: Thu, 16 Feb 2023 13:40:27 +0530 Subject: [PATCH 09/16] [M108 Migration] Enable ATK_STATE_SHOWING for TV platform Below change enables setting ATK_STATE_SHOWING state for accessibility nodes on TV platform. Reference: https://review.tizen.org/gerrit/c/283258 Change-Id: I6fb7ec1d4a28d5b3f65bdcda937691f5af24f8d9 Signed-off-by: Bakka Uday Kiran --- ui/accessibility/platform/ax_platform_node_auralinux.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/accessibility/platform/ax_platform_node_auralinux.cc b/ui/accessibility/platform/ax_platform_node_auralinux.cc index b02ca80..fedd0c1 100644 --- a/ui/accessibility/platform/ax_platform_node_auralinux.cc +++ b/ui/accessibility/platform/ax_platform_node_auralinux.cc @@ -3244,7 +3244,7 @@ void AXPlatformNodeAuraLinux::GetAtkState(AtkStateSet* atk_state_set) { atk_state_set_add_state(atk_state_set, ATK_STATE_HORIZONTAL); if (!IsInvisibleOrIgnored()) { atk_state_set_add_state(atk_state_set, ATK_STATE_VISIBLE); -#if !defined(TIZEN_ATK_SUPPORT) +#if BUILDFLAG(IS_TIZEN_TV) if (!delegate_->IsOffscreen() && !is_minimized) atk_state_set_add_state(atk_state_set, ATK_STATE_SHOWING); #endif -- 2.7.4 From 9a51c61aef4c9c9dc398cf3e7b0eb56a4375ba92 Mon Sep 17 00:00:00 2001 From: xiafeng Date: Sat, 18 Feb 2023 14:07:57 +0800 Subject: [PATCH 10/16] [M108 Migration][VD][Accessibility] Support ewk_settings_spatial_navigation_enabled_set Support ewk_settings_spatial_navigation_enabled_set. Related M94 Aura patch: https://review.tizen.org/gerrit/279760/ Change-Id: Ic8b97b41b89d2a3e1766c65636f0ce743dc85d2d Signed-off-by: xiafeng --- tizen_src/ewk/efl_integration/public/ewk_settings.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tizen_src/ewk/efl_integration/public/ewk_settings.cc b/tizen_src/ewk/efl_integration/public/ewk_settings.cc index 18b4e36..2891cd8 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_settings.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_settings.cc @@ -910,9 +910,16 @@ Eina_Bool ewk_settings_viewport_meta_tag_get(const Ewk_Settings *settings) return EINA_FALSE; } -void ewk_settings_spatial_navigation_enabled_set(Ewk_Settings* settings, Eina_Bool Enabled) +void ewk_settings_spatial_navigation_enabled_set(Ewk_Settings* settings, Eina_Bool enable) { +#if defined(OS_TIZEN_TV_PRODUCT) + EINA_SAFETY_ON_NULL_RETURN(settings); + LOG(INFO)<<"ewk_settings_spatial_navigation_enabled_set, enabled: " <<(bool)enable; + settings->getPreferences().spatial_navigation_enabled = !!enable; + ewkUpdateWebkitPreferences(settings->getEvasObject()); +#else LOG_EWK_API_MOCKUP(); +#endif } void ewk_settings_ime_panel_enabled_set(Ewk_Settings* settings, Eina_Bool Enabled) -- 2.7.4 From ba7c214f0f5928edeac88545d5b8e74200604cb1 Mon Sep 17 00:00:00 2001 From: "ayush.k123" Date: Fri, 17 Feb 2023 09:19:05 +0530 Subject: [PATCH 11/16] [M108 Migration] Add ewk_intercept_request_view_get() This patch adds a new internal API that provides ewk view object requesting the resource. Reference: https://review.tizen.org/gerrit/282794 Change-Id: I7c7cc588c5013d6136453d7921625b914d6ae99f Signed-off-by: Ayush Kumar --- .../browser/intercept_request_params.h | 2 ++ .../proxying_url_loader_factory_efl.cc | 19 +++++++++++++++++-- .../network_service/proxying_url_loader_factory_efl.h | 4 ++++ .../ewk/efl_integration/content_browser_client_efl.cc | 3 ++- .../private/ewk_intercept_request_private.cc | 1 + .../private/ewk_intercept_request_private.h | 3 +++ .../efl_integration/public/ewk_intercept_request.cc | 6 ++++++ .../public/ewk_intercept_request_internal.h | 18 ++++++++++++++++++ 8 files changed, 53 insertions(+), 3 deletions(-) diff --git a/tizen_src/ewk/efl_integration/browser/intercept_request_params.h b/tizen_src/ewk/efl_integration/browser/intercept_request_params.h index 0f0b753..9db19cd 100644 --- a/tizen_src/ewk/efl_integration/browser/intercept_request_params.h +++ b/tizen_src/ewk/efl_integration/browser/intercept_request_params.h @@ -7,6 +7,7 @@ #include +#include "eweb_view.h" #include "net/base/upload_data_stream.h" #include "net/http/http_request_headers.h" #include "url/gurl.h" @@ -16,6 +17,7 @@ struct InterceptRequestParams { InterceptRequestParams(const InterceptRequestParams& params) = default; ~InterceptRequestParams() = default; + EWebView* web_view = nullptr; GURL url; std::string method = "GET"; net::HttpRequestHeaders headers; diff --git a/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_factory_efl.cc b/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_factory_efl.cc index df5dea7..cfc9226 100644 --- a/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_factory_efl.cc +++ b/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_factory_efl.cc @@ -7,6 +7,7 @@ #include "base/task/thread_pool.h" #include "browser/intercept_request_params.h" #include "browser/network_service/proxying_url_loader_efl.h" +#include "common/web_contents_utils.h" #include "content/public/browser/browser_thread.h" #include "net/base/elements_upload_data_stream.h" #include "net/base/upload_bytes_element_reader.h" @@ -62,24 +63,37 @@ class FileElementReader : public net::UploadFileElementReader { scoped_refptr resource_request_body_; }; +EWebView* GetWebViewFromFrameTreeNodeId(int frame_tree_node_id) { + auto* web_content = + content::WebContents::FromFrameTreeNodeId(frame_tree_node_id); + if (!web_content) + return nullptr; + return web_contents_utils::WebViewFromWebContents(web_content); +} + } // namespace // static void ProxyingURLLoaderFactoryEfl::CreateProxy( + int frame_tree_node_id, content::BrowserContextEfl::ResourceContextEfl* resource_context, mojo::PendingReceiver loader_receiver, mojo::PendingRemote target_factory_remote) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - new ProxyingURLLoaderFactoryEfl(resource_context, std::move(loader_receiver), + new ProxyingURLLoaderFactoryEfl(frame_tree_node_id, resource_context, + std::move(loader_receiver), std::move(target_factory_remote)); } ProxyingURLLoaderFactoryEfl::ProxyingURLLoaderFactoryEfl( + int frame_tree_node_id, content::BrowserContextEfl::ResourceContextEfl* resource_context, mojo::PendingReceiver loader_receiver, mojo::PendingRemote target_factory_remote) - : resource_context_(resource_context), weak_ptr_factory_(this) { + : frame_tree_node_id_(frame_tree_node_id), + resource_context_(resource_context), + weak_ptr_factory_(this) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); if (target_factory_remote) { target_factory_.Bind(std::move(target_factory_remote)); @@ -129,6 +143,7 @@ void ProxyingURLLoaderFactoryEfl::CreateLoaderAndStart( mojo::PendingRemote client, const net::MutableNetworkTrafficAnnotationTag& traffic_annotation) { InterceptRequestParams params; + params.web_view = GetWebViewFromFrameTreeNodeId(frame_tree_node_id_); params.url = request.url; params.method = request.method; params.headers = request.headers; diff --git a/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_factory_efl.h b/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_factory_efl.h index 2626a3d..bd1a788 100644 --- a/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_factory_efl.h +++ b/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_factory_efl.h @@ -19,6 +19,7 @@ class ResourceContext; class ProxyingURLLoaderFactoryEfl : public network::mojom::URLLoaderFactory { public: static void CreateProxy( + int frame_tree_node_id, content::BrowserContextEfl::ResourceContextEfl* resource_context, mojo::PendingReceiver loader_receiver, mojo::PendingRemote @@ -40,6 +41,7 @@ class ProxyingURLLoaderFactoryEfl : public network::mojom::URLLoaderFactory { loader_receiver) override; ProxyingURLLoaderFactoryEfl( + int frame_tree_node_id, content::BrowserContextEfl::ResourceContextEfl* resource_context, mojo::PendingReceiver loader_receiver, mojo::PendingRemote @@ -55,6 +57,8 @@ class ProxyingURLLoaderFactoryEfl : public network::mojom::URLLoaderFactory { network::ResourceRequestBody* body, base::SingleThreadTaskRunner* file_task_runner); + int frame_tree_node_id_; + content::BrowserContextEfl::ResourceContextEfl* resource_context_; mojo::ReceiverSet proxy_receivers_; diff --git a/tizen_src/ewk/efl_integration/content_browser_client_efl.cc b/tizen_src/ewk/efl_integration/content_browser_client_efl.cc index f7777a2..cc199f7 100644 --- a/tizen_src/ewk/efl_integration/content_browser_client_efl.cc +++ b/tizen_src/ewk/efl_integration/content_browser_client_efl.cc @@ -584,7 +584,8 @@ bool ContentBrowserClientEfl::WillCreateURLLoaderFactory( GetIOThreadTaskRunner({})->PostTask( FROM_HERE, base::BindOnce(&ProxyingURLLoaderFactoryEfl::CreateProxy, - resource_context_efl, std::move(proxied_receiver), + frame->GetFrameTreeNodeId(), resource_context_efl, + std::move(proxied_receiver), std::move(target_factory_remote))); return true; } diff --git a/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.cc b/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.cc index 2de0d02..8f71d28 100644 --- a/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.cc +++ b/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.cc @@ -36,6 +36,7 @@ _Ewk_Intercept_Request::_Ewk_Intercept_Request( response_status_code_(-1), ignored_(false), chunked_write_(false) { + ewk_view_ = params.web_view ? params.web_view->evas_object() : nullptr; request_headers_ = eina_hash_string_small_new(_headers_entry_free_cb); net::HttpRequestHeaders::Iterator current_header(params.headers); while (current_header.GetNext()) { diff --git a/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.h b/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.h index a829724..a3a7fc8 100644 --- a/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.h +++ b/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.h @@ -11,6 +11,7 @@ #include #include +#include #include "base/synchronization/atomic_flag.h" @@ -39,6 +40,7 @@ struct _Ewk_Intercept_Request { // functions so user can use EWK API to get info about intercepted request // to make a decision + Evas_Object* ewk_view() const { return ewk_view_; } const char* request_scheme_get() const { return request_scheme_.c_str(); } const char* request_url_get() const { return request_url_.c_str(); } const char* request_http_method_get() const { @@ -85,6 +87,7 @@ struct _Ewk_Intercept_Request { Delegate* delegate_; + Evas_Object* ewk_view_; std::string request_scheme_; std::string request_url_; std::string request_http_method_; diff --git a/tizen_src/ewk/efl_integration/public/ewk_intercept_request.cc b/tizen_src/ewk/efl_integration/public/ewk_intercept_request.cc index b29fbb8..2011d41 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_intercept_request.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_intercept_request.cc @@ -130,3 +130,9 @@ int64_t ewk_intercept_request_body_length_get( EINA_SAFETY_ON_NULL_RETURN_VAL(intercept_request, -1); return intercept_request->request_body_length_get(); } + +Evas_Object* ewk_intercept_request_view_get( + Ewk_Intercept_Request* intercept_request) { + EINA_SAFETY_ON_NULL_RETURN_VAL(intercept_request, NULL); + return intercept_request->ewk_view(); +} \ No newline at end of file diff --git a/tizen_src/ewk/efl_integration/public/ewk_intercept_request_internal.h b/tizen_src/ewk/efl_integration/public/ewk_intercept_request_internal.h index ec0ba4b..f8c6a02 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_intercept_request_internal.h +++ b/tizen_src/ewk/efl_integration/public/ewk_intercept_request_internal.h @@ -27,6 +27,7 @@ #define EWK_EFL_INTEGRATION_PUBLIC_EWK_INTERCEPT_REQUEST_INTERNAL_H_ #include +#include #include #include "ewk_intercept_request.h" @@ -87,6 +88,23 @@ EXPORT_API const char* ewk_intercept_request_body_get( EXPORT_API int64_t ewk_intercept_request_body_length_get( Ewk_Intercept_Request* intercept_request); +/** + * @brief Returns the ewk view object that is requesting the resource. + * + * @remarks It is only allowed to use this function *inside* the + * Ewk_Context_Intercept_Request_Callback. + * + * @since_tizen 7.0 + * + * @param[in] intercept_request intercept request instance received from + * Ewk_Context_Intercept_Request_Callback ewk_context callback + * + * @return The view object on success,\n + * otherwise @c NULL on failure + */ +EXPORT_API Evas_Object* ewk_intercept_request_view_get( + Ewk_Intercept_Request* intercept_request); + #ifdef __cplusplus } #endif -- 2.7.4 From 2515c38ceb5d038b83e1fd4cbfc7502bf5afae3a Mon Sep 17 00:00:00 2001 From: "ayush.k123" Date: Fri, 17 Feb 2023 08:32:59 +0530 Subject: [PATCH 12/16] [M108 Migration][Accessibility] Support atk in select picker This patch is for supporting atk in select picker. Reference: https://review.tizen.org/gerrit/280726 Change-Id: I4b8f83a18b6963a5ff8bc6c938d0b3bf2a3f562e Signed-off-by: Ayush Kumar --- .../browser/select_picker/select_picker_base.cc | 29 +++++- .../browser/select_picker/select_picker_base.h | 7 ++ .../select_picker/select_picker_mobile_base.cc | 106 +++++++++++++++++++++ .../select_picker/select_picker_mobile_base.h | 24 +++++ .../browser/select_picker/select_picker_tv_base.cc | 3 + .../browser/select_picker/select_picker_util.cc | 26 ++++- .../browser/select_picker/select_picker_util.h | 13 ++- .../browser/select_picker/select_picker_mobile.cc | 6 ++ .../browser/select_picker/select_picker_mobile.h | 4 + .../browser/select_picker/select_picker_tv.cc | 6 ++ .../browser/select_picker/select_picker_tv.h | 4 + 11 files changed, 224 insertions(+), 4 deletions(-) diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.cc b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.cc index a4668c7..18d11e3 100644 --- a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.cc +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.cc @@ -194,18 +194,41 @@ void SelectPickerBase::InitializeSelectedPickerData( bool need_scroll_to_top = true; for (size_t index = 0; index < items.size(); index++) { bool checked = items[index]->checked; - auto data = new GenlistCallbackData( +#if defined(TIZEN_ATK_SUPPORT) + auto* data = new GenlistCallbackData(index, this, std::move(items[index]), + popup_list_, item_class_, group_class_, + is_multiple_selection_, + ItemSelectedCallback, GetAtkStatus()); + + // Save first item for atk + if (!index) { + first_item_ = data->GetElmItem(); + selected_item_ = data->GetElmItem(); + } +#else + auto* data = new GenlistCallbackData( index, this, std::move(items[index]), popup_list_, item_class_, group_class_, is_multiple_selection_, ItemSelectedCallback); +#endif if (is_multiple_selection_ && checked) { selected_indexes_.push_back(index); if (need_scroll_to_top) { data->ScrollToTop(); need_scroll_to_top = false; +#if defined(TIZEN_ATK_SUPPORT) + // Save selected item for atk with multiple selection + selected_item_ = data->GetElmItem(); +#endif } } select_picker_data_.push_back(data); +#if defined(TIZEN_ATK_SUPPORT) + // Save selected item for atk + if (base::checked_cast(index) == selected_index_ && + !is_multiple_selection_) + selected_item_ = data->GetElmItem(); +#endif } if (is_multiple_selection_) { @@ -220,6 +243,10 @@ void SelectPickerBase::InitializeSelectedPickerData( void SelectPickerBase::Show() { evas_object_show(layout_); +#if defined(TIZEN_ATK_SUPPORT) + if (GetAtkStatus()) + elm_atspi_component_highlight_grab(selected_item_); +#endif } void SelectPickerBase::Hide() { diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.h b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.h index 95d62a6..0900cbe 100644 --- a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.h +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.h @@ -55,6 +55,13 @@ class SelectPickerBase { virtual content::WebContentsViewAura* wcva() const { return nullptr; } +#if defined(TIZEN_ATK_SUPPORT) + virtual bool GetAtkStatus() = 0; + + Elm_Object_Item* first_item_ = nullptr; + Elm_Object_Item* selected_item_ = nullptr; +#endif + Evas_Object* evas_object_; Evas_Object* popup_list_; Evas_Object* layout_; diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.cc b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.cc index 55ae1ab..1d1d1a0 100644 --- a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.cc +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.cc @@ -17,6 +17,12 @@ namespace { const char* const kChangedCbName = "changed"; +#if defined(TIZEN_ATK_SUPPORT) +const char* const kImagePrevBgObj = "elm.image.prev_bg"; +const char* const kImageNextBgObj = "elm.image.next_bg"; +const char* const kImageDoneBgObj = "elm.image.done_bg"; +#endif + void RadioIconChangedCallback(void* data, Evas_Object* obj, void* event_info) { auto callback_data = static_cast(data); callback_data->SetSelection(true); @@ -35,10 +41,98 @@ SelectPickerMobileBase::SelectPickerMobileBase(Evas_Object* evas_object, } SelectPickerMobileBase::~SelectPickerMobileBase() { +#if defined(TIZEN_ATK_SUPPORT) + RemoveAtkObject(); +#endif Hide(); DestroyRadioList(); } +#if defined(TIZEN_ATK_SUPPORT) +Eina_Bool SelectPickerMobileBase::AccessNavigateToPrevCallback( + void* data, + Evas_Object* obj, + Elm_Access_Action_Info* action_info) { + auto* picker = static_cast(data); + picker->FormNavigate(false); + return EINA_TRUE; +} + +Eina_Bool SelectPickerMobileBase::AccessNavigateToNextCallback( + void* data, + Evas_Object* obj, + Elm_Access_Action_Info* action_info) { + auto* picker = static_cast(data); + picker->FormNavigate(true); + return EINA_TRUE; +} + +Eina_Bool SelectPickerMobileBase::AccessDoneCallback( + void* data, + Evas_Object* obj, + Elm_Access_Action_Info* action_info) { + auto* picker = static_cast(data); + picker->HidePopupMenu(); + return EINA_TRUE; +} + +void SelectPickerMobileBase::AddAtkObject() { + auto* edje_obj = elm_layout_edje_get(layout_); + + prev_button_ = + (Evas_Object*)edje_object_part_object_get(edje_obj, kImagePrevBgObj); + ao_prev_button_ = elm_access_object_register(prev_button_, layout_); + elm_atspi_accessible_name_set( + ao_prev_button_, dgettext("WebKit", "IDS_WEBVIEW_BUTTON_PREV_ABB")); + elm_atspi_accessible_reading_info_type_set( + ao_prev_button_, ELM_ACCESSIBLE_READING_INFO_TYPE_NAME); + + next_button_ = + (Evas_Object*)edje_object_part_object_get(edje_obj, kImageNextBgObj); + ao_next_button_ = elm_access_object_register(next_button_, layout_); + elm_atspi_accessible_name_set( + ao_next_button_, dgettext("WebKit", "IDS_WEBVIEW_BUTTON_NEXT_ABB3")); + elm_atspi_accessible_reading_info_type_set( + ao_next_button_, ELM_ACCESSIBLE_READING_INFO_TYPE_NAME); + + done_button_ = + (Evas_Object*)edje_object_part_object_get(edje_obj, kImageDoneBgObj); + ao_done_button_ = elm_access_object_register(done_button_, layout_); + elm_atspi_accessible_name_set(ao_done_button_, + dgettext("WebKit", "IDS_WEBVIEW_BUTTON_DONE")); + elm_atspi_accessible_reading_info_type_set( + ao_done_button_, ELM_ACCESSIBLE_READING_INFO_TYPE_NAME); + + elm_access_action_cb_set(ao_prev_button_, ELM_ACCESS_ACTION_ACTIVATE, + AccessNavigateToPrevCallback, this); + elm_access_action_cb_set(ao_next_button_, ELM_ACCESS_ACTION_ACTIVATE, + AccessNavigateToNextCallback, this); + elm_access_action_cb_set(ao_done_button_, ELM_ACCESS_ACTION_ACTIVATE, + AccessDoneCallback, this); + + elm_atspi_accessible_relationship_append( + ao_done_button_, ELM_ATSPI_RELATION_FLOWS_TO, first_item_); + elm_atspi_accessible_relationship_append( + first_item_, ELM_ATSPI_RELATION_FLOWS_FROM, ao_done_button_); +} + +void SelectPickerMobileBase::RemoveAtkObject() { + if (ao_done_button_) { + elm_atspi_accessible_relationship_remove( + ao_done_button_, ELM_ATSPI_RELATION_FLOWS_TO, first_item_); + elm_atspi_accessible_relationship_remove( + first_item_, ELM_ATSPI_RELATION_FLOWS_FROM, ao_done_button_); + } + + if (prev_button_) + elm_access_object_unregister(prev_button_); + if (next_button_) + elm_access_object_unregister(next_button_); + if (done_button_) + elm_access_object_unregister(done_button_); +} +#endif + void SelectPickerMobileBase::Init(std::vector items, const gfx::Rect& bounds) { // Request form navigation information as early as possible, @@ -107,6 +201,10 @@ void SelectPickerMobileBase::ItemSelected(GenlistCallbackData* data, selected_index_ = data->GetIndex(); DidSelectPopupMenuItem(); } +#if defined(TIZEN_ATK_SUPPORT) + if (GetAtkStatus()) + HidePopupMenu(); +#endif } void SelectPickerMobileBase::CreateAndPopulatePopupList( @@ -120,8 +218,13 @@ void SelectPickerMobileBase::CreateAndPopulatePopupList( elm_object_focus_allow_set(popup_list_, false); +#if defined(TIZEN_ATK_SUPPORT) + if (GetAtkStatus()) + item_class_->func.content_get = nullptr; +#else item_class_->func.content_get = is_multiple_selection_ ? nullptr : IconGetCallback; +#endif elm_genlist_multi_select_set(popup_list_, is_multiple_selection_); @@ -147,6 +250,9 @@ void SelectPickerMobileBase::CreateAndPopulatePopupList( } elm_object_part_content_set(layout_, "elm.swallow.content", popup_list_); +#if defined(TIZEN_ATK_SUPPORT) + AddAtkObject(); +#endif } gfx::Rect SelectPickerMobileBase::GetGeometryDIP() const { diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.h b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.h index a60b360..5f67184 100644 --- a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.h +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.h @@ -33,6 +33,30 @@ class SelectPickerMobileBase : public FormNavigablePicker { void DestroyRadioList(); +#if defined(TIZEN_ATK_SUPPORT) + void AddAtkObject(); + void RemoveAtkObject(); + + static Eina_Bool AccessNavigateToPrevCallback( + void* data, + Evas_Object* obj, + Elm_Access_Action_Info* action_info); + static Eina_Bool AccessNavigateToNextCallback( + void* data, + Evas_Object* obj, + Elm_Access_Action_Info* action_info); + static Eina_Bool AccessDoneCallback(void* data, + Evas_Object* obj, + Elm_Access_Action_Info* action_info); + + Evas_Object* prev_button_ = nullptr; + Evas_Object* next_button_ = nullptr; + Evas_Object* done_button_ = nullptr; + Evas_Object* ao_prev_button_ = nullptr; + Evas_Object* ao_next_button_ = nullptr; + Evas_Object* ao_done_button_ = nullptr; +#endif + Evas_Object* radio_main_; }; diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.cc b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.cc index 1422a45..219b5aa 100644 --- a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.cc +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.cc @@ -50,6 +50,9 @@ void SelectPickerTvBase::CreateAndPopulatePopupList( item_class_->func.content_get = nullptr; elm_genlist_multi_select_set(popup_list_, is_multiple_selection_); InitializeSelectedPickerData(std::move(items)); +#if defined(TIZEN_ATK_SUPPORT) + elm_genlist_item_selected_set(selected_item_, EINA_TRUE); +#endif elm_object_part_content_set(layout_, "elm.swallow.content", popup_list_); elm_object_scale_set(popup_list_, kBoxRatio); } diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.cc b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.cc index 5cc09fa..993d88a 100644 --- a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.cc +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.cc @@ -14,10 +14,20 @@ GenlistCallbackData::GenlistCallbackData( const Elm_Genlist_Item_Class* item_class, const Elm_Genlist_Item_Class* group_class, bool is_multiple_selection, - Evas_Smart_Cb item_selected_cb) + Evas_Smart_Cb item_selected_cb +#if defined(TIZEN_ATK_SUPPORT) + , + bool atk_enabled +#endif + ) : index_(index), select_picker_(select_picker), - menu_item_(std::move(menu_item)) { + menu_item_(std::move(menu_item)) +#if defined(TIZEN_ATK_SUPPORT) + , + atk_enabled_(atk_enabled) +#endif +{ bool is_option_type = (menu_item_->type == blink::mojom::MenuItem::Type::kOption); elm_item_ = elm_genlist_item_append( @@ -33,7 +43,13 @@ GenlistCallbackData::GenlistCallbackData( } GenlistCallbackData::~GenlistCallbackData() { +#if defined(TIZEN_ATK_SUPPORT) + // TODO(bj1987.kim): This code prevents the elm_genlist from crashing + // when ATK is turned on. After fixing genlist crash, need to remove. + if (!atk_enabled_ && elm_item_) +#else if (elm_item_) +#endif elm_object_item_del(elm_item_); } @@ -53,6 +69,12 @@ const std::string& GenlistCallbackData::GetLabel() const { return menu_item_->label.value(); } +#if defined(TIZEN_ATK_SUPPORT) +Elm_Object_Item* GenlistCallbackData::GetElmItem() const { + return elm_item_; +} +#endif + SelectPickerBase* GenlistCallbackData::GetSelectPicker() const { return select_picker_; } diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.h b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.h index 77ad829..4592c76 100644 --- a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.h +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.h @@ -20,7 +20,12 @@ class GenlistCallbackData { const Elm_Genlist_Item_Class* item_class, const Elm_Genlist_Item_Class* group_class, bool is_multiple_selection, - Evas_Smart_Cb item_selected_cb); + Evas_Smart_Cb item_selected_cb +#if defined(TIZEN_ATK_SUPPORT) + , + bool atk_enabled +#endif + ); ~GenlistCallbackData(); GenlistCallbackData(const GenlistCallbackData&) = delete; @@ -30,6 +35,9 @@ class GenlistCallbackData { void ScrollToTop(); int GetIndex() const; const std::string& GetLabel() const; +#if defined(TIZEN_ATK_SUPPORT) + Elm_Object_Item* GetElmItem() const; +#endif SelectPickerBase* GetSelectPicker() const; bool IsEnabled() const; @@ -38,6 +46,9 @@ class GenlistCallbackData { SelectPickerBase* select_picker_; Elm_Object_Item* elm_item_; blink::mojom::MenuItemPtr menu_item_; +#if defined(TIZEN_ATK_SUPPORT) + bool atk_enabled_; +#endif }; #endif // CONTENT_BROWSER_SELECT_PICKER_SELECT_PICKER_UTIL_H_ diff --git a/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.cc b/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.cc index 4b507f0..a8ef5c3 100644 --- a/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.cc +++ b/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.cc @@ -43,3 +43,9 @@ void SelectPickerMobile::RequestFormNavigationInformation() { rfh->Send( new EwkFrameMsg_RequestSelectCollectionInformation(rfh->GetRoutingID())); } + +#if defined(TIZEN_ATK_SUPPORT) +bool SelectPickerMobile::GetAtkStatus() { + return web_view_->GetAtkStatus(); +} +#endif diff --git a/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.h b/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.h index 96a3c38..29a38f8 100644 --- a/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.h +++ b/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.h @@ -28,6 +28,10 @@ class SelectPickerMobile : public SelectPickerMobileBase { // SelectPickerBase content::WebContentsViewAura* wcva() const override; +#if defined(TIZEN_ATK_SUPPORT) + bool GetAtkStatus() override; +#endif + EWebView* web_view_; }; diff --git a/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.cc b/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.cc index 70fd877..7227569 100644 --- a/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.cc +++ b/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.cc @@ -47,3 +47,9 @@ void SelectPickerTv::RequestFormNavigationInformation() { void SelectPickerTv::HidePopupMenu() { web_view_->HidePopupMenu(); } + +#if defined(TIZEN_ATK_SUPPORT) +bool SelectPickerTv::GetAtkStatus() { + return web_view_->GetAtkStatus(); +} +#endif diff --git a/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.h b/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.h index a9f1ad1..0ab05f7 100644 --- a/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.h +++ b/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.h @@ -28,6 +28,10 @@ class SelectPickerTv : public SelectPickerTvBase { // SelectPickerBase content::WebContentsViewAura* wcva() const override; +#if defined(TIZEN_ATK_SUPPORT) + bool GetAtkStatus() override; +#endif + EWebView* web_view_; }; -- 2.7.4 From 30cc26a63b2c115b475cd4bce3ac70c6d7f93d2d Mon Sep 17 00:00:00 2001 From: "ayush.k123" Date: Fri, 17 Feb 2023 12:20:55 +0530 Subject: [PATCH 13/16] [M108 Migration] Use snprintf in place of sprintf For better security, VD recommends using snprintf in place of sprintf. Reference: https://review.tizen.org/gerrit/c/283371/ Change-Id: If615daf8f65d95f203ed856d8df4a1c87c9a8a7b Signed-off-by: Ayush Kumar --- tizen_src/ewk/ubrowser/logger.cc | 2 +- tizen_src/ewk/ubrowser/window.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tizen_src/ewk/ubrowser/logger.cc b/tizen_src/ewk/ubrowser/logger.cc index 373619e..867f0f3 100644 --- a/tizen_src/ewk/ubrowser/logger.cc +++ b/tizen_src/ewk/ubrowser/logger.cc @@ -80,7 +80,7 @@ _make_format(MESSAGE_TYPE type, int add_newline, const char* fmt) { if (msg_fmt == NULL) { return NULL; } - sprintf(msg_fmt, fmt_hdr, fmt); + snprintf(msg_fmt, fmt_len, fmt_hdr, fmt); if (add_newline) { msg_fmt[fmt_len - 2] = '\n'; diff --git a/tizen_src/ewk/ubrowser/window.cc b/tizen_src/ewk/ubrowser/window.cc index 56ad89b..28cd7c9 100644 --- a/tizen_src/ewk/ubrowser/window.cc +++ b/tizen_src/ewk/ubrowser/window.cc @@ -872,7 +872,7 @@ void Window::OnScreenshotCaptured(Evas_Object* image, void* user_data) { log_trace("%s", __PRETTY_FUNCTION__); static int c = 1; char buf[250]; - sprintf(buf, "screenshot%d.png", c++); + snprintf(buf, sizeof(buf), "screenshot%d.png", c++); if (evas_object_image_save(image, buf, 0, 0)) log_info("Screenshot image saved in %s", buf); else -- 2.7.4 From f93862cde8df5ec43d5c8bda0516abd485b35c14 Mon Sep 17 00:00:00 2001 From: "ayush.k123" Date: Fri, 17 Feb 2023 12:11:04 +0530 Subject: [PATCH 14/16] [M108 Migration] Enable NetworkServiceInProcess for Tizen Below change enable network service to run as in-process for Tizen Reference: https://review.tizen.org/gerrit/278829/ Change-Id: Iabafafcf1d05a13dde85e4777d02d6b151531976 Signed-off-by: Ayush Kumar --- content/public/common/content_features.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc index 12aa4a4..3e0efe3 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc @@ -709,7 +709,7 @@ BASE_FEATURE(kNavigationThreadingOptimizations, // If the network service is enabled, runs it in process. BASE_FEATURE(kNetworkServiceInProcess, "NetworkServiceInProcess2", -#if BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_TIZEN) base::FEATURE_ENABLED_BY_DEFAULT #else base::FEATURE_DISABLED_BY_DEFAULT -- 2.7.4 From d8790cdc806d905ac338da965a7faeed16e40f4a Mon Sep 17 00:00:00 2001 From: Bakka Uday Kiran Date: Thu, 16 Feb 2023 13:25:09 +0530 Subject: [PATCH 15/16] [M108 Migration]Use container's height to calculate margin top/bottom Some WebKit-based apps expect vertical margins to be calculated using container's height rather than its width (as stated in specification). To provide correct layout of those apps, we allow for non-compliant calculations in compatibility mode (to be implemented). Reference: https://review.tizen.org/gerrit/c/282202 Change-Id: I5bffc230b821939c0e89bbb33c7758040ca7bfe9 Signed-off-by: Bakka Uday Kiran --- third_party/blink/renderer/core/layout/layout_box.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/third_party/blink/renderer/core/layout/layout_box.cc b/third_party/blink/renderer/core/layout/layout_box.cc index f99abf7..25e6776 100644 --- a/third_party/blink/renderer/core/layout/layout_box.cc +++ b/third_party/blink/renderer/core/layout/layout_box.cc @@ -5885,8 +5885,18 @@ void LayoutBox::ComputePositionedLogicalWidthUsing( LayoutUnit logical_right_value = MinimumValueForLength(logical_right, container_logical_width); +#if BUILDFLAG(IS_TIZEN) + // Some apps expect margin top/bottom to be calculated based on container's + // height - not width. For compatibility reasons we allow for such behavior + // in compatibility mode. + const LayoutUnit container_relative_logical_width = + RuntimeEnabledFeatures::TizenCompatibilityModeEnabled() + ? ContainingBlockLogicalHeightForPositioned(container_block, false) + : ContainingBlockLogicalWidthForPositioned(container_block, false); +#else const LayoutUnit container_relative_logical_width = ContainingBlockLogicalWidthForPositioned(container_block, false); +#endif // If we are using aspect-ratio, the width is effectively not auto. bool logical_width_is_auto = @@ -6307,8 +6317,18 @@ void LayoutBox::ComputePositionedLogicalHeightUsing( LayoutUnit logical_height_value; LayoutUnit content_logical_height = logical_height - borders_plus_padding; +#if BUILDFLAG(IS_TIZEN) + // Some apps expect margin top/bottom to be calculated based on container's + // height - not width. For compatibility reasons we allow for such behavior + // in compatibility mode. + const LayoutUnit container_relative_logical_width = + RuntimeEnabledFeatures::TizenCompatibilityModeEnabled() + ? ContainingBlockLogicalHeightForPositioned(container_block, false) + : ContainingBlockLogicalWidthForPositioned(container_block, false); +#else const LayoutUnit container_relative_logical_width = ContainingBlockLogicalWidthForPositioned(container_block, false); +#endif LayoutUnit logical_top_value; -- 2.7.4 From a4907935aa80a16c92112ad75c00802c128fd4f0 Mon Sep 17 00:00:00 2001 From: Jie Zhang Date: Fri, 17 Feb 2023 15:19:22 +0800 Subject: [PATCH 16/16] [M108 Migration] Implement ewk_view_favicon_get() API This API get the favorite-icon in current webview. Reference: - https://review.tizen.org/gerrit/#/c/280190/ Change-Id: Ib293a7636214b39a4cdc111e8a16bd09d66677bd Signed-off-by: Jie Zhang --- tizen_src/ewk/efl_integration/public/ewk_view.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tizen_src/ewk/efl_integration/public/ewk_view.cc b/tizen_src/ewk/efl_integration/public/ewk_view.cc index 6a6cb6d..aec5ec1 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_view.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_view.cc @@ -1259,6 +1259,14 @@ Eina_Bool ewk_view_app_preload_set(Evas_Object* ewkView, Eina_Bool is_preload) } #endif +Evas_Object* ewk_view_favicon_get(const Evas_Object* ewkView) +{ + EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, nullptr); + EINA_SAFETY_ON_NULL_RETURN_VAL(impl->context(), nullptr); + const char* url = ewk_view_url_get(ewkView); + return impl->context()->AddFaviconObject(url, impl->GetEvas()); +} + Eina_Bool ewk_view_html_string_override_current_entry_load(Evas_Object* view, const char* html, const char* base_uri, const char* unreachable_url) { LOG_EWK_API_MOCKUP(); -- 2.7.4