Autoscroll issue after showing IME
authorDongjun Kim <djmix.kim@samsung.com>
Wed, 11 Feb 2015 04:22:01 +0000 (13:22 +0900)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
Page is not resized if select picker menu hides item on page.
So we need to add function for auto-scroll after
"OnInputPanelStateChanged" and "HandleResize".

BUG: http://107.108.218.239/bugzilla/show_bug.cgi?id=10843
Reviewed by: Hyunhak Kim, Piotr Grad

Change-Id: I2ad0a1e4830c8ead519feac10213baf9aa3a7d81
Signed-off-by: Dongjun Kim <djmix.kim@samsung.com>
tizen_src/impl/browser/renderer_host/im_context_efl.cc
tizen_src/impl/browser/renderer_host/im_context_efl.h
tizen_src/impl/browser/renderer_host/render_widget_host_view_efl.cc
tizen_src/impl/browser/renderer_host/render_widget_host_view_efl.h
tizen_src/impl/eweb_view.cc
tizen_src/impl/eweb_view.h

index e6162fc..17714c7 100644 (file)
@@ -427,6 +427,8 @@ void IMContextEfl::OnInputPanelStateChanged(int state) {
   if (state == ECORE_IMF_INPUT_PANEL_STATE_SHOW) {
     IM_CTX_LOG << ": show";
     view_->eweb_view()->SmartCallback<EWebViewCallbacks::IMEInputPanelShow>().call();
+    view_->eweb_view()->ScrollFocusedEditableNode();
+
   } else if (state == ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
     IM_CTX_LOG << ": hide";
     view_->eweb_view()->SmartCallback<EWebViewCallbacks::IMEInputPanelHide>().call();
@@ -473,6 +475,10 @@ bool IMContextEfl::IsShow() {
   return context_ && is_focused_ && IsIMFVisible(context_);
 }
 
+bool IMContextEfl::IsImePanelVisible() {
+  return context_ && IsIMFVisible(context_);
+}
+
 void IMContextEfl::ClearQueues() {
   while (!commit_queue_.empty()) {
     commit_queue_.pop();
@@ -536,5 +542,4 @@ RenderWidgetHostImpl* IMContextEfl::GetRenderWidgetHostImpl() const {
     return NULL;
   return RenderWidgetHostImpl::From(rwh);
 }
-
 } // namespace content
index 582d40b..6434eac 100644 (file)
@@ -50,6 +50,7 @@ class IMContextEfl {
   void ConfirmComposition();
   void SetIsInFormTag(bool is_in_form_tag);
   bool IsShow();
+  bool IsImePanelVisible();
   gfx::Rect GetIMERect() const { return ime_rect_; }
   void SetIMERect(const gfx::Rect& rect) { ime_rect_ = rect; }
   CommitQueue GetCommitQueue() { return commit_queue_; }
index 191f402..48c8fc5 100644 (file)
@@ -682,13 +682,6 @@ void RenderWidgetHostViewEfl::OnTextInputStateChanged(
 
     if (web_view_)
       web_view_->QuerySelectionStyle();
-
-    if (params.show_ime_if_needed) {
-      // The empty rect is not used as long as
-      // m_autoZoomFocusedNodeToLegibleScale in WebSettingsImpl
-      // is turned on
-      host_->ScrollFocusedEditableNodeIntoRect(gfx::Rect(0, 0, 0, 0));
-    }
   }
 
   if (GetSelectionController()) {
@@ -1131,6 +1124,9 @@ void RenderWidgetHostViewEfl::HandleResize(int width, int height) {
   // Have to use UpdateScreenInfo(GetNativeView()); when real native surface is used.
   UpdateScreenInfo(GetNativeView());
   host_->WasResized();
+
+  if (im_context_ && im_context_->IsImePanelVisible())
+    ScrollFocusedEditableNode();
 }
 
 void RenderWidgetHostViewEfl::HandleFocusIn() {
@@ -1831,4 +1827,9 @@ void RenderWidgetHostViewEfl::SetViewMode(tizen_webview::View_Mode view_mode) {
 gfx::Vector2d RenderWidgetHostViewEfl::scroll_offset() const {
   return scroll_detector_->GetLastScrollPosition();
 }
+
+void RenderWidgetHostViewEfl::ScrollFocusedEditableNode() {
+  host_->ScrollFocusedEditableNodeIntoRect(gfx::Rect(0, 0, 0, 0));
+}
+
 }  // namespace content
index 4f9c2f8..27a186a 100644 (file)
@@ -246,6 +246,8 @@ class RenderWidgetHostViewEfl
   void DetectContentOnPosition(int x, int y);
 #endif
 
+  void ScrollFocusedEditableNode();
+
  protected:
   friend class RenderWidgetHostView;
 
index b20006c..68b0375 100644 (file)
@@ -2164,6 +2164,11 @@ gfx::Rect EWebView::GetIMERect() {
   return gfx::Rect();
 }
 
+void EWebView::ScrollFocusedEditableNode() {
+  if (rwhv())
+    rwhv()->ScrollFocusedEditableNode();
+}
+
 void EWebView::LoadNotFoundErrorPage(const std::string& invalidUrl) {
   RenderViewHost* render_view_host = web_contents_->GetRenderViewHost();
   if (render_view_host)
index 396aeb9..592af0a 100644 (file)
@@ -446,6 +446,7 @@ class EWebView {
 
   bool IsIMEShow();
   gfx::Rect GetIMERect();
+  void ScrollFocusedEditableNode();
 
   // Returns TCP port number with Inspector, or 0 if error.
   int StartInspectorServer(int port = 0);