window.innerHeight is sometimes greater than window.outerHeight |
|||
Issue descriptionIn a telemetry benchmark that navigates between pages and scrolls pages, I observe window.innerHeight being greater than window.outerHeight, which leads to assertion failure in synthetic gesture scroll. Steps to reproduce 1. Apply https://codereview.chromium.org/2118293002 (in case it is not already landed) 2. Build Chrome for android 3. time tools/perf/run_benchmark news_mobile --browser=android-chromium --story-filter=qq The benchmark sometimes fails with Abort message: '[FATAL:synthetic_gesture_target_base.cc(65)] Check failed: web_touch.touches[i].state != WebTouchPoint::StatePressed || PointIsWithinContents(web_touch.touches[i].position.x, web_touch.touches[i].position.y) which is caused by incorrect window.innerHeight in https://cs.chromium.org/chromium/src/third_party/catapult/telemetry/telemetry/internal/actions/repeatable_scroll.py?rcl=0&l=26
,
Jul 11 2016
This might actually be expected. As the page loads, the layout size might change. If there's no viewport meta tag, we default to 980px layout width (probably rounded due to a weird device pixel ratio). In general, innerWidth/Height depend on pinch-zoom. If you're comparing it against touch coordinates, you likely want to use outerWidth/Height which don't change with pinch zoom.
,
Jul 11 2016
Thank you for super quick response and for the explanation :) Feel free to close as WAI. Just to clarify, even if page is loaded and layout is completed, innerHeight can still be larger outerHeight with pinch zoom, right? So innerHeight <= outerHeight is not a valid invariant.
,
Jul 11 2016
That's correct. innerHeight will actually be larger if we zoom out. So on a page with no viewport <meta> tag, the default layout width will be 980px. So if the phone has a screen width of 320px, as the page lays out, the browser will zoom out to about 0.3 page scale (320/980) so innerWidth and innerHeight will get scaled by 1/0.3.
,
Sep 27 2016
|
|||
►
Sign in to add a comment |
|||
Comment 1 by u...@chromium.org
, Jul 11 2016Status: Assigned (was: Untriaged)