本文整理汇总了Java中com.helger.css.ECSSVersion.LATEST属性的典型用法代码示例。如果您正苦于以下问题:Java ECSSVersion.LATEST属性的具体用法?Java ECSSVersion.LATEST怎么用?Java ECSSVersion.LATEST使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.helger.css.ECSSVersion
的用法示例。
在下文中一共展示了ECSSVersion.LATEST属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testIssue
@Test
@Ignore ("TODO")
public void testIssue ()
{
final String css = ".pen {background-color:red} {* some incorrect block *} .pen {background-color: blue}";
final CSSReaderSettings aSettings = new CSSReaderSettings ().setCSSVersion (ECSSVersion.LATEST)
.setBrowserCompliantMode (true)
.setCustomErrorHandler (new LoggingCSSParseErrorHandler ())
.setCustomExceptionHandler (new LoggingCSSParseExceptionCallback ());
final CascadingStyleSheet cascadingStyleSheet = CSSReader.readFromStringStream (css, aSettings);
assertNotNull (cascadingStyleSheet);
final CSSWriter writer = new CSSWriter (new CSSWriterSettings (ECSSVersion.LATEST, true));
s_aLogger.info (writer.getCSSAsString (cascadingStyleSheet));
}
示例2: testIssue
@Test
public void testIssue ()
{
final String css = "@media screen and (min-width: 768px) {.section {.\r\n" +
" padding: 40px\r\n" +
"}\r\n" +
"\r\n" +
"}";
final CSSReaderSettings aSettings = new CSSReaderSettings ().setCSSVersion (ECSSVersion.LATEST)
.setBrowserCompliantMode (true)
.setCustomErrorHandler (new DoNothingCSSParseErrorHandler ());
final CascadingStyleSheet cascadingStyleSheet = CSSReader.readFromStringStream (css, aSettings);
final CSSWriter writer = new CSSWriter (new CSSWriterSettings (ECSSVersion.LATEST, true));
assertEquals ("@media screen and (min-width:768px){.section{}}", writer.getCSSAsString (cascadingStyleSheet));
}
示例3: testIssue
@Test
public void testIssue ()
{
// No log message may be issued in this test!
final String css = "@media \\0screen\\,screen\\9 {.test {margin-left: 0px}}";
final CSSReaderSettings aSettings = new CSSReaderSettings ().setCSSVersion (ECSSVersion.LATEST)
.setBrowserCompliantMode (true)
.setInterpretErrorHandler (new DoNothingCSSInterpretErrorHandler ());
final CascadingStyleSheet cascadingStyleSheet = CSSReader.readFromStringStream (css, aSettings);
final CSSWriter writer = new CSSWriter (new CSSWriterSettings (ECSSVersion.LATEST, true));
assertEquals ("@media \\0screen\\,screen\\9 {.test{margin-left:0}}", writer.getCSSAsString (cascadingStyleSheet));
}
示例4: testIssue
@Test
public void testIssue ()
{
final String css = "h1:lang(or) { line-height: 1.2em; }";
final CSSReaderSettings aSettings = new CSSReaderSettings ().setCSSVersion (ECSSVersion.LATEST)
.setBrowserCompliantMode (true);
final CascadingStyleSheet cascadingStyleSheet = CSSReader.readFromStringStream (css, aSettings);
final CSSWriter writer = new CSSWriter (new CSSWriterSettings (ECSSVersion.LATEST, true));
assertEquals ("h1:lang(or){line-height:1.2em}", writer.getCSSAsString (cascadingStyleSheet));
}
示例5: testIssue
@Test
public void testIssue ()
{
final String css = StreamHelper.getAllBytesAsString (new FileSystemResource ("src/test/resources/testfiles/css30/good/issue35.css"),
StandardCharsets.UTF_8);
final CSSReaderSettings aSettings = new CSSReaderSettings ().setCSSVersion (ECSSVersion.LATEST)
.setBrowserCompliantMode (false);
final CascadingStyleSheet cascadingStyleSheet = CSSReader.readFromStringStream (css, aSettings);
assertNotNull (cascadingStyleSheet);
final CSSWriter writer = new CSSWriter (new CSSWriterSettings (ECSSVersion.LATEST, true));
assertNotNull (writer.getCSSAsString (cascadingStyleSheet));
}
示例6: CSSWriterSettings
/**
* Default constructor using the latest CSS version and none-optimized output.
*/
public CSSWriterSettings ()
{
this (ECSSVersion.LATEST, DEFAULT_OPTIMIZED_OUTPUT);
}