W3C home > Mailing lists > Public > www-style@w3.org > August 2010

Re: CSS Viewport proposal

From: Kenneth Rohde Christiansen <kenneth.christiansen@gmail.com>
Date: Tue, 17 Aug 2010 09:03:02 -0300
Message-ID: <AANLkTi=4+HPEZw3_DOHDeY_mHwiTatTNdUjWf+G2L0YK@mail.gmail.com>
To: Rune Lillesveen <rune@opera.com>
Cc: Kenneth Christiansen <kenneth.christiansen@openbossa.org>, www-style list <www-style@w3.org>, Eduardo Fleury <eduardo.fleury@openbossa.org>
I guess what you want is the following:

10. If the computed value of initial-scale is ‘auto’ and width is not
‘auto’, set initial-scale = (available-width / width)
11. If the computed value of initial-scale is ‘auto’ and height is not
‘auto’, set initial-scale = MAX(initial-scale, (available-height /
height))
12. If initial-scale is ‘auto’, set initial-scale = (available-width /
desktop-width)

swap 11 and 12.

10. If the computed value of initial-scale is ‘auto’ and width is not
‘auto’, set CALCULATED initial-scale = (available-width / width)
12.  If initial-scale is ‘auto’, set CALCULATED initial-scale =
(available-width / desktop-width)
11.  If the computed value of initial-scale is ‘auto’ and height is
not ‘auto’, set initial-scale = MAX(CALCULATED initial-scale,
(available-height / height))

Agree?

Kenneth

On Tue, Aug 17, 2010 at 8:54 AM, Kenneth Rohde Christiansen
<kenneth.christiansen@gmail.com> wrote:
> Hi Rune,
>
> This seems wrong:
>
> 11. If the computed value of initial-scale is ‘auto’ and height is not
> ‘auto’, set initial-scale = MAX(initial-scale, (available-height /
> height))
>
> How can you do max of something that is auto.
>
> I use the following in my code:
> appliedScale = qMax(qreal(visibleWidth) / qreal(appliedWidth),
> qreal(visibleHeight) / qreal(appliedHeight));
>
> Cheers,
> Kenneth
>
> On Thu, Aug 12, 2010 at 3:55 AM, Rune Lillesveen <rune@opera.com> wrote:
>> On Thu, 12 Aug 2010 01:42:53 +0200, Kenneth Rohde Christiansen
>> <kenneth.christiansen@gmail.com> wrote:
>>
>>> Strange, maybe this changed between versions. Do you get overflow on
>>> www.uol.com.br then? like 10 pixels in width?
>>
>> I get 988 for window.innerWidth for uol.com.br. The problem with my simple
>> cases was that they didn't have enough height.
>>
>> In Safari, this case sets a scale factor that fits 980px in the viewport for
>> the width:
>>
>>  <div style="width: 4000px; height: 10px; background: green;"></div>
>>
>> while this gives 1280px (limited by default minimum-scale of 0.25 - 320/0.25
>> = 1280)
>>
>>  <div style="width: 4000px; height: 4000px; background: green;"></div>
>>
>>> On Wed, Aug 11, 2010 at 3:40 PM, Rune Lillesveen <rune@opera.com> wrote:
>>>>
>>>> On Mon, 09 Aug 2010 17:50:43 +0200, Kenneth Christiansen
>>>> <kenneth.christiansen@openbossa.org> wrote:
>>>>
>>>>> Hi again,
>>>>>
>>>>> You seem to be missing the fit-to-contents part. Try opening
>>>>> www.uol.com.br on the iPhone. As it has no viewport tag, 980 is
>>>>> assumed as the layout width, but as the contents is 990 in width, the
>>>>> iPhone actually modifies the scale value to fit to contents.
>>>>
>>>> I'm not able to get much sense out of this. It's not modifying the scale
>>>> value to fit the contents in the simple cases for overflowing the initial
>>>> containing block that I've tried.
>>
>> --
>> Rune Lillesveen
>> Senior Core Developer / Architect
>> Opera Software ASA
>>
>
>
>
> --
> Kenneth Rohde Christiansen
> Technical Lead / Senior Software Engineer
> Qt Labs Americas, Nokia Technology Institute, INdT
> Phone  +55 81 8895 6002 / E-mail kenneth.christiansen at openbossa.org
>
> http://codeposts.blogspot.com ﹆﹆﹆
>



-- 
Kenneth Rohde Christiansen
Technical Lead / Senior Software Engineer
Qt Labs Americas, Nokia Technology Institute, INdT
Phone  +55 81 8895 6002 / E-mail kenneth.christiansen at openbossa.org

http://codeposts.blogspot.com ﹆﹆﹆
Received on Tuesday, 17 August 2010 12:03:49 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:30 GMT