Unable to get correct scrollHeight of div tag which contains table
Reported by
r9852508...@gmail.com,
Apr 7 2016
|
||||||
Issue descriptionSteps 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
,
Apr 7 2016
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
,
Apr 8 2016
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);
,
Apr 8 2016
,
Apr 14 2016
This is a problem on Chrome desktop too, if you extract the html from the apk and use chrome to display it.
,
Apr 19 2016
Right, so the easiest thing to do here should be to bisect this, will take a look.
,
Apr 20 2016
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).
,
Apr 20 2016
Reduced test case
,
Apr 20 2016
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 |
||||||
Comment 1 by rsgav...@chromium.org
, Apr 7 2016