Dyhzy / spriteme

Automatically exported from code.google.com/p/spriteme
0 stars 0 forks source link

exportCSS and @font-face #83

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Like your problem with @media xxx there's a problem with @font-face, it throws 
an error "Illegal operation on WrappedNative prototype object" at line 701 : 
var bgPos = rule.style.backgroundPosition;

To fix it I just modified the conditions above it to :
if ( "undefined" === typeof(rule.style) || /^@font-face/.test(rule.cssText) )

Seems to work now in firefox 3.6.12 (not tested in other browsers)

Original issue reported on code.google.com by k1rby...@gmail.com on 29 Oct 2010 at 9:05

GoogleCodeExporter commented 8 years ago
my solution was changing line 703 from
if ( -1 != rule.selectorText.indexOf('spriteme') ) {
to
if (rule instanceof CSSFontFaceRule || -1 != 
rule.selectorText.indexOf('spriteme') ) {

works on chrome, which is what I was after

Original comment by seu...@gmail.com on 31 Mar 2011 at 11:17

GoogleCodeExporter commented 8 years ago
patch off r30

Original comment by seu...@gmail.com on 31 Mar 2011 at 11:20

Attachments:

GoogleCodeExporter commented 8 years ago
actually, this is prolly better, instead of checking if it is a font-face rule, 
it's prolly better to check if it isn't a css style rule :P

Original comment by seu...@gmail.com on 31 Mar 2011 at 11:30

Attachments:

GoogleCodeExporter commented 8 years ago
I just ran into this problem as well. Is the solution going to be pulled into 
the code?

Original comment by d...@driverdan.com on 14 Aug 2011 at 9:36

GoogleCodeExporter commented 8 years ago
Just had the same problem - when will a fix be available?
My workaround was to remove the corresponding lines temporarily.

Original comment by siemens1993@gmail.com on 14 Jun 2012 at 5:10