improve stylesheet creation

This commit is contained in:
Pavel Reznikov 2015-02-27 16:00:36 -08:00
commit 3e5100749a

View file

@ -27,8 +27,14 @@
create_stylesheet: function () {
var style = document.createElement("style");
style.appendChild(document.createTextNode(""));
document.head.appendChild(style);
style.setAttribute("type", "text/css");
if (style.styleSheet) {
style.styleSheet.cssText = "";
}
else {
style.appendChild(document.createTextNode(""));
}
document.getElementsByTagName('head')[0].appendChild(style);
return style.sheet;
},