W3C home > Mailing lists > Public > www-style@w3.org > February 2014

Re: [css-device-adapt] How should initial viewport contribute to layout?

From: Xianzhu Wang <wangxianzhu@chromium.org>
Date: Wed, 12 Feb 2014 15:36:08 -0800
Message-ID: <CADBxrieeDuL5zHsAmBxTpR4xFLCPFYy9EYbNGFZfHuuGMo=tbA@mail.gmail.com>
To: Matt Rakow <marakow@microsoft.com>
Cc: Kenneth Rohde Christiansen <kenneth.christiansen@gmail.com>, "www-style@w3.org" <www-style@w3.org>
Thanks for your replies that made things clearer.


> > - sizeof(visual viewport) == sizeof(initial viewport) / pinch-scale.
> >   i.e. visual viewport == initial viewport if not pinch-zoomed.
>
> This one should be:
> sizeof(visual viewport) == sizeof(actual viewport) / pinch-scale.
>
> ...with the caveats mentioned earlier on the thread regarding other
> factors that can change the visual viewport (i.e. overlay UI).


I found I should have used 'page-scale' instead of 'pinch-scale' to make my
equation correct (page-scale = initial-scale * pinch-scale):
  sizeof(visual viewport) == sizeof(initial viewport) / page-scale

The modified equation seems still correct when actual viewport and initial
viewport has different aspect-ratios:
  @viewport { width: 480px; height: 480px }, window size is 240x320px, then
   - initial viewport: 240x320px
   - actual viewport: 480x480px
   - initial scale: 0.5
   - visual viewport: 480x640px
Received on Wednesday, 12 February 2014 23:36:36 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:19 UTC