[M108 Migration][Viewport] Refactors orientation change and sets custom viewport... 53/287953/5
authorv-saha <v.saha@samsung.com>
Wed, 8 Feb 2023 18:47:27 +0000 (00:17 +0530)
committerDae-Hyun Ko <dhyuna.ko@samsung.com>
Sat, 11 Feb 2023 03:23:22 +0000 (03:23 +0000)
commitfb883647fc1b97bfdd5d8e591c683ded9f8c87ce
tree5cbe16a1cf1ec16a3b829e26d54613317997f12e
parent691014c116ca76e5462709425468ae3d9ca91b88
[M108 Migration][Viewport] Refactors orientation change and sets custom viewport size

Due to additional resize code called during orientation change,
orientation callback was called too early (when screen
dimensions were not set yet).

Even though resize callback was called again from
RenderWidgetHostImpl::WasResized() when all data was set,
orientation events were not dispatched again (due to the fact,
that orientation was changed during first, early call) and
wrong values of screen dimensions were set as final values.

Chromium-efl consists of Evas_Object widgets which appear on top of
webview resulting in overlapping the web page content, for example,
1) virtual keyboard,
2) popup menu picker.

As for 1), EFL allows auto-resizing the window on vk show/hide by using
elm_conformant widget. Because it does not work for TIZEN 3.0 [1]
Browser app manually resizes webview on vk appearance [2].

As for 2), chromium-efl fully implements select picker internally and
app is not aware of it.

This patch overrides GetVisibleViewportSize() and returns smaller
viewport while showing select picker. According to the comment from [3]
this method allows us to define smaller viewport if a portion of the
view is obstructed.

GetVisibleViewportSize() is always called on any size update and result
in sending a new size to the Renderer.

To make <select> element visible, this patch implements:
EWebView::ScrollFocusedNodeIntoView because
RenderWidgetHostViewEfl::ScrollFocusedEditableNode scrolls webview for
editable elements only.

This change fixes WCS TC 195.

Additionally, refactor picker code in EWebView class:
1. Rename ShowPopupMenu -> HandlePopupMenu
   it does not only show picker but also changes viewport.
2. PopupMenuClose and HidePopupMenu return void.
3. PopupMenuClose calls ReleasePopupMenuList as it was already exposed.
4. Get rid of CloseSelectPicker and IsSelectPickerShown as they are
   no longer used.

[1] TSAM-537
[2] virtual gfx::Size GetVisibleViewportSize() const = 0
    src/content/public/browser/render_widget_host_view.h

Reference: https://review.tizen.org/gerrit/278914

Change-Id: I2fc82ebe04d42d6a2ab21b1bb29d04f5037d4306
Signed-off-by: v-saha <v.saha@samsung.com>
16 files changed:
content/browser/web_contents/web_contents_view_aura.cc
content/common/features.gni
content/test/test_page_broadcast.cc
content/test/test_page_broadcast.h
third_party/blink/public/mojom/page/page.mojom
third_party/blink/renderer/core/exported/web_view_impl.cc
third_party/blink/renderer/core/exported/web_view_impl.h
tizen_src/chromium_impl/content/public/browser/web_contents_efl_delegate.h
tizen_src/ewk/efl_integration/browser/selectpicker/popup_menu_item.cc
tizen_src/ewk/efl_integration/browser/selectpicker/popup_menu_item_private.h
tizen_src/ewk/efl_integration/browser/selectpicker/popup_picker.cc
tizen_src/ewk/efl_integration/browser/selectpicker/popup_picker.h
tizen_src/ewk/efl_integration/eweb_view.cc
tizen_src/ewk/efl_integration/eweb_view.h
tizen_src/ewk/efl_integration/web_contents_efl_delegate_ewk.cc
tizen_src/ewk/efl_integration/web_contents_efl_delegate_ewk.h