RadioPeirasmos / spriteme

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

Export CSS on Chrome #93

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Visit spriteme.org
2. Get SpriteMe as bookmark to work (needed to clean up some characters in an 
editor, before I came up with a solution that was more straight-forward — to 
inspect element and copy link address and edit the bookmark content).
3. Get Firebug Lite working.
4. Start the demo.
5. Go through all steps.
6. Try to export CSS.

What is the expected output? What do you see instead?
Error in Firebug Lite: "Uncaught TypeError: Cannot read property 'length' of 
null (spriteme.js,695)"

What version of the product are you using? On what operating system?
Mac OS X 10.6.8
Chrome 15.0.874.24 beta

Please provide any additional information below.
686.            var aRules = [];
687.            try {
688.                aRules = ( SpriteMe.bIE ? stylesheet.rules : stylesheet.cssRules );
689.            }
690.            catch(err) {
691.                hRestrictedStylesheets[url] = true;
692.            }
693. 
694.            // Loop through each rule
695.            for ( var r = 0, nRules = aRules.length; r < nRules; r++ ) {

Obviously there is something about line 688 causing the null-object — but I 
leave it up to you guys to figure out a solution that suits best...

Maybe skip SpriteMe.bIE and write:
aRules = ( stylesheet.cssRules? stylesheet.rules : stylesheet.cssRules );

As suggested here: (http://www.javascriptkit.com/dhtmltutors/externalcss3.shtml)
var firstrule=mysheet.cssRules? mysheet.cssRules[0]: mysheet.rules[0]

Original issue reported on code.google.com by jonas.ca...@gmail.com on 28 Sep 2011 at 8:50

GoogleCodeExporter commented 9 years ago
Expected output is of course the CSS — posted only the error.

Original comment by jonas.ca...@gmail.com on 28 Sep 2011 at 8:52

GoogleCodeExporter commented 9 years ago
And of course the other way around in my suggestion:

aRules = ( stylesheet.cssRules? stylesheet.cssRules : stylesheet.rules );

Original comment by jonas.ca...@gmail.com on 28 Sep 2011 at 8:56