Re: [css-device-adaptation] New draft

On Mon, 18 Oct 2010 10:33:33 +0200, Rune Lillesveen <rune@opera.com> wrote:

> http://people.opera.com/rune/TR/ED-css-viewport-20101013/

I would like to remove the "default viewport width" concept from the spec  
and have the UAs replace it with a UA stylesheet like this if they want a  
default width:

   @viewport { width: desktop-width; }

The reason is that it:

- simplifies the spec
- simplifies and makes the resolving procedure more understandable
- makes it clear that using the initial viewport size as the actual  
viewport size is the default behaviour
- makes it more in line with CSS (?) to have browser specific behaviour in  
a UA stylesheet instead of being part of the constraining procedure


Proposed spec changes:

1. Remove "default width" definition in chapter 3.
2. Remove note about actual viewport size being different from initial  
viewport size because of default width in chapter 3.
3. Remove the default-width definition from 6.1.
4. Step 13 in 6.2, change to "If zoom is 'auto', set zoom = 1".
5. Step 16 in 6.2, change from "default-width" to "initial-width".
6. In chapter 7, remove: ", but with width set to the default viewport  
width".
7. In section 9.3, add: "For a viewport meta element that translates into  
an @viewport rule with a non-'auto' zoom declaration and no width  
declaration, add "width: auto;".
8. It should also be said that the non-normative translation from viewport  
meta to @viewport in chapter 9 assumes the presence of "@viewport { width:  
desktop-width; }" in the UA stylesheet to be compatible with current meta  
viewport implementation(s).


Consequences:

1. Setting zoom only does not automatically discard width from UA  
stylesheet like it would have discarded the default-width with the current  
draft.

With the current draft, this:

   @viewport {
     zoom: 1.0;
   }

will give you a width set to initial-width, even if the default-width is  
something different. With a "width: desktop-width" in the UA stylesheet,  
the resulting properties would be:

   width: desktop-width
   zoom: 1.0

2. Compatibility with Safari's viewport meta will not be kept for multiple  
meta elements.

For a single meta element, compatibility with Safari could be kept by  
setting the width to 'auto' if it's not specified in the content  
attribute. That is, this:

   <meta name="viewport" content="initial-scale=1.0">

would be translated into:

   @viewport { zoom: 1.0; width: auto; }

Compatibility would not be kept for this case:

   <meta name="viewport" content="width=640px">
   <meta name="viewport" content="initial-scale=1.0">

because the second meta element would reset the width to auto. In the  
current Safari implementation, the two meta elements are combined to set  
width to 640 and initial-scale to 1.

I am willing to sacrifice the backwards compatibility with viewport meta  
for the multiple meta element case.


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

Received on Monday, 18 October 2010 09:47:47 UTC