use of org.eclipse.mylyn.wikitext.parser.css.Stylesheet in project mylyn.docs by eclipse.
the class CssParserTest method testSimple.
public void testSimple() throws IOException {
Stylesheet stylesheet = parser.parse(readFully(CssParserTest.class.getSimpleName() + "_0.css"));
assertNotNull(stylesheet);
assertEquals(25, stylesheet.getBlocks().size());
}
use of org.eclipse.mylyn.wikitext.parser.css.Stylesheet in project mylyn.docs by eclipse.
the class HtmlTextPresentationParserTest method assertDefaultCssStyles.
private void assertDefaultCssStyles(String expectedStyles, final String elementName) {
Stylesheet stylesheet = defaultStylesheet();
final List<String> styles = new ArrayList<>();
Receiver receiver = new Receiver() {
@Override
public void apply(CssRule rule) {
styles.add(rule.name + ": " + rule.value);
}
};
stylesheet.applyTo(new ElementInfo() {
@Override
public boolean hasId(String id) {
return false;
}
@Override
public boolean hasCssClass(String cssClass) {
return false;
}
@Override
public ElementInfo getParent() {
return null;
}
@Override
public String getLocalName() {
return elementName;
}
}, receiver);
assertEquals("element " + elementName, expectedStyles, Joiner.on("; ").join(styles));
}
use of org.eclipse.mylyn.wikitext.parser.css.Stylesheet in project mylyn.docs by eclipse.
the class CssParserTest method testComments.
public void testComments() {
Stylesheet stylesheet = parser.parse("tr { /* font-size: 115%; */ font-size: 100%; } /* foo { sdf: sdf; } */");
List<Block> blocks = stylesheet.getBlocks();
assertEquals(1, blocks.size());
Block block = blocks.get(0);
List<CssRule> rules = block.getRules();
assertEquals(1, rules.size());
CssRule rule = rules.get(0);
assertEquals("font-size", rule.name);
assertEquals("100%", rule.value);
}
Aggregations