Re: CSS Viewport proposal

On Tue, 17 Aug 2010 22:54:23 +0200, Simon Fraser <smfr@me.com> wrote:

> On Aug 9, 2010, at 6:25 am, Rune Lillesveen wrote:
>
>> If there's any interest - here's my attempt at specifying the  
>> functionality of the viewport META tag in CSS syntax using an @viewport  
>> block:
>>
>>  http://people.opera.com/rune/TR/ED-css-viewport-20100806/
>>
>> The proposal includes a mapping from the viewport META syntax into the  
>> proposed CSS syntax.
>>
>
> I welcome the attempt to standardize the kind of viewport behavior that  
> many mobile browsers are now implementing. I do have some feedback on  
> the proposal, however.
>
> In section 3, you define two different viewports, the visual viewport,  
> and the layout viewport. You say that the visual viewport is the one  
> that corresponds with the CSS 2.1 definition of viewport. However, this  
> is not how WebKit on iOS behaves. The layout viewport is more closely  
> related to the CSS 2.1 definition of viewport. Scrolling and panning is  
> then implemented by providing a "porthole" onto this viewport, which I  
> think corresponds more closely to your intent for "visual viewport".

These definitions didn't come out well.

Yes, my intention was to say that the "visual viewport" is that  
"porthole". What I find difficult is to formulate this and be consistent  
with the viewport definition in CSS2.1. The spec needs to say something  
about it as there are values that are defined in terms of what's currently  
called the "visual viewport". We could for instance use the term "window"  
instead of "visual viewport", and use "viewport" instead of "layout  
viewport". The problem is that in CSS2.1, "window" and "viewport" is the  
same thing.

> I think you also need to be very cautious in introducing a second type  
> of viewport, since now it becomes unclear which of the two viewports the  
> other specs (CSS 2.1, CSSOM View etc) refer to. For example, "client"  
> coordinates, used in events, getClientRects etc, are all viewport  
> relative, but which viewport?
>
> Note that iOS has not always been consistent in terms of coordinate  
> spaces and viewports; for example, at some point 'scrollTop' may have  
> been fixed to take panning into account, but event 'client' coordinates  
> may still be in terms of the "layout" viewport.

I don't have a full overview of the JS/DOM/CSSOM properties, but I think  
there are both properties that should be relative to "layout viewport" and  
properties that are relative to the "visual viewport". I know that for  
instance window.innerHeight/innerHeight is currently, and understandably  
so, the size of the "porthole" in Safari, but the CSSOM spec says it must  
be the width of the CSS2.1 viewport. This clearly needs some work.

-- 
Rune Lillesveen
Senior Core Developer / Architect
Opera Software ASA

Received on Wednesday, 25 August 2010 08:57:54 UTC