W3C home > Mailing lists > Public > www-html@w3.org > January 2003

Re: XHTML 2.0 considered harmful

From: Chris Mannall <chris.mannall@hecubagames.com>
Date: Thu, 16 Jan 2003 09:00:34 +0000
Message-ID: <3E2674B2.9090004@hecubagames.com>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
CC: Mikko Rantalainen <mira@cc.jyu.fi>, www-html@w3.org

Boris Zbarsky wrote:
>>IMO, if we drop style attribute the respective part of DOM should drop the
>>style attribute too so there's no problem.
> 
> 
> Sure there is and a major one.  Compare the following two chunks of ECMAScript:
> 
>   document.getElementById("myMovableDiv").style.left = "50px";
> 
> and
> 
>   var set = false;
>   var rules = document.styleSheets[0].cssRules;
>   var len = rules.length;
>   while (var i = 0; i < len; ++i) {
>     var rule = rules[i];
>     if (rule.selectorText == "#myMovableDiv") {
>       rule.style.left = "50px";
>       set = true;
>       break;
>   }
>   if (!set) {
>     document.styleSheets[0].insertRule("#myMovableDiv { left: 50px }", rules.length);
>   }
> 

Thank you Boris! This is part of the point I was trying to make[1], only 
I didn't have the time to trawl through the DOM Stylesheets module to 
put together an example. Now that I see it, I'm even more convinced that 
element.style has to stay, and thus the style attribute.

[1] http://lists.w3.org/Archives/Public/www-html/2003Jan/0181.html


- Chris.
Received on Thursday, 16 January 2003 04:01:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:54 GMT