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 14:02:54 -0800
Message-ID: <CADBxridddz9OpegfEMD6h2FUqbYM267RiC7cGJmuNOu4MHhV+w@mail.gmail.com>
To: Kenneth Rohde Christiansen <kenneth.christiansen@gmail.com>
Cc: Matt Rakow <marakow@microsoft.com>, "www-style@w3.org" <www-style@w3.org>
I'd like to make clear of the relationships among the terms:

- http://quirksmode.org/mobile/viewports2.html:  visual viewport, layout
viewport
- css-device-adapt: initial viewport, actual viewport
- CSSOM view: viewport

Now in my understanding
- layout viewport == actual viewport
- sizeof(visual viewport) == sizeof(initial viewport) / pinch-scale.
  i.e. visual viewport == initial viewport if not pinch-zoomed.
- viewport in CSSOM view == visual viewport

If my understanding were correct, what should we do when visual viewport
size changes when the keyboard is visible?
A
  1) let sizeof(initial viewport) = sizeof(visual viewport) * pinch-scale;
  2) compute the new actual viewport based on the new initial viewport
(using the algorithm defined in chapter 6 of css-device-adapt);
  (As aspect-ratio(initial viewport) == aspect-ratio(visual viewport), the
two steps could be combined by using visual viewport size directly in 2).
or
B
  decouple visual viewport and initial viewport on temporary window size
changes.
I'd prefer B.

Fixed-pos element attachment seems still controversial. The browsers (all
but IE?) not following the spec may base on the following point: developers
who put fixed-pos elements in the page might expect they'd be always
visible. Perhaps "position: device-fixed" (
http://quirksmode.org/blog/archives/2010/12/the_fifth_posit.html) is the
solution to the controversy.

Xianzhu

On Wed, Feb 12, 2014 at 12:08 PM, Kenneth Rohde Christiansen <
kenneth.christiansen@gmail.com> wrote:

> Right, that name is way better. It would be good to actually have that
> name specified somewhere to avoid confusion.
>
> Kenneth
>
> On Wed, Feb 12, 2014 at 9:06 PM, Matt Rakow <marakow@microsoft.com> wrote:
> >> BE AWARE, that actual viewport is not the viewport you see when you have
> >> pinch zoomed or the browser zoomed in due to an input field being
> selected;
> >> we could probably call that pinch viewport to avoid confusion.
> >
> > I think the commonly used name is "visual viewport" [1] (or at least
> that's the name we've been using at MSFT) -- especially since there could
> be other ways to get into a state where you have such a distinct viewport
> aside from pinching.
> >
> > Thanks,
> > -Matt
> >
> > [1] http://quirksmode.org/mobile/viewports2.html
>
>
>
> --
> Kenneth Rohde Christiansen
> Web Platform Architect, Intel Corporation.
> Phone  +45 4294 9458 ﹆﹆﹆
>
Received on Wednesday, 12 February 2014 22:03:26 UTC

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