ro.isdc.wro.model.resource.processor.impl.css
Class FallbackCssDataUriProcessor
java.lang.Object
ro.isdc.wro.model.resource.processor.impl.css.AbstractCssUrlRewritingProcessor
ro.isdc.wro.model.resource.processor.impl.css.CssDataUriPreProcessor
ro.isdc.wro.model.resource.processor.impl.css.FallbackCssDataUriProcessor
- All Implemented Interfaces:
- ImportAware, ResourcePostProcessor, ResourcePreProcessor
public class FallbackCssDataUriProcessor
- extends CssDataUriPreProcessor
Preserves the original css uri along with the new one. This should work also with browsers which do not support
dataURI's.
Sample Input:
div {
background: url('image.png');
}
Sample output:
div {
background: url('image.png');
background: url('data:image/png;base64,iVBORw0...');
}
Applies the graceful degradation technique. For example, if browser can't parse second rule, it'll use first one.
- Since:
- 1.4.7
- Author:
- Alex Objelean
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ALIAS
public static final String ALIAS
- See Also:
- Constant Field Values
FallbackCssDataUriProcessor
public FallbackCssDataUriProcessor()
replaceDeclaration
protected String replaceDeclaration(String originalDeclaration,
String modifiedDeclaration)
- Invoked to replace the entire css declaration.
An example of css declaration:
background: url(/image.png);
Useful when the css declaration should be changed. The use-case is: FallbackCssDataUriProcessor
.
- Overrides:
replaceDeclaration
in class AbstractCssUrlRewritingProcessor
- Parameters:
originalDeclaration
- the original, unchanged declaration.modifiedDeclaration
- the changed expression.
- Returns:
- the expression to apply. By default the modifiedExpression will be returned.
newCssUrlInspector
protected CssUrlInspector newCssUrlInspector()
- Overrides:
newCssUrlInspector
in class AbstractCssUrlRewritingProcessor
Copyright © 2008-2013. All Rights Reserved.