Examples of CSSStyleSheet


Examples of com.google.gwt.resources.css.ast.CssStylesheet

    // Compute the local effective namespace
    Map<String, Map<JMethod, String>> classReplacementsWithPrefix = processImports(
        logger, typeOracle, cssResourceSubtype, method, context);

    boolean strict = isStrict(logger, method);
    CssStylesheet sheet = stylesheetMap.get(method);

    // Create CSS sprites
    (new Spriter(logger, context)).accept(sheet);

    // Perform @def and @eval substitutions
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssStylesheet

      this.sheet = sheet;
      this.timestamp = timestamp;
    }

    public CssStylesheet getCopyOfStylesheet() {
      return new CssStylesheet(sheet);
    }
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssStylesheet

    this.lenient = lenient;
  }

  public String toGss() throws UnableToCompleteException {
      try {
        CssStylesheet sheet = GenerateCssAst.exec(treeLogger, cssFile);

        DefCollectorVisitor defCollectorVisitor = new DefCollectorVisitor(lenient, treeLogger);
        defCollectorVisitor.accept(sheet);
        defNameMapping = defCollectorVisitor.getDefMapping();
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssStylesheet

* Tests the CssNodeCloner utility class.
*/
public class CssNodeClonerTest extends CssTestCase {

  public void testClone() throws UnableToCompleteException {
    CssStylesheet sheet = GenerateCssAst.exec(TreeLogger.NULL,
        getClass().getClassLoader().getResource(
            "com/google/gwt/resources/client/test.css"));

    CssStylesheet cloned = CssNodeCloner.clone(CssStylesheet.class, sheet);

    assertNotSame(sheet, cloned);
    assertNoAliasing(cloned);
  }
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssStylesheet

    assertNotSame(sheet, cloned);
    assertNoAliasing(cloned);
  }

  public void testCloneList() throws UnableToCompleteException {
    CssStylesheet sheet = GenerateCssAst.exec(TreeLogger.NULL,
        getClass().getClassLoader().getResource(
            "com/google/gwt/resources/client/test.css"));

    List<CssNode> cloned = CssNodeCloner.clone(CssNode.class, sheet.getNodes());

    assertEquals(sheet.getNodes().size(), cloned.size());

    for (CssNode node : cloned) {
      assertNoAliasing(node);
    }
  }
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssStylesheet

      assertNoAliasing(node);
    }
  }

  public void testCloneMedia() throws UnableToCompleteException {
    CssStylesheet sheet = GenerateCssAst.exec(TreeLogger.NULL,
        getClass().getClassLoader().getResource(
            "com/google/gwt/resources/css/media.css"));

    CssStylesheet cloned = CssNodeCloner.clone(CssStylesheet.class, sheet);

    assertEquals("@media print, standard {\n}\n", cloned.toString());
  }
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssStylesheet

  private static final String COMPLEX = "@complex {\n  with: arbitrary;\n  stuff: inside;\n}";
  private static final String EXTENDED = "@-extended-ident {\n  \n}";
  private static final String SIMPLE = "@simple;";

  public void test() throws UnableToCompleteException {
    CssStylesheet sheet = GenerateCssAst.exec(TreeLogger.NULL,
        getClass().getClassLoader().getResource(
            "com/google/gwt/resources/css/unknownAtRule.css"));

    List<CssNode> nodes = sheet.getNodes();
    assertEquals(3, nodes.size());
    assertEquals(SIMPLE, ((CssUnknownAtRule) nodes.get(0)).getRule());
    assertEquals(COMPLEX, ((CssUnknownAtRule) nodes.get(1)).getRule());
    assertEquals(EXTENDED, ((CssUnknownAtRule) nodes.get(2)).getRule());
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssStylesheet

*/
public class AtCharsetRuleStrippingTest extends TestCase {
  private static final String SIMPLE = "@simple;";

  public void test() throws UnableToCompleteException {
    CssStylesheet sheet = GenerateCssAst.exec(TreeLogger.NULL,
        getClass().getClassLoader().getResource(
            "com/google/gwt/resources/css/atCharsetRule.css"));

    List<CssNode> nodes = sheet.getNodes();
    assertEquals(1, nodes.size());

    TextOutput out = new DefaultTextOutput(true);
    CssGenerationVisitor v = new CssGenerationVisitor(out);
    v.accept(sheet);
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssStylesheet

* Tests {@link ExternalClassesCollector}.
*/
public class CssExternalTest extends CssTestCase {

  public void testExternal() throws UnableToCompleteException {
    CssStylesheet sheet = GenerateCssAst.exec(TreeLogger.NULL,
        getClass().getClassLoader().getResource(
            "com/google/gwt/resources/css/external.css"));
    assertNotNull(sheet);

    ExternalClassesCollector v = new ExternalClassesCollector();
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssStylesheet

  /**
   * Make sure the short-circuit logic for <code>{@literal @external} *</code> works correctly.
   */
  public void testExternalStar() throws UnableToCompleteException {
    CssStylesheet sheet = GenerateCssAst.exec(TreeLogger.NULL,
        getClass().getClassLoader().getResource(
            "com/google/gwt/resources/css/external_star.css"),
        getClass().getClassLoader().getResource(
            "com/google/gwt/resources/css/external.css"));
    assertNotNull(sheet);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.