Use .sheet property instead of document.styleSheets

This commit is contained in:
notmasteryet 2012-01-15 15:19:51 -06:00
parent a908827175
commit 8b52b50c67

View File

@ -2121,10 +2121,11 @@ var Font = (function FontClosure() {
window.btoa(data) + ');');
var rule = "@font-face { font-family:'" + fontName + "';src:" + url + '}';
var styleElement = document.createElement('style');
document.documentElement.getElementsByTagName('head')[0].appendChild(
document.createElement('style'));
styleElement);
var styleSheet = document.styleSheets[document.styleSheets.length - 1];
var styleSheet = styleElement.sheet;
styleSheet.insertRule(rule, styleSheet.cssRules.length);
return rule;