Re: [css-device-adapt] Decoupling zoom and width/height

Hi there,

On Wed, Oct 31, 2012 at 8:58 AM, Rune Lillesveen <rune@opera.com> wrote:

> The current constraining procedure has a coupling between zoom and auto
> widths/heights (6-9) and extending widths/heights to fill the viewport for
> a non-auto zoom (10-11).
>
> These stem from the Safari iOS meta viewport legacy.
>
> You can use a meta viewport tag with content="initial-scale=2" to get a
> viewport which has a width/height that is 50% of the initial viewport
> width/height. With an @viewport rule, you don't need to use zoom to achieve
> that since you can have percentage lengths. For instance "@viewport {
> width: 50%; height: auto; }".
>
> I would like to decouple the zoom from width/height by letting auto
> width/height rely on non-auto width/height and initial viewport only. In
> short, an auto width should get a width from the height and the initial
> viewport aspect ratio. Vice versa for height. If both width and height are
> auto, they will get initial viewport width and height respectively.
>
> I suspect the "extend width/height when both zoom and width is non-auto"
> behavior is to handle the case content="width=320,initial-**scale=1"
> which was used in Safari before device-width was available.


I think this is because the viewport meta is always calculated given
portrait mode. Ie. the iPhone has a device-height of 480 CSS units, so in
landscape, width=320 and initial-scale=1 would not be possible. Thus the
scale is respected first of all and then the width overflows and becomes
480. This makes it possible to use the same viewport meta tag for both
orientations.


> Extending the width/height to fill the initial viewport would make this
> behave as width=device-width on different size displays like the iPad. I
> don't see a use-case for this with @viewport apart from getting a backwards
> compatible meta viewport implementation, which should be possible in the
> property mapping.
>

Depends whether we intent people to use different @viewport's per
orientation.


>
> Proposal, rule-wise:
>
> Replace step 6 and 7 with:
>
>   - If width and height are both ‘auto’, set width = initial-width
>
> and drop step 10 and 11.
>
> I have not worked out the details for the meta viewport to @viewport
> mapping in chapter 11 to keep the same meta viewport behavior, but it looks
> doable. I'll get back to that.
>
> --
> Rune Lillesveen
>
> --
> ---------------------------------------------------------------------
> Intel Denmark Aps
> Langelinie Alle 35, DK-2100 Copenhagen
> CVR No. 76716919
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>
>

Received on Wednesday, 31 October 2012 10:57:02 UTC