Package com.google.caja.lang.css

Examples of com.google.caja.lang.css.CssPropertyPatterns


  CssPropertyPatterns pp;

  @Override
  public void setUp() throws Exception {
    super.setUp();
    pp = new CssPropertyPatterns(CssSchema.getDefaultCss21Schema(mq));
  }
View Full Code Here


    assertDigest("[ foo | [ a || b || c || d ] | bar ]",
                 "{\n  'lits': [ 'a', 'b', 'bar', 'c', 'd', 'foo' ]\n}");
  }

  public final void testLiteralExtraction() {
    CssPropertyPatterns pp = new CssPropertyPatterns(
        CssSchema.getDefaultCss21Schema(mq));
    String text = "[ foo || bar() ]";
    CssPropertyData actual = pp.cssPropertyToData("test", parseSignature(text));
    assertEquals("test", actual.key);
    assertEquals(actual.fns.toString(), 1, actual.fns.size());
    assertEquals("bar", actual.fns.iterator().next().getName());

  }
View Full Code Here

   */
  private void fixTerms(AncestorChain<? extends CssTree> t) {
    SymbolInfo stdColors = cssSchema.getSymbol(Name.css("color-standard"));
    final Pattern stdColorMatcher;
    if (stdColors != null) {
      stdColorMatcher = new CssPropertyPatterns(cssSchema)
          .cssPropertyToJavaRegex(stdColors.sig);
    } else {
      stdColorMatcher = null;
    }
    t.node.visitPreOrder(new ParseTreeNodeVisitor() {
View Full Code Here

            + "}",
            getName()));
}

  private String toPattern(String sig) {
    CssPropertyPatterns pp = new CssPropertyPatterns(
        CssSchema.getDefaultCss21Schema(mq));
    return pp.cssPropertyToPattern(parseSignature(sig), true).regex;
  }
View Full Code Here

   */
  private void fixTerms(AncestorChain<? extends CssTree> t) {
    SymbolInfo stdColors = schema.getSymbol(Name.css("color-standard"));
    final Pattern stdColorMatcher;
    if (stdColors != null) {
      stdColorMatcher = new CssPropertyPatterns(schema)
          .cssPropertyToJavaRegex(stdColors.sig);
    } else {
      stdColorMatcher = null;
    }
    t.node.visitPreOrder(new ParseTreeNodeVisitor() {
View Full Code Here

TOP

Related Classes of com.google.caja.lang.css.CssPropertyPatterns

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.