Skip to content

Commit ebabe74

Browse files
authored
Merge pull request #382 from w3c/sideshowbarker/preprocessing-skipping-allow
Allow preprocessing of the input stream to be skipped
2 parents d8af31b + e63c99b commit ebabe74

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

org/w3c/css/css/StyleSheetParser.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public final class StyleSheetParser
5050
implements CssValidatorListener, CssParser {
5151

5252
private static Constructor co = null;
53+
private static boolean isPreprocessed;
5354

5455
static {
5556
try {
@@ -64,10 +65,15 @@ public final class StyleSheetParser
6465
CssFouffa cssFouffa;
6566
StyleSheet style = new StyleSheet();
6667

67-
public StyleSheetParser(ApplContext ac) {
68+
public StyleSheetParser(ApplContext ac, boolean isPreprocessed) {
69+
this.isPreprocessed = isPreprocessed;
6870
ac.setStyleSheet(getStyleSheet());
6971
}
7072

73+
public StyleSheetParser(ApplContext ac) {
74+
new StyleSheetParser(ac, false);
75+
}
76+
7177
public void reInit() {
7278
style = new StyleSheet();
7379
}
@@ -293,7 +299,8 @@ public void parseStyleElement(ApplContext ac, Reader reader,
293299

294300
// if (cssFouffa == null) {
295301
String charset = ac.getCharsetForURL(url);
296-
if (ac.getCssVersion().compareTo(CssVersion.CSS2) >=0 ) {
302+
if (ac.getCssVersion().compareTo(CssVersion.CSS2) >=0
303+
&& !isPreprocessed) {
297304
cssFouffa = new CssFouffa(ac, new UnescapeFilterReader(new BufferedReader(reader)), url, lineno);
298305
} else {
299306
cssFouffa = new CssFouffa(ac, reader, url, lineno);

0 commit comments

Comments
 (0)