canvasRules.clear();
try (InputStream in = getSourceInputStream()) {
try {
// evaluate @media { ... } blocks
MapCSSParser preprocessor = new MapCSSParser(in, "UTF-8", MapCSSParser.LexicalState.PREPROCESSOR);
String mapcss = preprocessor.pp_root(this);
// do the actual mapcss parsing
InputStream in2 = new ByteArrayInputStream(mapcss.getBytes(StandardCharsets.UTF_8));
MapCSSParser parser = new MapCSSParser(in2, "UTF-8", MapCSSParser.LexicalState.DEFAULT);
parser.sheet(this);