New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
link

Issue 404315: Unify keyboard sizing behavior between ChromeOS and Android

Reported by aelias@chromium.org, Aug 16 2014 Project Member

Issue description

Currently, for on-screen-keyboards ChromeOS keeps the Blink viewport size stable and sets visible_viewport_size to a smaller value, whereas Android resizes the Blink viewport size, sets visible_viewport_size to the same value, and sets overdraw_bottom_height.  We should make the platforms more similar.
 

Comment 1 by bugdroid1@chromium.org, Aug 22 2014

Project Member
------------------------------------------------------------------
r291306 | aelias@chromium.org | 2014-08-22T01:40:01.835882Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/cc/trees/layer_tree_host.h?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/render_widget.cc?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/renderer_host/render_widget_host_view_base.cc?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/renderer_host/render_widget_host_view_base.h?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/render_view_impl.cc?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/gpu/render_widget_compositor.cc?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/android/content_view_core_impl.h?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/gpu/render_widget_compositor.h?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/public/test/render_view_test.cc?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/cc/trees/layer_tree_host_impl_unittest.cc?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/common/cc_messages.h?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/cc/trees/layer_tree_host_impl.cc?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/DOMUtils.java?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/devtools/renderer_overrides_handler.cc?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/cc/layers/layer_impl.cc?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/cc/layers/layer_impl.h?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/cc/layers/layer_position_constraint_unittest.cc?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/cc/output/compositor_frame_metadata.cc?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/cc/output/compositor_frame_metadata.h?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/renderer_host/render_widget_host_impl.h?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/render_widget.h?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/common/view_messages.h?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/renderer_host/render_widget_host_view_android.cc?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/android/content_view_core_impl.cc?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/renderer_host/render_widget_host_view_android.h?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/cc/trees/layer_tree_host_impl.h?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/cc/trees/layer_tree_impl.cc?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/screen_orientation/screen_orientation_browsertest.cc?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/cc/trees/layer_tree_impl.h?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/public/test/render_widget_test.cc?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/cc/trees/layer_tree_host.cc?r1=291306&r2=291305&pathrev=291306
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/renderer_host/render_widget_host_impl.cc?r1=291306&r2=291305&pathrev=291306

Replace overdraw_bottom_height with top_controls_layout_height.

This changes CC to trust Blink's inner container layer size and apply
Android top controls size as a delta on top of it. Prior to this patch,
on Android we would clobber what Blink told CC with a from-scratch
computation "physical device size - top controls impl size - keyboard
overdraw size".

This change makes it unnecessary for the renderer to be aware of
keyboard overdraw size, but on the other hand CC now must know about how
top controls size was applied to Blink layout size, to understand the
size coming from Blink. So this patch replaces one float with the other.

This simplifies the logic and is a step towards converging OSK codepaths
between platforms (since ChromeOS didn't use overdraw_bottom_height, but
used visible_viewport_size instead -- this patch unlocks the potential
use of the latter on Android as well).

NOTRY=true
BUG=404315

Review URL: https://codereview.chromium.org/476113004
-----------------------------------------------------------------

Comment 2 by bugdroid1@chromium.org, Aug 22 2014

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/587941db887bee1218079f253259316056a1b0fa

commit 587941db887bee1218079f253259316056a1b0fa
Author: aelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Fri Aug 22 01:40:01 2014

Replace overdraw_bottom_height with top_controls_layout_height.

This changes CC to trust Blink's inner container layer size and apply
Android top controls size as a delta on top of it. Prior to this patch,
on Android we would clobber what Blink told CC with a from-scratch
computation "physical device size - top controls impl size - keyboard
overdraw size".

This change makes it unnecessary for the renderer to be aware of
keyboard overdraw size, but on the other hand CC now must know about how
top controls size was applied to Blink layout size, to understand the
size coming from Blink. So this patch replaces one float with the other.

This simplifies the logic and is a step towards converging OSK codepaths
between platforms (since ChromeOS didn't use overdraw_bottom_height, but
used visible_viewport_size instead -- this patch unlocks the potential
use of the latter on Android as well).

NOTRY=true
BUG=404315

Review URL: https://codereview.chromium.org/476113004

