Sounds like Blink's version of BrowserControls::shrink_viewport_ might be out of sync? Put some logging around where we change that, if the browser side is false then the Blink side should be as well.
bokan@, They're not out of sync, they both return false while scrolling is in progress. The problem is that it seems RenderWidgetHostViewAura::DoBrowserControlsShrinkBlinkSize() can be called at any time, even during scrolling, so if we are during scrolling, we return false, causing icb_size to shrink, when we finish scrolling, we return true, causing icb_size to unshrink.
In both situations the shown_ratio remained at 1.f.
It's not that DoBrowserControlsShrinkBlinkSize must be false during scrolling, it's that it must not change while we're scrolling.
So say you have:
1) Page loads, browser controls are fully shown and the page is stabilized
shrinks_blink_size = true on both sides
2) We now scroll down, hiding the URL bar but without lifting the finger
shown_ratio = 0 but shrinks_blink_size = true still
While in this state, the ICB should not change size since we loaded the
page. If we get a resize while scrolling for some reason, it should account
for the URL bar and prevent changing the web contents size.
3) Release the finger
This causes a resize of the web contents and shown_ratio = false. The ICB
size should still not change, it will now be smaller than the web_contents
size.
The invariant here is that DoBrowserControlsShrinkBlinkSize should only be true when we've resized the web contents (by sending a resize IPC) to be smaller by the top controls height - that should happen in step #3 above.
Comment 1 by bokan@chromium.org
, Sep 18