[whatwg] HTML5 is now also hosted by the W3C

Kristof Zelechovski giecrilj at stegny.2a.pl
Thu May 10 02:08:13 PDT 2007


The following fragment of <http://status.whatwg.org/annotate-web-apps.js> is
not supported by Microsoft Internet Explorer 7:

var style = document.createElement("style");
style.type = "text/css"; // required in html4...
var styleText = document.createTextNode("\
 .TBW, .WIP, .SCS { margin-left:-2em; border-left:.2em solid;
padding-left:1.8em; }\
 .TBW { border-color:red; }\
 .WIP { border-color:orange; }\
 .SCS { border-color:green; }\
 ");
style.appendChild(styleText);

The problem is that you cannot append a child to a STYLE element; cf.
<http://msdn2.microsoft.com/en-us/library/ms535934.aspx> and
<http://msdn2.microsoft.com/en-us/library/ms535898.aspx#>.  

Internet Explorer uses style sheet objects instead; the code would be
similar to

document.styleSheets[0].addRule(".TBW", "border-color: red")

While it is nonstandard, it would be a good candidate for standardizing
because it reflects the logical structure of a style sheet better than a
plain text node.

Would you like me to make a fix for IE7?

Chris







More information about the whatwg mailing list