changcheng / wro4j

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

Create alternative cssDataUri processor implementation #448

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Create a cssDataUri processor which would preserve the original css uri along 
with the new one. This should work also with browsers which do not support 
dataURI's.

Example:
Input:
div {
    background: url('image.png');
}

Output:
div {
    background: url('image.png');
    background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC');
}

It's unnecessary to generate two CSS-files to support old browsers. You can use 
graceful degradation technique. Therefore, if browser can't parse second rule, 
it'll use first one. I've tested this solution in IE7 and it works.

Original issue reported on code.google.com by alex.obj...@gmail.com on 31 May 2012 at 5:09

GoogleCodeExporter commented 9 years ago

Original comment by alex.obj...@gmail.com on 1 Jun 2012 at 12:10

GoogleCodeExporter commented 9 years ago

Original comment by alex.obj...@gmail.com on 4 Jun 2012 at 1:03

GoogleCodeExporter commented 9 years ago
Created a processor called FallbackCssDataUriProcessor with alias 
"fallbackCssDataUri". 
The fix is available in branch 1.4.x

Original comment by alex.obj...@gmail.com on 4 Jun 2012 at 2:36