From 8b52b50c677497127b1502aba67f380ff46a1c06 Mon Sep 17 00:00:00 2001 From: notmasteryet Date: Sun, 15 Jan 2012 15:19:51 -0600 Subject: [PATCH] Use .sheet property instead of document.styleSheets --- src/fonts.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fonts.js b/src/fonts.js index 329d7ad77..d0ff7664d 100644 --- a/src/fonts.js +++ b/src/fonts.js @@ -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;