I've decided to fix bug 1586986 and bug 1586149 altogether in this bug. Otherwise we will introduce undesirable weird behaviors. There are two caveats with regard to visual viewport size changes; 1) Firing visual viewport resize events means that any arbitrary scripts can be run in the callback so even if we don't explicitly flush position:fixed elements styles AND if we use the up-to-date visual viewport size in layout, it's possible that position:fixed elements positions are changed by unpredictable scripts. So if we update the visual viewport size in layout, we should also explicitly flush positions:fixed elements. 2) As a result of 1), once position:fixed elements are re-positioned with the up-to-date visual viewport size by the flush, 'fixed layer margins' on the compositor which comes from android-components via setVerticalClipping is no longer valid as it is. We need to _negate_ the value by the _current_ dynamic toolbar height. I hope this helps reviewers to review patches here.
Bug 1586986 Comment 13 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
I've decided to fix bug 1586147 and bug 1586149 altogether in this bug. Otherwise we will introduce undesirable weird behaviors. There are two caveats with regard to visual viewport size changes; 1) Firing visual viewport resize events means that any arbitrary scripts can be run in the callback so even if we don't explicitly flush position:fixed elements styles AND if we use the up-to-date visual viewport size in layout, it's possible that position:fixed elements positions are changed by unpredictable scripts. So if we update the visual viewport size in layout, we should also explicitly flush positions:fixed elements. 2) As a result of 1), once position:fixed elements are re-positioned with the up-to-date visual viewport size by the flush, 'fixed layer margins' on the compositor which comes from android-components via setVerticalClipping is no longer valid as it is. We need to _negate_ the value by the _current_ dynamic toolbar height. I hope this helps reviewers to review patches here.