当前位置: 首页>>代码示例>>Java>>正文


Java ECSSVersion.LATEST属性代码示例

本文整理汇总了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));
}
 
开发者ID:phax,项目名称:ph-css,代码行数:14,代码来源:Issue34Test.java

示例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));
}
 
开发者ID:phax,项目名称:ph-css,代码行数:15,代码来源:Issue36Test.java

示例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));
}
 
开发者ID:phax,项目名称:ph-css,代码行数:13,代码来源:Issue33Test.java

示例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));
}
 
开发者ID:phax,项目名称:ph-css,代码行数:10,代码来源:Issue38Test.java

示例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));
}
 
开发者ID:phax,项目名称:ph-css,代码行数:12,代码来源:Issue35Test.java

示例6: CSSWriterSettings

/**
 * Default constructor using the latest CSS version and none-optimized output.
 */
public CSSWriterSettings ()
{
  this (ECSSVersion.LATEST, DEFAULT_OPTIMIZED_OUTPUT);
}
 
开发者ID:phax,项目名称:ph-css,代码行数:7,代码来源:CSSWriterSettings.java


注:本文中的com.helger.css.ECSSVersion.LATEST属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。