Bug 1588622 Comment 14 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to David Bokan from comment #13)
> (In reply to Botond Ballo [:botond] [standards meeting Nov 4-9] from comment #11)
> > In that case, the computation for `LayoutViewport.clientWidth` would be something like `document.scrollingElement.scrollWidth - window.scrollMaxX` (and similarly for height). It can be changed to `window.innerWidth/Height` after bug 1514429 is fixed.
> 
> I think that might miss some edge-cases related to the viewport meta tag. E.g. the fixed viewport can be restricted with `minimum-scale=1` for example which might not be reflected by `document.scrollingElement.scrollWidth - window.scrollMaxX`. Granted, I don't know how Gecko works in these cases but definitely something to check.

So I tried the attached simple testcase, where the content size is twice the ICB size, so there would be room for the fixed viewport to be expanded, but the `minimum-scale=1` restrict it.

In this scenario, I am seeing:
 * `document.scrollingElement.scrollWidth` is twice my screen width (on the phone I'm testing with, 720px)
 * `window.scrollMaxX` is equal to my screen width (360px)
 * their difference is equal to my screen width (360px)

That seems like the desired value of the fixed viewport width. Not sure which part of the calculation you were expecting to trip up?
(In reply to David Bokan from comment #13)
> (In reply to Botond Ballo [:botond] [standards meeting Nov 4-9] from comment #11)
> > In that case, the computation for `LayoutViewport.clientWidth` would be something like `document.scrollingElement.scrollWidth - window.scrollMaxX` (and similarly for height). It can be changed to `window.innerWidth/Height` after bug 1514429 is fixed.
> 
> I think that might miss some edge-cases related to the viewport meta tag. E.g. the fixed viewport can be restricted with `minimum-scale=1` for example which might not be reflected by `document.scrollingElement.scrollWidth - window.scrollMaxX`. Granted, I don't know how Gecko works in these cases but definitely something to check.

So I tried the attached simple testcase, where the content size is twice the ICB size, so there would be room for the fixed viewport to be expanded, but the `minimum-scale=1` restricts it.

In this scenario, I am seeing:
 * `document.scrollingElement.scrollWidth` is twice my screen width (on the phone I'm testing with, 720px)
 * `window.scrollMaxX` is equal to my screen width (360px)
 * their difference is equal to my screen width (360px)

That seems like the desired value of the fixed viewport width. Not sure which part of the calculation you were expecting to trip up?

Back to Bug 1588622 Comment 14