[whatwg] HTML5 is now also hosted by the W3C

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

Received on Thursday, 10 May 2007 02:08:13 UTC