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

Issue 774406 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: 2019-02-11
OS: Android
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Unable to scroll content loaded on webview using document.write()

Reported by vivekjos...@gmail.com, Oct 13 2017

Issue description

Steps to reproduce the problem:
1. Create a sample app with a webview
2. Create a sample html, say sample.html, with a javascript method, say replaceContent(), which takes a String as input and loads it to webview using document.write
3. Load sample.html to webview created in Step1
4. Invoke replaceContent() on webview created in Step1 with some new html content
5. Zoom in the content of webview and try scrolling

What is the expected behavior?
Scrolling should work in webview

What went wrong?
Content is not scrolling

Did this work before? Yes Not sure of the version

Chrome version: 61.0.3163.98  Channel: stable
OS Version: 8.0
Flash Version: 

Attaching both sample apk with issue and corresponding code. Ensure latest version of Android System WebView/Chrome app is installed to ensure that issue is reproducible
 
app-debug.apk
1.4 MB Download
SampleWebView.zip
24.9 MB Download
Cc: msrchandra@chromium.org nyerramilli@chromium.org sandeepkumars@chromium.org
Labels: Needs-triage-Mobile Needs-Feedback Triaged-Mobile
@vivekjoshikgp: Could you please provide us the sample html file and a screencast that would help us in triaging of the issue.

Thanks!!
I have attached sample.html file. I invoke replaceContent() from Android code to replace content of the webview

Also attached are two screenshots:
1. Screenshot_2017-10-13-19-21-24.png: This is the content originally loaded in WebView using loadData() method. Here scroll works fine
2. Screenshot_2017-10-13-19-21-18.png: This is the content loaded in WebView by replaceContent() method. Here scroll stops working after zoom.

I have already attached complete source code of sample app i built for this and the apk too if that helps. Let me know if you need any additional data.
sample.html
307 bytes View Download
Screenshot_2017-10-13-19-21-18.png
131 KB View Download
Screenshot_2017-10-13-19-21-24.png
83.7 KB View Download
Project Member

Comment 3 by sheriffbot@chromium.org, Oct 13 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "sandeepkumars@chromium.org" to the cc list and removing "Needs-Feedback" label.

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

Comment 4 by bokan@chromium.org, Oct 13 2017

Components: -Blink Blink>Scroll Mobile>WebView
Cc: ligim...@chromium.org
Labels: -Triaged-Mobile TE-NeedsTriageFromMTV WV-Triaged Needs-Bisect
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue in WebView. Unable to scroll the page.

Steps Followed:
1. Enabled WebView #61.0.3163.98
2. Installed Sample WebView .apk
3. Observed Unable to scroll the page.

Chrome versions tested:
61.0.3163.98

OS
Android 8.0.0

Android Devices
8.0.0 Pixel Build/OPR1 170623.027

Below is the Manual bisect info
=======================

WebView Good Build -- 61.0.3141.0
WebView Bad Build  -- 61.0.3142.0

https://chromium.googlesource.com/chromium/src/+log/61.0.3141.0..61.0.3142.0?pretty=fuller&n=10000

Requesting WebView team and adding appropriate labels for Per-cl bisect of this issue

Please navigate to below link for log's and video--
go/chrome-androidlogs/774406

Thanks!!
Labels: -TE-NeedsTriageFromMTV
Owner: sahel@chromium.org
Status: Assigned (was: Untriaged)
Per-CL bisect information:
Good commit:482415
Bad commit:482416

Suspect CL: https://chromium.googlesource.com/chromium/src/+/60b41cdfe22237cb667050017349375ca9272ccf


sahel@, if this issue is not related to your change please reassign it to me. 
Thanks!
Labels: -Needs-Bisect

Comment 8 by sahel@chromium.org, Oct 23 2017

Status: Started (was: Assigned)

Comment 9 by sahel@chromium.org, Nov 3 2017

Cc: bokan@chromium.org
The issue is reproducible on chrome as well. The suspected cl changes scroll handling logic in input_handler_proxy so that if the GSB event of a scroll sequence is ignored, GSU events of that sequence will get ignored as well. Before
applying this change the GSB would get ignored but the GSU events would still get sent to the main thread.

The root cause of this bug is that when you pinch zoom after using document.write, LayerTreeHostImpl::FindScrollNodeForDeviceViewportPoint (https://cs.chromium.org/chromium/src/cc/trees/layer_tree_host_impl.cc?type=cs&q=layer_tree_host_impl&sq=package:chromium&l=2860) fails to find the scrolling node and LayerTreeHostImpl::ScrollBeginImpl returns SCROLL_IGNORED as scroll_status, and with the change in r482416, GSU events are ignored as well.

There are two possible fixes:
1-change LayerTreeHostImpl::FindScrollNodeForDeviceViewportPoint to be able to find the scrolling node after using document.write and pinchzoom.
2- Change LayerTreeHostImpl::ScrollBeginImpl not to return Scroll_Ignored when no scrolling node is found.

bokan@ could you please take a look and see if you have a preference? (for the first solution I'll probably need to file a bug so that someone more familiar with this part of the code could fix it) 

Sahel, in the problematic case, does the page call document.close()? Is it the case that maybe we don't commit the changes to the compositor until the document is closed? Or does the problem occur even after document.close()?

Also, I'm surprised pinch-zoom should be special here, does the issue reproduce without pinch-zooming? i.e. is scroll prevented if you don't pinch zoom?

Comment 11 by sahel@chromium.org, Nov 10 2017

The page doesn't call document.close, but it only happens after pinch-zoom:
if you use document.write to have a scrollable content scrolling works without any problem. However, if you use document.write to add the new content that is not scrollable and then do a pinch zoom, scrolling doesn't work anymore even though it should.

Comment 12 by bokan@chromium.org, Dec 14 2017

Cc: pnangunoori@chromium.org
 Issue 793498  has been merged into this issue.
Sahel, are you still working on this issue? Any update about it?
NextAction: 2019-02-11
Status: Assigned (was: Started)
I stopped working on this, I will get back to this once I have fixed some of the iframe scrolling bugs.

Sign in to add a comment