New issue
Advanced search Search tips

Issue 698631 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Range.getClientRects return wrong rect position after WebView scroll horizontally

Reported by s704...@gmail.com, Mar 6 2017

Issue description

Steps to reproduce the problem:
1. WebView load a long  content by using loadDataWithBaseURL API.
2. I add a CSS rule to set multi column width and height to fit screen after I receive WebView onPageFinished callback.
3. Now it can be scrolled horizontally and look likes good.
4. I long touch the content and trigger Android selection and then use javascript to get the range like this:
var selection = window.getSelection();
var range = selection.getRangeAt(0);
var rects = range.getClientRects();

5. I got the wrong rect position when WebView scroll horizontally.

What is the expected behavior?
I reset the System WebView to version  37 ( 1602158-arm ) on Android 5.0 device.  The range.getClientRects is correct.  
If my screen width is 650 dp and it has 5 pages after  multi column.
The rect of each page should like this: 
page index 0: 0~650
page index 1: 650~1300
page index 2: 1300~1950
page index 3: 1950~2600
page index 4: 2600~3250

What went wrong?
Now I got the wrong rects like this:
The rect of each page should like this: 
page index 0: 0~650
page index 1: 650~1300
page index 2: 2400~3050
page index 3: 4550~5200
page index 4: 6250~6900

Did this work before? N/A 

Chrome version: 56.0.2924.87  Channel: stable
OS Version: android 5.0 and 6.0
Flash Version:

 
Components: -Blink Mobile>WebView Blink>Editing>Selection

Comment 2 by yosin@chromium.org, Mar 7 2017

Components: -Blink>Editing>Selection Blink>Editing Blink>Layout
Status: Available (was: Unconfirmed)
Cc: ntfschr@chromium.org
Labels: Needs-Feedback
s70487s@, could you please provide a compiled test apk for this? Which versions of WebView do you see this working for? And which versions do you see it broken for?

Comment 4 by yosin@chromium.org, Oct 4 2017

Labels: Pri-3
Project Member

Comment 5 by sheriffbot@chromium.org, Oct 4

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)
As already noted in comment #3 by ntfschr@, it looks like we need more information, e.g. provide sample HTML/CSS input where this issue happens, and the webview version. Does this happen with a recent WebView version? Version 37 mentioned on the issue seems a long way back..

Sign in to add a comment