Package com.google.caja.plugin

Examples of com.google.caja.plugin.CssValidator


          return noResult(attr);
        }

        // The validator will check that property values are well-formed,
        // marking those that aren't, and identifies all URLs.
        CssValidator v = new CssValidator(cssSchema, htmlSchema, mq)
            .withInvalidNodeMessageLevel(MessageLevel.WARNING);
        v.validateCss(AncestorChain.instance(decls));
        // The rewriter will remove any unsafe constructs.
        // and put URLs in the proper filename namespace
        new CssRewriter(meta.getUriPolicy(), cssSchema, htmlSchema, mq)
            .withInvalidNodeMessageLevel(MessageLevel.WARNING)
            .rewrite(AncestorChain.instance(decls));
View Full Code Here


   *   were needed but could not be made.
   */
  public boolean apply(Jobs jobs) {
    // TODO(mikesamuel): build up a list of classes and ids for use in
    // generating "no such symbol" warnings from the GXPs/HTML.
    CssValidator v = new CssValidator(
        cssSchema, htmlSchema, jobs.getMessageQueue());
    CssRewriter rw = new CssRewriter(
        jobs.getPluginMeta().getUriPolicy(), cssSchema, htmlSchema,
        jobs.getMessageQueue());

    for (MessageLevel level : new MessageLevel[] {
           // First try to remove unsafe constructs with warnings.
           MessageLevel.WARNING,
           // If there are still problems, error out.
           MessageLevel.ERROR
         }) {
      v.withInvalidNodeMessageLevel(level);
      rw.withInvalidNodeMessageLevel(level);
      for (JobEnvelope env : jobs.getJobsByType(ContentType.CSS)) {
        if (env.fromCache) { continue; }
        validate(v, rw, AncestorChain.instance((CssTree) env.job.getRoot()));
      }
View Full Code Here

          return noResult(attr);
        }

        // The validator will check that property values are well-formed,
        // marking those that aren't, and identifies all URLs.
        CssValidator v = new CssValidator(cssSchema, htmlSchema, mq)
            .withInvalidNodeMessageLevel(MessageLevel.WARNING);
        v.validateCss(AncestorChain.instance(decls));
        // The rewriter will remove any unsafe constructs.
        // and put URLs in the proper filename namespace
        new CssRewriter(meta.getUriPolicy(), cssSchema, mq)
            .withInvalidNodeMessageLevel(MessageLevel.WARNING)
            .rewrite(AncestorChain.instance(decls));
View Full Code Here

   *   were needed but could not be made.
   */
  public boolean apply(Jobs jobs) {
    // TODO(mikesamuel): build up a list of classes and ids for use in
    // generating "no such symbol" warnings from the GXPs/HTML.
    CssValidator v = new CssValidator(
        cssSchema, htmlSchema, jobs.getMessageQueue());
    CssRewriter rw = new CssRewriter(
        jobs.getPluginMeta().getUriPolicy(), cssSchema,
        jobs.getMessageQueue());

    for (MessageLevel level : new MessageLevel[] {
           // First try to remove unsafe constructs with warnings.
           MessageLevel.WARNING,
           // If there are still problems, error out.
           MessageLevel.ERROR
         }) {
      v.withInvalidNodeMessageLevel(level);
      rw.withInvalidNodeMessageLevel(level);
      for (JobEnvelope env : jobs.getJobsByType(ContentType.CSS)) {
        if (env.fromCache) { continue; }
        validate(v, rw, AncestorChain.instance((CssTree) env.job.getRoot()));
      }
View Full Code Here

TOP

Related Classes of com.google.caja.plugin.CssValidator

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.