public class FallbackCssDataUriProcessor extends CssDataUriPreProcessor
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.| Constructor and Description |
|---|
FallbackCssDataUriProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected CssUrlInspector |
newCssUrlInspector() |
protected String |
replaceDeclaration(String originalDeclaration,
String modifiedDeclaration)
Invoked to replace the entire css declaration.
|
getDataUriGenerator, isReplaceAccepted, isReplaceNeeded, replaceImageUrlgetUrlPrefix, isImportAware, onProcessCompleted, onUrlReplaced, process, processpublic static final String ALIAS
protected String replaceDeclaration(String originalDeclaration, String modifiedDeclaration)
background: url(/image.png);Useful when the css declaration should be changed. The use-case is:
FallbackCssDataUriProcessor.replaceDeclaration in class AbstractCssUrlRewritingProcessororiginalDeclaration - the original, unchanged declaration.modifiedDeclaration - the changed expression.protected CssUrlInspector newCssUrlInspector()
newCssUrlInspector in class AbstractCssUrlRewritingProcessorCopyright © 2008-2014. All Rights Reserved.