W3C home > Mailing lists > Public > www-style@w3.org > March 2004

RE:Re: Proposal: version at-rule

From: Sean M. Hall <pianoman@reno.com>
Date: 27 Mar 2004 00:35:21 +0000
Message-ID: <8B8D0DEF_6363_46A1_9D29_A5EFB715F1E3@webmail.loadmail.load.com>
To: www-style@w3.org
This: 
#myDiv { 
 width: 100px; 
 padding: 20px; 

 if( calculated-width != 100px ) 
 width: 80px; 
} Is silly, no offense. First of all IE's Box Model makes far more sense than the W3C's in my opinion. Second there IS a CSS3 declaration that switches box models (box-sizing) which is supported by IE5 Mac and Opera 7 (Mozilla supports -moz-box-sizing). And finally and this is a typical Javascript job. calculated-width is a dead ringer to offsetWidth if (document.getElementById("myDiv").offsetWidth != 100) document.getElementById("myDiv").style.width="80px"; Bringing if statements into selectors would be a bad idea (though an at-rule would be better). What if we did this: You have a link tag for your advanced layout: <link rel="stylesheet" href="file.css" support="sup.txt" /> You could then have a seperate text file which would contain special syntax for support. If one criterium is not met, the link tag is disabled. Example text file: var attrs= new SupportCheck("*:attr[]"); if (attrs) return true; Looks like Javascript, but the browsers would have a native SupportCheck function that returns a boolean depending on whether the selector, declaration whatever is supported. I know it sounds silly but just think about it. 



Dante Evans (AKA Sean M. Hall) Freelance musician, historian, writer, web developer www.sfhe.cjb.net CEO of DCScript www.dcscript.vze.com 'Evans, Dante Evans' 
Received on Friday, 26 March 2004 19:36:29 GMT

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