Jump to:
| Project: | Data URI Sprites Generator |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
In a follow-up to #849356: Does this really need to work on non-aggregated files?,
The module doesn't currently work when CSS aggregation is enabled.
I've had a look through the code, but I can't see the issue that's causing it.
On a broader sense, In terms of a plan of attack, I would suggest hooking into the CSS aggregation process, and manipulating the CSS aggregated file before it is saved at all.
This post
http://www.phpied.com/data-uris-mhtml-ie7-win7-vista-blues/
is the most comprehensive guide I could find in terms of how to manage all the different scenarios.
However, I don't like the browser sniffing employed in his example PHP class.
I think that the method used to satisfy IE on Vista would still work for all browsers [I still need to test this],
and that would be sufficient.
In this case, all background images are replaced by a single HTML file.
The original css is rewritten to point to this external css file.
Alternatively, we can do it 'properly' for normal browsers.
Rewrite the CSS file before saving the aggregated file.
And then add the 2 files in conditional stylesheets for IE7, IE6.
It does mean that they get the same information twice.
Its all a case of trade-off between satisfying different scenarios in any case.
Anyway, that's my 2c!
Alan
Comments
#1
An example of a module which hooks into the CSS aggregation process, and manipulates the files saved.
http://drupal.org/project/sf_cache
#2
IE 7 on Vista is satisfied by using correct closing block with boundary at the end of MHTML resources part, IE 6 & 7 on other platforms will be happy with it too.
So, for now the plan is:
1. After CSS aggregation made by Drupal core, parse CSS for images, remove links from aggregated CSS and save it.
2. Generate two different CSS files: first for normal browsers and second for IE 6 & 7. And append them both as separate files inside conditional comments, so all browsers will get images only once.
Maybe there will be an option later to disable IE 6 & 7 support (I'll remove all options from UI for now) and with old IE support disabled module will simply replace link-images with data-uri-images in aggregated CSS file.
#3
Latest CVS code works only with aggregated CSS files and removes all url(...) links to local files from these files. Sprites are still included as two separate files inside conditional comments: first with data-uri-images for normal browsers (including IE 8) and second with MHTML resources for IE 6 & 7.
http://drupal.org/cvs?commit=394188
#4
Automatically closed -- issue fixed for 2 weeks with no activity.