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

Issue 614746 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
inactive
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Selecting HTML select element causes page to scroll to top in webview shell browser

Project Member Reported by aluo@chromium.org, May 25 2016

Issue description

This report will ONLY be viewable by Google.

Device name: Nexus 9
Android version: NRD54
Fingerprint:
WebView version (from system settings -> Apps -> Android System WebView): 52.0.2743.6
Application: Webview Shell Browser
Application version: 1.0

URLs (if applicable): https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select


Steps to reproduce:
(1) Tap on Select element on page

Expected result:
Drop down menu appears, page stays at same place

Actual result:
Drop down menu appears, page has scrolled to the top


Issue does not happen in Chrome.
Issue does not happen in 51.0.2704.61 Monochrome version.
 

Comment 1 by sgu...@chromium.org, May 25 2016

Owner: hush@chromium.org
Labels: -Type-Bug Type-Bug-Regression
Status: Assigned (was: Unconfirmed)

Comment 3 by aluo@chromium.org, May 26 2016

Labels: Needs-Bisect

Comment 4 by aluo@chromium.org, May 26 2016

So this issue is specific to Monochrome or Android N.  I tested with Android M and don't see this issue.  Here's some details:

On Android M (using MOB30M), behavior in m52 back to m44 is the same.  When the select menu would drop down past the bottom of screen, then the page jumps up so that the select element is centered on page.

On Android N (tried NRD27 and NRD54), tested back to 51.0.2693.0 build, the behavior changed.  The page would jump to the top when select is tapped, even if it would not have dropped down past the bottom of screen.  This didn't happen all the time, so that's why I thought 51.0.2704.61 was not broken when I tested it.

Comment 5 by aluo@chromium.org, May 26 2016

Labels: -ReleaseBlock-Beta -M-52 M-51

Comment 6 by aluo@chromium.org, May 26 2016

Labels: NYC-te

Comment 7 by aluo@chromium.org, May 27 2016

Labels: -Needs-Bisect

Comment 8 by aluo@chromium.org, May 27 2016

Labels: ReleaseBlock-Stable
Does not happen on phones as the select UI is different.  Also does not happen in Chrome.

Comment 9 by hush@chromium.org, May 27 2016

Cc: sgu...@chromium.org amineer@chromium.org
Labels: -ReleaseBlock-Stable
Hello Alex,
I don't think this is m51 RBS worthy.

First of all, the same version of WebView/MonoChrome (either m51 or m52) works fine on L and M, but not on N.

Secondly, this happens on m50 too. 
I just managed to install 50.0.2661.35 WebView onto NYC RYU, and the issue still reproduces. So even if this a webview issue, it is not a regression. 50.0.2661.35 is the last m50 amineer dropped to Android source tree, by the way. (Later versions of m50 can't be installed on NYC, for some weird reasons. But let's not care about that for now)

We'll investigate more to determine the root cause. I'm removing RBS now.

Comment 10 by hush@chromium.org, May 28 2016

NRC42 is the earliest Android N build that contains an m50 WebView.
aluo@ can you flash a tablet with that build and try?
I'm suspecting this is somehow caused by Android framework change.
Labels: ReleaseBlock-Stable
If this does not repro on an older android build, aluo@ - please file a b/ bug and link it back here so that we can track it and mark the status here as ExternalDependency.  I'm adding the RB-Stable tag back, because I want to have some way to follow up with the Android team if this is in fact their fault.

Comment 12 by hush@chromium.org, May 28 2016

