Fix support for navigating page contents using arrow keys.
authorPiotr Tworek <p.tworek@samsung.com>
Thu, 19 Mar 2015 10:18:28 +0000 (11:18 +0100)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
commit566129e6666a0dfa15be2045b6335930d365edd7
tree1bce2b6fada3eb0c938264ebe94d131c25770b4e
parentabf165da522bba5033df659b24dcb19bb76c1008
Fix support for navigating page contents using arrow keys.

While investigating text selection code in our port I've noticed that we
can't use arrow keys to navigate page contents or select text when the
active page contains active input field. The problem was reproducible
only in applications which contain some sort of UI, it was not visible
in efl_webview_app. The issue also happens on beta/m40 so it's not
something that was broken during refactoring.

After investigating it I found out that whenever there is more than one
Elementary widget in a given tree EFL uses arrow keys to navigate between
them. In our case the webview is actually a single component from
EFL/Elementary POV (an image). It does deliver rrrow key events to our
evas event handlers, but also performs it's default action for those keys
afterards. The default action usually moves active focus to a widget that
is closes to the webview in any given direction.

After going through EFL/Elementary docs I've found out that the best
solution in our case would be to get an exclusive grab of the fuction
keys which we do want to handle whenever our webview implementation
gains active focus. For this purpose we can use evas_object_key_grab and
evas_object_key_ungrab functions. The problem is that did not work.

The problem with grab/ungrab functions was caused by the fact that
elementary widget representing our RWHV had an elementary parent
(WebContentsViewEfl::native_view_), but it was not being added into it's
layout tree. To be able to do this however, we need to have a parent widget
thas acts as a stack of widgets. Previous elm_bg object did not satisfy this
requirement. Fortunately elementary naviframe object does seem to be
good enough for our requirements.

This patch performs the necessary changes to suppport proper handling of
arrow function keys inside rwhv native widget. With the patch in place
it's possible to use arrow keys to navigate text input boxes, select
text, move spatial navigation focus, etc. This should be really useful
ot TV targets where directional keys are often used to navigate the
page.

Change-Id: Ia3d1650cb777faaab7f82a8f3b1013a2ba28e974
Signed-off-by: Piotr Tworek <p.tworek@samsung.com>
tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc
tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.h
tizen_src/chromium_impl/content/browser/web_contents/web_contents_view_efl.cc
tizen_src/chromium_impl/content/browser/web_contents/web_contents_view_efl.h