From 03e39363b61492e47cb9621616e6756f200f357d Mon Sep 17 00:00:00 2001 From: Christian Legnitto Date: Mon, 2 Jan 2012 21:40:43 -0800 Subject: [PATCH] Add the style element to the head rather than first element in the document, as the first element could be a comment and this would line would then throw --- src/fonts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fonts.js b/src/fonts.js index 83ce4abaa..1b959d6c2 100644 --- a/src/fonts.js +++ b/src/fonts.js @@ -2092,7 +2092,7 @@ var Font = (function FontClosure() { window.btoa(data) + ');'); var rule = "@font-face { font-family:'" + fontName + "';src:" + url + '}'; - document.documentElement.firstChild.appendChild( + document.documentElement.getElementsByTagName('head')[0].appendChild( document.createElement('style')); var styleSheet = document.styleSheets[document.styleSheets.length - 1];