(Just documenting the discoveries here) 
This is the callback that caused webview to scroll to the top once the DropDownList is shown.
05-28 00:26:37.272  3880  3880 I hush    : 	at org.chromium.android_webview.AwScrollOffsetManager.onContainerViewOverScrolled(AwScrollOffsetManager.java:213)
05-28 00:26:37.272  3880  3880 I hush    : 	at org.chromium.android_webview.AwContents$AwViewMethodsImpl.onContainerViewOverScrolled(AwContents.java:3219)
05-28 00:26:37.272  3880  3880 I hush    : 	at org.chromium.android_webview.AwContents.onContainerViewOverScrolled(AwContents.java:1735)
05-28 00:26:37.272  3880  3880 I hush    : 	at com.android.webview.chromium.WebViewChromium.onOverScrolled(WebViewChromium.java:1667)
05-28 00:26:37.272  3880  3880 I hush    : 	at android.webkit.WebView.onOverScrolled(WebView.java:2513)
05-28 00:26:37.272  3880  3880 I hush    : 	at android.view.View.overScrollBy(View.java:20883)
05-28 00:26:37.272  3880  3880 I hush    : 	at android.webkit.WebView.-wrap2(WebView.java)
05-28 00:26:37.272  3880  3880 I hush    : 	at android.webkit.WebView$PrivateAccess.overScrollBy(WebView.java:2200)
05-28 00:26:37.272  3880  3880 I hush    : 	at com.android.webview.chromium.WebViewChromium$InternalAccessAdapter.overScrollBy(WebViewChromium.java:2276)
05-28 00:26:37.272  3880  3880 I hush    : 	at org.chromium.android_webview.AwContents$AwScrollOffsetManagerDelegate.overScrollContainerViewBy(AwContents.java:608)
05-28 00:26:37.272  3880  3880 I hush    : 	at org.chromium.android_webview.AwScrollOffsetManager.scrollBy(AwScrollOffsetManager.java:190)
05-28 00:26:37.272  3880  3880 I hush    : 	at org.chromium.android_webview.AwScrollOffsetManager.requestChildRectangleOnScreen(AwScrollOffsetManager.java:373)
05-28 00:26:37.272  3880  3880 I hush    : 	at org.chromium.android_webview.AwContents.requestChildRectangleOnScreen(AwContents.java:1743)
05-28 00:26:37.272  3880  3880 I hush    : 	at com.android.webview.chromium.WebViewChromium.requestChildRectangleOnScreen(WebViewChromium.java:2041)
05-28 00:26:37.272  3880  3880 I hush    : 	at android.webkit.WebView.requestChildRectangleOnScreen(WebView.java:2604)
05-28 00:26:37.272  3880  3880 I hush    : 	at android.view.View.requestRectangleOnScreen(View.java:5997)
05-28 00:26:37.272  3880  3880 I hush    : 	at android.widget.PopupWindow.findDropDownPosition(PopupWindow.java:1565)
05-28 00:26:37.272  3880  3880 I hush    : 	at android.widget.PopupWindow.showAsDropDown(PopupWindow.java:1216)
05-28 00:26:37.272  3880  3880 I hush    : 	at android.widget.ListPopupWindow.show(ListPopupWindow.java:671)
05-28 00:26:37.272  3880  3880 I hush    : 	at org.chromium.ui.DropdownPopupWindow.show(DropdownPopupWindow.java:136)
05-28 00:26:37.272  3880  3880 I hush    : 	at org.chromium.content.browser.input.SelectPopupDropdown.show(SelectPopupDropdown.java:77)
05-28 00:26:37.272  3880  3880 I hush    : 	at org.chromium.content.browser.ContentViewCore.showSelectPopup(ContentViewCore.java:2574)
05-28 00:26:37.272  3880  3880 I hush    : 	at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
05-28 00:26:37.272  3880  3880 I hush    : 	at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:39)
05-28 00:26:37.272  3880  3880 I hush    : 	at android.os.Handler.dispatchMessage(Handler.java:102)
05-28 00:26:37.272  3880  3880 I hush    : 	at android.os.Looper.loop(Looper.java:154)
05-28 00:26:37.272  3880  3880 I hush    : 	at android.app.ActivityThread.main(ActivityThread.java:6018)
05-28 00:26:37.272  3880  3880 I hush    : 	at java.lang.reflect.Method.invoke(Native Method)
05-28 00:26:37.272  3880  3880 I hush    : 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:801)
05-28 00:26:37.272  3880  3880 I hush    : 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:691)

