VisualViewport.width doesn't cause layout when scrollbar visibility changes |
||
Issue description
Chrome Version: 60.0.3079.0
OS: All
What steps will reproduce the problem?
(1) Expand iframe's body element width/height programmatically so that a scrollbar appears
(2) Read value of the iframe's window.view.{width,height}
What is the expected result?
The width/height should be reduced by the thickness of a scrollbar, if system scrollbars are non-overlay.
What happens instead?
The width/height didn't change.
They do change if we try to read the body's clientHeight so it looks like we're missing a necessary layout call. See attached test file
,
Apr 25 2017
Yes, I think any API that depends on layout should ensure that layout is up to date before producing a result.
,
Apr 27 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/396aeae063fa2f8a1e7422bc86a568239bf8fca4 commit 396aeae063fa2f8a1e7422bc86a568239bf8fca4 Author: bokan <bokan@chromium.org> Date: Thu Apr 27 17:40:00 2017 Perform layout when viewport size is queried. If a Frame has non-overlay scrollbars, the visualViewport's dimensions should exclude them. In order to know whether the Frame has scrollbars, we need to perform any pending layouts. This was only broken for iframes as the main frame viewport size depends on page scale. Page scale depends on layout to determine the minimum/initial page scale so we already performed layout when the main frame's viewport was queried. BUG= 714829 Review-Url: https://codereview.chromium.org/2842343002 Cr-Commit-Position: refs/heads/master@{#467718} [add] https://crrev.com/396aeae063fa2f8a1e7422bc86a568239bf8fca4/third_party/WebKit/LayoutTests/fast/dom/viewport/read-viewport-size-causes-layout.html [add] https://crrev.com/396aeae063fa2f8a1e7422bc86a568239bf8fca4/third_party/WebKit/LayoutTests/fast/dom/viewport/read-viewport-size-in-iframe-causes-layout.html [modify] https://crrev.com/396aeae063fa2f8a1e7422bc86a568239bf8fca4/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
,
Apr 28 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by bokan@chromium.org
, Apr 25 2017