URL url = mr.getURI();
/** * Parses and fills the given style-sheet. * @param ss The stylesheet to fill. * @param uri The base URI. */ protected void parseStyleSheet(StyleSheet ss, InputSource is, ParsedURL uri) throws IOException { parser.setSelectorFactory(CSSSelectorFactory.INSTANCE); parser.setConditionFactory(cssConditionFactory); try { cssBaseURI = uri; styleSheetDocumentHandler.styleSheet = ss; parser.setDocumentHandler(styleSheetDocumentHandler); parser.parseStyleSheet(is); // Load the imported sheets. int len = ss.getSize(); for (int i = 0; i < len; i++) { Rule r = ss.getRule(i); if (r.getType() != ImportRule.TYPE) { // @import rules must be the first rules. break; } ImportRule ir = (ImportRule)r; parseStyleSheet(ir, ir.getURI()); } } finally { cssBaseURI = null; } }
/** * Parses and fills the given style-sheet. * @param ss The stylesheet to fill. * @param uri The base URI. */ protected void parseStyleSheet(StyleSheet ss, InputSource is, ParsedURL uri) throws IOException { parser.setSelectorFactory(CSSSelectorFactory.INSTANCE); parser.setConditionFactory(cssConditionFactory); try { cssBaseURI = uri; styleSheetDocumentHandler.styleSheet = ss; parser.setDocumentHandler(styleSheetDocumentHandler); parser.parseStyleSheet(is); // Load the imported sheets. int len = ss.getSize(); for (int i = 0; i < len; i++) { Rule r = ss.getRule(i); if (r.getType() != ImportRule.TYPE) { // @import rules must be the first rules. break; } ImportRule ir = (ImportRule)r; parseStyleSheet(ir, ir.getURI()); } } finally { cssBaseURI = null; } }
/** * Parses and fills the given style-sheet. * @param ss The stylesheet to fill. * @param uri The base URI. */ protected void parseStyleSheet(StyleSheet ss, InputSource is, ParsedURL uri) throws IOException { parser.setSelectorFactory(CSSSelectorFactory.INSTANCE); parser.setConditionFactory(cssConditionFactory); try { cssBaseURI = uri; styleSheetDocumentHandler.styleSheet = ss; parser.setDocumentHandler(styleSheetDocumentHandler); parser.parseStyleSheet(is); // Load the imported sheets. int len = ss.getSize(); for (int i = 0; i < len; i++) { Rule r = ss.getRule(i); if (r.getType() != ImportRule.TYPE) { // @import rules must be the first rules. break; } ImportRule ir = (ImportRule)r; parseStyleSheet(ir, ir.getURI()); } } finally { cssBaseURI = null; } }