Comment 13 by aluo@chromium.org, May 28 2016

Status: ExternalDependency (was: Assigned)
Thanks Hush, issue does not happen on NRC42, have opened a b/ bug and cc'd everyone.  I'll do some more bisecting on Android Tuesday.
Labels: -Restrict-View-Google

Comment 15 by hush@chromium.org, May 28 2016

When the DropDownPopup is shown, the Android platform calls requestChildRectOnScreen with rect(top=0, left=0, bottom=482, right=295). That's why webview is forced to scroll to top.

Comment 16 by aluo@chromium.org, May 31 2016

External Dependency buganizer bug id is: 29010381
Labels: -M-51 M-52
Status: Assigned (was: ExternalDependency)
Removing external dependency status since we're going to have to fix this in Chrome / WebView.

Marking as RB-Stable for M52 since we don't have time to close in M51.
Project Member

Comment 18 by bugdroid1@chromium.org, Jun 10 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/87634341cb230c465a1d2c5cdb09f79c0a97bc08

commit 87634341cb230c465a1d2c5cdb09f79c0a97bc08
Author: hush <hush@chromium.org>
Date: Fri Jun 10 21:35:38 2016

Fix DropdownPopupWindow's position in Android N.

In Android N, the framework will read view.getLeft() and view.getTop() to
determine where to put the drop down, and if the anchor view is not on screen,
the parent view will be scrolled to make it on screen (by means of
requestChildRectangleOnScreen).

setLayoutParams() is not enough to change left and top values of the anchorView
immediately. Show()ing the ListPopupWindow immediately after setLayoutParams()
will show the popup window in the wrong location, and also cause the parent view
to be improperly scrolled.

Call postShow() to put show() after when the layout of the anchor view is
changed.

Initial selection has to be set after show() is actually called,
because getListView() is null until the ListPopupWindow is shown.

BUG= 614746 

