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 |
|---|---|
int |
getDeclarationGroupIndex() |
protected String |
getPattern() |
protected int |
getUrlIndexA()
index of the group containing an url inside a declaration of this form:
|
protected int |
getUrlIndexB()
index of the group containing an url inside a declaration of this form:
|
protected String |
replaceDeclaration(String originalDeclaration,
String modifiedDeclaration)
Invoked to replace the entire css declaration.
|
getDataUriGenerator, isReplaceAccepted, isReplaceNeeded, replaceImageUrl, replaceWithDataUricleanImageUrl, getUrlPrefix, 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 String getPattern()
getPattern in class AbstractCssUrlRewritingProcessorpublic int getDeclarationGroupIndex()
getDeclarationGroupIndex in class AbstractCssUrlRewritingProcessorprotected int getUrlIndexA()
body {
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/tabs/tabContent.png', sizingMethod='scale' );
}
or
getUrlIndexA in class AbstractCssUrlRewritingProcessorprotected int getUrlIndexB()
body {
background: #B3B3B3 url(img.gif);
color:red;
}
getUrlIndexB in class AbstractCssUrlRewritingProcessorCopyright © 2008-2013. All Rights Reserved.