rules.prepend(new RuleGenerateWith(Generator.class));
RuleReplaceWith ruleReplaceCanvas = new RuleReplaceWith("WebkitCanvasElement");
ruleReplaceCanvas.getRootCondition()
.getConditions().add(new ConditionWhenTypeIs("CanvasElement"));
rules.prepend(ruleReplaceCanvas);
rules.prepend(new RuleReplaceWithFallback("CanvasElement"));
// Creates rebind rule classes for the non-generator rules in the provided list.
precompiler.buildSimpleRuntimeRebindRules(rules);
// Only 3 rebind rules were created because the generator rule was skipped.