Re: CSS Viewport proposal

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".

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.

Simon

Received on Tuesday, 17 August 2010 20:55:04 UTC