Cr-Commit-Position: refs/heads/master@{#291306}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291306 0039d316-1c4b-4281-b951-d872f2087c98

Comment 3 by jdduke@chromium.org, Sep 4 2014

Alex, is this the primary tracking bug for pushing virtual viewport-based OSK resizing on Android?

Comment 4 by aelias@chromium.org, Sep 4 2014

#3: yes.

Comment 5 by rbyers@chromium.org, Sep 4 2014

Blockedon: chromium:148816
Cc: rbyers@chromium.org bokan@chromium.org nduca@chromium.org
Labels: Cr-Blink-Input
So this is blocked on finishing virtual viewport:  issue 148816 .

The open question is whether we can do this without allowing apps to somehow customize this behavior (eg. are there existing websites that adapt their UI for when they know the keyboard is up?).  So this bug may ultimately be blocked on issue 410894 (but we're not yet sure).

Comment 6 by aelias@chromium.org, Sep 4 2014

I don't recall ever seeing a mobile website that does something fancy on OSK bringup.  If some blocker does come up, note that it's possible to ship the rest of virtual viewport but maintain keyboard resizing the same way it is on Android now.

Comment 7 by rbyers@chromium.org, Jan 22 2015

Cc: aelias@chromium.org
Owner: bokan@chromium.org
bokan@ is driving this.

See this doc for some discussion: https://docs.google.com/document/d/1h0tKgGO5tk3Kma7kaYRUDy43xbChXMAFRMhZXwuWYXU/edit#heading=h.outn16su5mo6

Comment 8 by bokan@chromium.org, Mar 31 2015

Labels: VirtualViewport-Improvements

Comment 9 by bokan@chromium.org, Apr 7 2015

Labels: M-45

Comment 10 by rbyers@chromium.org, Apr 24 2015

Labels: Hotlist-Input-Dev

Comment 11 by rbyers@chromium.org, Apr 27 2015

Blocking: chromium:481607

Comment 12 by bokan@chromium.org, May 29 2015

Blockedon: chromium:464814

Comment 13 by rbyers@chromium.org, Jun 16 2015

Blocking: chromium:500012

Comment 14 by bokan@chromium.org, Jul 20 2015

Labels: -M-45 M-46

Comment 15 by bokan@chromium.org, Aug 17 2015

Labels: -M-46 M-47

Comment 16 by bokan@chromium.org, Sep 23 2015

Owner: ymalik@chromium.org

Comment 17 by changwan@chromium.org, Oct 13 2015

Cc: jdduke@chromium.org
For Android, how can we tell exactly where to scroll at? Input view and/or candidate view height may vary among different input methods, so I'm curious.

Comment 18 by bokan@chromium.org, Dec 2 2015

Cc: klo...@chromium.org ymalik@chromium.org
 Issue 490618  has been merged into this issue.

Comment 19 by ymalik@chromium.org, Jan 5 2016

Status: Started

Comment 20 by bugdroid1@chromium.org, Jan 20 2016

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7dd28324d2477475b898b10c6ffc7d0b62bd92b5

commit 7dd28324d2477475b898b10c6ffc7d0b62bd92b5
Author: aelias <aelias@chromium.org>
Date: Wed Jan 20 09:17:45 2016

Delete code involving overdraw bottom height.

This code follows up r291306 making renderer-reported overdraw_bottom_height
always zero, with some late deletion of dead code that was downstream at the
time.  This also deletes two pieces of not-strictly-dead code that appear no
longer to do anything useful:

1) The workaround for http://crbug.com/440469.  I can no longer reproduce on a
Lollipop Nexus 10 with the workaround deleted.

2) Mutation of mCachedVisibleViewport.  When we don't have a visible renderer,
overdraw_bottom_height was populated with the View information, so in
theory the mutation could've done something.  overdraw_bottom_height was
zero the vast majority of the time, though, so it seems unlikely that any layout
relies on this.

BUG=404315

Review URL: https://codereview.chromium.org/1584993002

