Re: XHTML 2.0 considered harmful

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 UTC