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

There are two relevant specs, CSS Device Adaptation and CSSOM View.

The initial viewport is the viewport the browser gives you on Desktop
when there is no viewport meta tag and no page zoom or pinch zoom is
applied. So basically it is the native viewport size in CSS pixels.

The actual viewport might be VERY different than the initial viewport
in the case of @viewport rules or viewport meta tags, so fixing things
to the initial viewport doesn't make much sense.

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.

Kenneth



On Wed, Feb 12, 2014 at 8:23 PM, Xianzhu Wang <wangxianzhu@chromium.org> wrote:
> Let me explain more about how my questions are related to the spec :)
>
> - Many browsers attach fixed-pos elements to the initial viewport (or sth
> between the initial viewport and actual viewport) instead of the actual
> viewport. Perhaps we could say they are wrong because they don't follow
> existing specs, but perhaps we'd better look into the reasons of their not
> following spec, and maybe adjust the spec if the reasons are reasonable.
>
> - In my understanding of the spec, initial viewport is visual viewport. The
> spec says the actual viewport should be proportional to the initial viewport
> if viewport height is 'auto' or ..., so if my understanding were correct,
> not adjusting actual viewport on initial viewport change (even if it's
> temporary) would not be following the spec. The question is about: 1. if the
> understanding is correct; 2. whether the browsers are wrong or the spec
> needs to be adjusted.
>
> Thanks,
> Xianzhu
>
>
>
>
> On Tue, Feb 11, 2014 at 5:39 PM, Xianzhu Wang <wangxianzhu@chromium.org>
> wrote:
>>>
>>>
>>> All this said, I'm not sure if these questions fall into the device
>>> adaptation spec since they pertain more to definition of visual viewport vs.
>>> actual viewport, rather than the definition of initial viewport vs. actual
>>> viewport.  I do think they'd be good questions to resolve in some spec
>>> though.
>>
>>
>> I think this is a good point. Do you mean we should distinguish 'visual
>> viewport' and 'initial viewport'?
>>
>>> Thanks,
>>> -Matt
>>>
>>>
>>> >From: wangxianzhu@google.com [mailto:wangxianzhu@google.com] On Behalf
>>> > Of Xianzhu Wang
>>> >Sent: Tuesday, February 11, 2014 11:42 AM
>>> >To: www-style@w3.org
>>> >Subject: [css-device-adapt] How should initial viewport contribute to
>>> > layout?
>>> >
>>> >Hi,
>>> >
>>> >Actually I have 2 related questions:
>>> >1. Should fixed-position blocks layout according to the 'initial
>>> > viewport', 'actual viewport' or something between them?
>>> >2. For a page with unconstrained viewport height, how should the height
>>> > of the 'actual viewport' be adjusted when there is temporary height change
>>> > of the 'initial viewport', e.g. when the on-screen-keyboard shows?
>>> >
>>> >The answers to the above questions seem to have already been covered by
>>> > existing specs, but after we examine the current behavior of different
>>> > mobile browsers we found they have tweaked the existing specs to achieve
>>> > more user-friendship and/or better performance:
>>> >
>>> >1. All browsers seems not to layout top-level fixed-position blocks
>>> > according to the initial-containing-block (i.e. 'actual viewport' in
>>> > css-device-adapt), but somehow according to the visible viewport (i.e.
>>> > 'initial >viewport' in css-device-adapt). Mobile Safari's behavior is more
>>> > complex that seems to use a bigger virtual viewport to contain the
>>> > fixed-position elements if the visible viewport is too small.
>>> >
>>> >2. For a page with unconstrained viewport height, the browsers behave
>>> > differently about whether to adjust the actual viewport height when
>>> > visibility of the top- and/or bottom- controls and the on-screen keyboard
>>> > changes.
>>> >
>>>
>>> > >https://docs.google.com/a/chromium.org/document/d/1ukfEZGJQq-7VD_Tv9m_cYD4BoR6YZots5_KddtvYZJs/edit#
>>> > summarizes the current behaviors of the browsers.
>>> >
>>> >I think it'd be better if the spec address the issues that caused the
>>> > browsers to tweak the spec, to avoid inconsistency and confusion.
>>> >
>>> >Thanks,
>>> >Xianzhu
>>> >
>>
>>
>



-- 
Kenneth Rohde Christiansen
Web Platform Architect, Intel Corporation.
Phone  +45 4294 9458 ﹆﹆﹆

Received on Wednesday, 12 February 2014 20:00:42 UTC