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()));
}
}