use of com.helger.css.reader.errorhandler.LoggingCSSParseErrorHandler in project ph-css by phax.
the class Issue24Test method testIssue.
@Test
public void testIssue() {
final IReadableResource aRes = new ClassPathResource("testfiles/css30/bad_but_browsercompliant/issue24.css");
assertTrue(aRes.exists());
final CascadingStyleSheet aCSS = CSSReader.readFromStream(aRes, new CSSReaderSettings().setFallbackCharset(StandardCharsets.UTF_8).setBrowserCompliantMode(true).setCustomErrorHandler(new LoggingCSSParseErrorHandler()));
assertNotNull(aCSS);
if (false)
System.out.println(new CSSWriter().getCSSAsString(aCSS));
}
use of com.helger.css.reader.errorhandler.LoggingCSSParseErrorHandler in project ph-css by phax.
the class Issue4Test method testIssue4.
@Test
public void testIssue4() {
final IReadableResource aRes = new ClassPathResource("testfiles/css30/good/issue4.css");
assertTrue(aRes.exists());
final CascadingStyleSheet aCSS = CSSReader.readFromStream(aRes, StandardCharsets.UTF_8, ECSSVersion.CSS30, new LoggingCSSParseErrorHandler());
assertNotNull(aCSS);
if (false)
System.out.println(new CSSWriter(ECSSVersion.CSS30).getCSSAsString(aCSS));
}
use of com.helger.css.reader.errorhandler.LoggingCSSParseErrorHandler in project ph-css by phax.
the class Issue8Test method testIssue8.
@Test
public void testIssue8() {
final IReadableResource aRes = new ClassPathResource("testfiles/css30/good/issue8.css");
assertTrue(aRes.exists());
final CascadingStyleSheet aCSS = CSSReader.readFromStream(aRes, StandardCharsets.UTF_8, ECSSVersion.CSS30, new LoggingCSSParseErrorHandler());
assertNotNull(aCSS);
assertEquals(1, aCSS.getStyleRuleCount());
final CSSStyleRule aStyleRule = aCSS.getStyleRuleAtIndex(0);
assertNotNull(aStyleRule);
assertEquals(4, aStyleRule.getDeclarationCount());
}
use of com.helger.css.reader.errorhandler.LoggingCSSParseErrorHandler in project ph-css by phax.
the class IssueGC18Test method testIssue18.
@Test
public void testIssue18() {
final IReadableResource aRes = new ClassPathResource("testfiles/css30/good/issue-gc-18.css");
assertTrue(aRes.exists());
final CascadingStyleSheet aCSS = CSSReader.readFromStream(aRes, StandardCharsets.UTF_8, ECSSVersion.CSS30, new LoggingCSSParseErrorHandler());
assertNotNull(aCSS);
if (false)
System.out.println(new CSSWriter(ECSSVersion.CSS30).getCSSAsString(aCSS));
}
Aggregations