Steps to reproduce the problem:
See attached test app (build from source).
The app consists of a single WebView that loads some simple HTML within the WebView.
This HTML page shows a bug in how the WebView calculates the dimensions of the window (innerHeight
and innerWidth) and the coordinates of the elements relative to the window perhaps as a sideeffect.
1. innerWidth and innerHeight: the width and height of the WebView are natively hardcoded to be
360dp x 400dp. Yet innerWidth and innerHeight will report significantly larger values.
2. scrollY is frozen at a value of 0 even after scrolling in the WebView until a certain point is
reached (did not investigate at WHAT point exactly) and then starts incrementing. Note scrollY
does not exceed 0 until well after the red <div> is scrolled completely out of the viewport.
3. Related to 2, getBoundingClientRect() on the <img> element returns incorrect values that do not
update as the viewport is scrolled.
4. IntersectionObserver is broken as a result. Notice it does not update as we scroll through the
WebView and the position of the <img> element changes.
The above can be confirmed by attaching an inspector to the WebView.
This issue appears to be related to https://bugs.chromium.org/p/chromium/issues/detail?id=767388 though exhibits more extensive problems. Any code that requires on accurate coordinate and positioning information will get inaccurate results. This is a significant issue for, for example, ad measurement code.
What is the expected behavior?
The scroll position and coordinates should be reported correctly.
What went wrong?
The expected behavior is not met.
Did this work before? N/A
Does this work in other browsers? Yes
Chrome version: 66.0.3359.158 Channel: stable
OS Version: 7.0
Flash Version: N/A