[M130 Migration] Sync |WebContentsViewAura::window_| and WebView 13/317813/3
authorJinwoo Kwon <j83.kwon@samsung.com>
Fri, 6 Sep 2024 08:49:16 +0000 (17:49 +0900)
committerYongGeol Jung <yg48.jung@samsung.com>
Wed, 8 Jan 2025 08:34:01 +0000 (00:34 -0800)
Usually, the size of |WebContentsViewAura::window_| is set in
|RWHVAuraOffscreenHelperEfl::OnParentViewResize|. However, if
|EWebView::HandleResize| is called before attaching
|RenderWidgetHostViewAura|, this operation is not executed.
In this case, call |SetBounds| function so that size setting
is correct.

References:
[1] [M120 Migration][VD] Sync |WebContentsViewAura::window_| and WebView
https://archive.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/317260/

[2] [NUI] Fixed the problem that the NUI app is not visible in the public profile
https://review.tizen.org/gerrit/c/platform/framework/web/chromium-efl/+/317462

Change-Id: I84c8a28d0fd706cd488ab40c6edadd3d4424629c
Signed-off-by: YongGeol Jung <yg48.jung@samsung.com>
tizen_src/ewk/efl_integration/eweb_view.cc

index bd941a29eafffb30876241ab1d50ffd1111c8ed9..f91bac08787218d98db740bccc593cda9f71bc16 100644 (file)
@@ -3004,14 +3004,21 @@ bool EWebView::HandleResize(int width, int height) {
     ScrollFocusedNodeIntoView();
   }
 
-#if defined(USE_AURA) && BUILDFLAG(IS_TIZEN_TV)
   if (host_) {
     int x, y;
     evas_object_geometry_get(efl_main_layout_, &x, &y, nullptr, nullptr);
     gfx::Rect bounds(x, y, width, height);
     host_->SetBoundsInPixels(bounds);
+
+    if (!web_contents_->GetRenderWidgetHostView()) {
+      // Usually, the size of |WebContentsViewAura::window_| is set in
+      // |RWHVAuraOffscreenHelperEfl::OnParentViewResize|. However, if
+      // |EWebView::HandleResize| is called before attaching
+      // |RenderWidgetHostViewAura|, this operation is not executed. In order
+      // to set the size correctly, call |SetBounds| function here.
+      web_contents_->GetNativeView()->SetBounds(gfx::Rect(bounds.size()));
+    }
   }
-#endif
 
   return true;
 }