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

Re: [CSSWG] Resolutions 2007-08-28

From: Timur Mehrvarz <timur.mehrvarz@web.de>
Date: Wed, 29 Aug 2007 02:13:03 +0200
Message-Id: <A4A70708-A23C-4508-80EE-2FA56F0CEB81@web.de>
Cc: www-style@w3.org
To: fantasai <fantasai.lists@inkedblade.net>


On 28.08.2007, at 23:50, fantasai wrote:

>   Media Queries shall not include any normative requirements on re- 
> evaluating
>     media queries in responses to changes in the environment, but  
> shall include
>     a note explaining that a UA is expected to re-evaluate and re- 
> layout the page
>     in response to viewport resizing.

Let's say, one UA does support aspect-ratio, but does not re-evaluate  
MQ's in response to aspect-ratio changes. In such a case, I may want  
to help myself, with code, similar to the one shown below. How do you  
expect this to play out on another agent, that actually _does_ re- 
evaluate (and possible re-layout) in response to aspect-ratio changes?

This may well result in double rendering and flashing etc, no? It  
could be helpful, if script code had a way to find out, if "automatic- 
aspect-ratio-re-layout" was actually supported by the agent.

Timur

////////////////////////////////////////////////////////////////
// auto-reload on aspect ratio change
var myWidth;
var myHeight;

function load()		// my onLoad fkt.
{
   myWidth = window.innerWidth;
   myHeight = window.innerHeight;
}

function resize()	// my onResize fkt.
{
// if(!automatic-aspect-ratio-re-layout)
     if((myWidth>myHeight && window.innerWidth<window.innerHeight) ||
        (myWidth<myHeight && window.innerWidth>window.innerHeight))
     {
       myWidth = window.innerWidth;
       myHeight = window.innerHeight;
       location.reload();
     }
}
Received on Wednesday, 29 August 2007 00:13:43 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:52 GMT