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

Issue 601350 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner:
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Unable to get correct scrollHeight of div tag which contains table

Reported by r9852508...@gmail.com, Apr 7 2016

Issue description

Steps to reproduce the problem:
1. We write a sample and provide source code for this case
2. Please install and launch it. 
3. It will pop up a toast to show the scrollHeight of the div tag.

What is the expected behavior?

What went wrong?
The scrollHeight value is correct before using WebView v.47, but not correct on WebView v.48.

Did this work before? Yes The scrollHeight value is correct before using WebView v.47

Chrome version: 48.0.2564.106  Channel: stable
OS Version: 6.0
Flash Version: HTC M8
 
WrongScrollHeightDemo.apk
412 KB Download
WrongScrollHeightDemo.zip
478 KB Download
Components: Mobile>WebView

Comment 2 by boliu@chromium.org, Apr 7 2016

Labels: Needs-Feedback
Can you provide more details here? I'm not going to read your html and js and java code. What div in the page? What js snippet are you using to read it? etc

Also is this change in m48 relevant? https://www.chromestatus.com/feature/5651186401148928
Our app will import another website content and gets properly height to  layout dynamically. Most case return values are correct. But, in this case, it contains an img tag before a table will return a very small value. If we remove this img tag, the scrollHeight of this div will return the correct value. 

html:
<body><div class='message-content' style='display: block; width: 344.0px'><img src='https://tracking.nextdoor.com/t_i/spacer.gif?ot=YQg-E71IiWV_F_ZERHcNAnJA2qTZDaYaH8SqOyNzoVdQKEY1M9l-AN1vFm0skYfy' height='1' width='1'><table align='left' cellpadding='0' cellspacing='0' border='0' width='100%' style='background:#ffffff'><tbody>...

js:
var expandedBodyDivs = document.querySelectorAll('body > .message-content');
expandedBodyDivs[0].scrollHeight);
Screenshot from 2016-04-08 10:52:08.png
240 KB View Download

Comment 4 by boliu@chromium.org, Apr 8 2016

Labels: -Needs-Feedback

Comment 5 by hush@chromium.org, Apr 14 2016

Status: Available (was: Unconfirmed)
This is a problem on Chrome desktop too, if you extract the html from the apk and use chrome to display it.
test.html
7.2 KB View Download
Right, so the easiest thing to do here should be to bisect this, will take a look.
Cc: gsennton@chromium.org
Owner: wangxianzhu@chromium.org
Okidoki, it seems the commit that breaks this is

https://chromium.googlesource.com/chromium/src/+/0f639ede1ca727f4684766ec2427a341e413be7b

so assigning to wangxianzhu@

(the version where this started failing is 48.0.2564.44).
Reduced test case
test-scrollHeight.html
281 bytes View Download
Cc: e...@chromium.org
Status: WontFix (was: Available)
My CL just changed our behavior back to the behavior before https://codereview.chromium.org/1236793005. Now our behavior is the same as Safari.

It's about whether to include overhanging floats into scrollHeight of the container. I'm not sure what the spec says about this, but different browsers do have different behaviors.

r98525087t2@gmail.com, to avoid the different behaviors, you can add "position: relative" to the container.

Sign in to add a comment