Review-Url: https://codereview.chromium.org/2049523005
Cr-Commit-Position: refs/heads/master@{#399274}

[modify] https://crrev.com/87634341cb230c465a1d2c5cdb09f79c0a97bc08/content/public/android/java/src/org/chromium/content/browser/input/SelectPopupDropdown.java
[modify] https://crrev.com/87634341cb230c465a1d2c5cdb09f79c0a97bc08/ui/android/java/src/org/chromium/ui/DropdownPopupWindow.java

Comment 19 by hush@chromium.org, Jun 10 2016

Labels: Merge-Request-52

Comment 20 by tin...@google.com, Jun 10 2016

Labels: -Merge-Request-52 Merge-Approved-52 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M52 (branch: 2743)
Project Member

Comment 21 by bugdroid1@chromium.org, Jun 11 2016

Labels: -merge-approved-52 merge-merged-2743
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/80a41c4e6e833c56f88ba2a4ed755be308e6a66a

commit 80a41c4e6e833c56f88ba2a4ed755be308e6a66a
Author: Hui Shu <hush@google.com>
Date: Fri Jun 10 23:59:12 2016

Fix DropdownPopupWindow's position in Android N.

In Android N, the framework will read view.getLeft() and view.getTop() to
determine where to put the drop down, and if the anchor view is not on screen,
the parent view will be scrolled to make it on screen (by means of
requestChildRectangleOnScreen).

setLayoutParams() is not enough to change left and top values of the anchorView
immediately. Show()ing the ListPopupWindow immediately after setLayoutParams()
will show the popup window in the wrong location, and also cause the parent view
to be improperly scrolled.

Call postShow() to put show() after when the layout of the anchor view is
changed.

Initial selection has to be set after show() is actually called,
because getListView() is null until the ListPopupWindow is shown.

BUG= 614746 

Review-Url: https://codereview.chromium.org/2049523005
Cr-Commit-Position: refs/heads/master@{#399274}
(cherry picked from commit 87634341cb230c465a1d2c5cdb09f79c0a97bc08)

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

Cr-Commit-Position: refs/branch-heads/2743@{#323}
Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939}

[modify] https://crrev.com/80a41c4e6e833c56f88ba2a4ed755be308e6a66a/content/public/android/java/src/org/chromium/content/browser/input/SelectPopupDropdown.java
[modify] https://crrev.com/80a41c4e6e833c56f88ba2a4ed755be308e6a66a/ui/android/java/src/org/chromium/ui/DropdownPopupWindow.java

Comment 22 by hush@chromium.org, Jun 13 2016

Status: Fixed (was: Assigned)

Comment 23 by boliu@chromium.org, Jun 13 2016

Issue 607708 has been merged into this issue.

Comment 24 by aluo@chromium.org, Jun 13 2016

Status: Verified (was: Fixed)
Verified issue is fixed on latest M52 and 53 builds on Nexus 9.
Project Member

Comment 25 by bugdroid1@chromium.org, Jun 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/87634341cb230c465a1d2c5cdb09f79c0a97bc08

commit 87634341cb230c465a1d2c5cdb09f79c0a97bc08
Author: hush <hush@chromium.org>
Date: Fri Jun 10 21:35:38 2016

Fix DropdownPopupWindow's position in Android N.

In Android N, the framework will read view.getLeft() and view.getTop() to
determine where to put the drop down, and if the anchor view is not on screen,
the parent view will be scrolled to make it on screen (by means of
requestChildRectangleOnScreen).

setLayoutParams() is not enough to change left and top values of the anchorView
immediately. Show()ing the ListPopupWindow immediately after setLayoutParams()
will show the popup window in the wrong location, and also cause the parent view
to be improperly scrolled.

Call postShow() to put show() after when the layout of the anchor view is
changed.

Initial selection has to be set after show() is actually called,
because getListView() is null until the ListPopupWindow is shown.

BUG= 614746 

Review-Url: https://codereview.chromium.org/2049523005
Cr-Commit-Position: refs/heads/master@{#399274}

[modify] https://crrev.com/87634341cb230c465a1d2c5cdb09f79c0a97bc08/content/public/android/java/src/org/chromium/content/browser/input/SelectPopupDropdown.java
[modify] https://crrev.com/87634341cb230c465a1d2c5cdb09f79c0a97bc08/ui/android/java/src/org/chromium/ui/DropdownPopupWindow.java

Project Member

Comment 26 by bugdroid1@chromium.org, Jun 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/80a41c4e6e833c56f88ba2a4ed755be308e6a66a

commit 80a41c4e6e833c56f88ba2a4ed755be308e6a66a
Author: Hui Shu <hush@google.com>
Date: Fri Jun 10 23:59:12 2016

Fix DropdownPopupWindow's position in Android N.

In Android N, the framework will read view.getLeft() and view.getTop() to
determine where to put the drop down, and if the anchor view is not on screen,
the parent view will be scrolled to make it on screen (by means of
requestChildRectangleOnScreen).

setLayoutParams() is not enough to change left and top values of the anchorView
immediately. Show()ing the ListPopupWindow immediately after setLayoutParams()
will show the popup window in the wrong location, and also cause the parent view
to be improperly scrolled.

Call postShow() to put show() after when the layout of the anchor view is
changed.

Initial selection has to be set after show() is actually called,
because getListView() is null until the ListPopupWindow is shown.

BUG= 614746 

Review-Url: https://codereview.chromium.org/2049523005
Cr-Commit-Position: refs/heads/master@{#399274}
(cherry picked from commit 87634341cb230c465a1d2c5cdb09f79c0a97bc08)

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

Cr-Commit-Position: refs/branch-heads/2743@{#323}
Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939}

[modify] https://crrev.com/80a41c4e6e833c56f88ba2a4ed755be308e6a66a/content/public/android/java/src/org/chromium/content/browser/input/SelectPopupDropdown.java
[modify] https://crrev.com/80a41c4e6e833c56f88ba2a4ed755be308e6a66a/ui/android/java/src/org/chromium/ui/DropdownPopupWindow.java

Sign in to add a comment