Cr-Commit-Position: refs/heads/master@{#370355}

[modify] http://crrev.com/7dd28324d2477475b898b10c6ffc7d0b62bd92b5/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorView.java
[modify] http://crrev.com/7dd28324d2477475b898b10c6ffc7d0b62bd92b5/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorViewHolder.java
[modify] http://crrev.com/7dd28324d2477475b898b10c6ffc7d0b62bd92b5/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutRenderHost.java
[modify] http://crrev.com/7dd28324d2477475b898b10c6ffc7d0b62bd92b5/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
[modify] http://crrev.com/7dd28324d2477475b898b10c6ffc7d0b62bd92b5/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/layouts/MockLayoutHost.java
[modify] http://crrev.com/7dd28324d2477475b898b10c6ffc7d0b62bd92b5/chrome/android/javatests/src/org/chromium/chrome/browser/media/remote/CastTestBase.java
[modify] http://crrev.com/7dd28324d2477475b898b10c6ffc7d0b62bd92b5/chrome/browser/android/compositor/compositor_view.cc
[modify] http://crrev.com/7dd28324d2477475b898b10c6ffc7d0b62bd92b5/chrome/browser/android/compositor/compositor_view.h
[modify] http://crrev.com/7dd28324d2477475b898b10c6ffc7d0b62bd92b5/content/public/android/java/src/org/chromium/content/browser/ContentViewClient.java
[modify] http://crrev.com/7dd28324d2477475b898b10c6ffc7d0b62bd92b5/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Comment 21 by bugdroid1@chromium.org, Mar 16 2016

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3edbd8d05df275432f79649ac740070d329b26ea

commit 3edbd8d05df275432f79649ac740070d329b26ea
Author: ymalik <ymalik@chromium.org>
Date: Wed Mar 16 23:37:01 2016

Resize only the virtual viewport when the OSK triggers a resize.

Initial CL in unifying the keyboard behavior between ChromeOS and Android.
If the enable-osk-overscroll flag is set, this change will keep the Blink
viewport size stable and set the visible_viewport_size to the smaller value.

This CL adds a new View (InsetObserverView) to the View hierarchy that will
store the value of insets (OSK, status bar). When there is a resize due to
OSK show, we keep the view bounds the same and change the visible viewport
size.

Design doc: http://go/osk-unification

BUG=404315

Review URL: https://codereview.chromium.org/1386403003

Cr-Commit-Position: refs/heads/master@{#381590}

[modify] https://crrev.com/3edbd8d05df275432f79649ac740070d329b26ea/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
[modify] https://crrev.com/3edbd8d05df275432f79649ac740070d329b26ea/chrome/android/java/src/org/chromium/chrome/browser/ChromeSwitches.java
[add] https://crrev.com/3edbd8d05df275432f79649ac740070d329b26ea/chrome/android/java/src/org/chromium/chrome/browser/InsetObserverView.java
[modify] https://crrev.com/3edbd8d05df275432f79649ac740070d329b26ea/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
[add] https://crrev.com/3edbd8d05df275432f79649ac740070d329b26ea/chrome/android/javatests/src/org/chromium/chrome/browser/OSKOverscrollTest.java
[modify] https://crrev.com/3edbd8d05df275432f79649ac740070d329b26ea/chrome/app/generated_resources.grd
[modify] https://crrev.com/3edbd8d05df275432f79649ac740070d329b26ea/chrome/browser/about_flags.cc
[modify] https://crrev.com/3edbd8d05df275432f79649ac740070d329b26ea/content/browser/android/content_view_core_impl.cc
[modify] https://crrev.com/3edbd8d05df275432f79649ac740070d329b26ea/content/browser/android/content_view_core_impl.h
[modify] https://crrev.com/3edbd8d05df275432f79649ac740070d329b26ea/content/browser/renderer_host/render_widget_host_view_android.cc
[modify] https://crrev.com/3edbd8d05df275432f79649ac740070d329b26ea/content/browser/renderer_host/render_widget_host_view_android.h
[modify] https://crrev.com/3edbd8d05df275432f79649ac740070d329b26ea/content/public/android/java/src/org/chromium/content/browser/ContentViewClient.java
[modify] https://crrev.com/3edbd8d05df275432f79649ac740070d329b26ea/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
[modify] https://crrev.com/3edbd8d05df275432f79649ac740070d329b26ea/content/public/common/content_switches.cc
[modify] https://crrev.com/3edbd8d05df275432f79649ac740070d329b26ea/content/public/common/content_switches.h
[modify] https://crrev.com/3edbd8d05df275432f79649ac740070d329b26ea/tools/metrics/histograms/histograms.xml

Comment 22 by changwan@chromium.org, Mar 17 2016

Blocking: 595613

Comment 23 by changwan@chromium.org, Mar 17 2016

Blocking: -595613

Comment 24 by ymalik@chromium.org, Mar 17 2016

Labels: -M-47 M-52

Comment 25 by bokan@chromium.org, Mar 24 2016

Blocking: 595210

Comment 26 by sheriffbot@chromium.org, Jun 1 2016

Project Member
Labels: -M-52 M-53 MovedFrom-52
Moving this nonessential bug to the next milestone.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 27 by sheriffbot@chromium.org, Jul 19 2016

Project Member
Labels: -M-53 MovedFrom-53
This issue has been moved once and is lower than Pri-1. Removing the milestone.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 28 by ymalik@chromium.org, Aug 4 2016

Blockedon: 597772

Comment 29 by ymalik@chromium.org, Aug 4 2016

Blockedon: 598182

Comment 30 by aelias@chromium.org, Aug 5 2016

Blockedon: -597772

Comment 31 by bokan@chromium.org, Oct 27 2016

 Issue 548951  has been merged into this issue.

Comment 32 by bokan@chromium.org, Oct 27 2016

 Issue 481607  has been merged into this issue.

Comment 33 by aelias@chromium.org, Nov 4 2016

Blockedon: 595826

Comment 34 by aelias@chromium.org, Nov 4 2016

Cc: mdjones@chromium.org

Comment 35 by ymalik@chromium.org, Nov 16 2016

Owner: bokan@chromium.org

Comment 36 by e...@chromium.org, Nov 17 2016

Cc: jam...@chromium.org wjmaclean@chromium.org meh@chromium.org wangxianzhu@chromium.org trchen@chromium.org tedc...@chromium.org enne@chromium.org
 Issue 341625  has been merged into this issue.

Comment 37 by bokan@chromium.org, Dec 1 2016

Cc: sadrul@chromium.org tbuck...@chromium.org bshe@chromium.org
 Issue 412482  has been merged into this issue.

Comment 38 by aelias@chromium.org, Dec 2 2016

Blocking: 363182 356689

Comment 39 by bokan@chromium.org, Dec 12 2016

Blocking: 634333

Comment 40 by bokan@chromium.org, Feb 22 2017

Blocking: 270018

Comment 41 by bokan@chromium.org, Mar 1 2017

Blockedon: 697457

Comment 42 by bokan@chromium.org, Mar 1 2017

Blockedon: 697463

Comment 43 by bokan@chromium.org, Mar 1 2017

Blockedon: -595826

Comment 44 by mp...@benbria.ca, Jun 30 2017

What is the expected behaviour of the OSK when interacting with a Chrome OS full screen kiosk application?

Comment 45 by mp...@benbria.ca, Jun 30 2017

When using OSK, focusing on input/textarea fields does not auto-scroll them into view when running within a Chrome App in fullscreen window mode.

To reproduce you need a Chrome OS device that relies on OSK (Chromebook Flip in Tablet mode).

Download and install this kiosk app: https://chrome.google.com/webstore/detail/kiosk/afhcomalholahplbjhnmahkoekoijban?hl=en

Setup the URL of the kiosk webview to load:
http://www.scirra.com/labs/bugs/spa-input.html

Select one of the inputs at the bottom of the screen, observe the OSK appears and covers the inputs.

Expected behaviour is that the page should automatically scroll so that the input is visible. This is what occurs on the same page when loaded in Chrome in regular browser mode.

Comment 46 by vijay.ka...@pearson.com, Jan 3 2018

Any update on this?

Comment 47 by symbian....@gmail.com, Jan 4 2018

^^ bump. Any updates on the status? 

https://www.chromestatus.com/feature/5656077370654720#

Comment 48 by bokan@chromium.org, Jan 4 2018

Labels: -Pri-2 Pri-3
Unfortunately, this is likely to require a good bit of work and attention as it could have significant compat and interop risks so it's not something I have bandwidth for in the near-term.

I do intend to fix some of the highly-starred issues that this is blocked on in this quarter since those were originally blocked on this bug expecting a shorter resolution.

Comment 49 by bokan@chromium.org, Mar 1 2018

Blockedon: 773076

Comment 50 by bokan@chromium.org, Mar 21 2018

Blocking: -270018

Comment 51 by mp...@benbria.ca, Mar 27 2018

For what its worth, this issue is still a concern for us. OSK behaviour is still odd in the sense that it does not scroll a webview such that focused items are in view as expected.

In particular, this hurts the use case of kiosk applications run on Chromebooks.

Comment 52 by bokan@chromium.org, Mar 27 2018

Re #51, I think that's a separate concern. This bug is tracking extending ChromeOS' model to Android since ChromeOS tends to work better in many cases. I'm guessing you may be hitting a specific bug WRT <webview>. Could you please file a separate bug for that with clear steps on how to reproduce? Feel free to assign/cc me on that.

Comment 53 by mp...@benbria.ca, Mar 27 2018

I see. Well my point is Android correctly handles OSK and scrolling webview content to keep focused input/textarea elements on screen when the OSK is displayed so I'm not sure this warrants going through all the steps to create another issue.

I described steps to reproduce the problem already in #45 almost a year ago.

If you need further clarity or help, I would be happy to oblige.

Comment 54 by bokan@chromium.org, Mar 27 2018

Ah, sorry, I missed that. I'll try to take a look at your repro steps tomorrow.

Comment 55 by mp...@benbria.ca, Mar 28 2018

Thank you, we really appreciate it.

Moreover, outside of a Chrome App's webview, the behaviour of the OSK interacting with the same web site with Chrome worked fine too. There is something about a Chrome App running a full screen webview that isn't quite the same as a normal browser.

Comment 56 by bokan@chromium.org, Mar 28 2018

Ok, repro'd your bug, looks like that's  issue 740223 . I'll follow up there.

Comment 57 by vijay.ka...@pearson.com, Jan 10

Hello, Any update on this?

Comment 58 by bokan@chromium.org, Jan 10

Cc: -trchen@chromium.org
Labels: OS-Android
Owner: ----
Status: Available (was: Started)
Unfortunately not, no one is actively working on this at the moment and it's fairly low priority so unlikely to happen in the near future.

Comment 59 by bokan@chromium.org, Feb 5

Cc: twelling...@chromium.org chelamcherla@chromium.org
 Issue 920754  has been merged into this issue.

Sign in to add a comment