@SuppressWarnings("unused") private boolean processListStyle(Declaration d, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { Variator listStyle = new ListStyleVariator(); listStyle.assignTermsFromDeclaration(d); listStyle.assignDefaults(properties, values); return listStyle.vary(properties, values); }
@SuppressWarnings("unused") private boolean processBackgroundImage(Declaration d, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { final Variator background = new BackgroundVariator(); return background.tryOneTermVariant(BackgroundVariator.IMAGE, d, properties, values); }
&& checkInherit(ALL_VARIANTS, terms.get(0), properties)) return true; if (!variantCondition(v, i)) continue; continue; passed = variant(v, i, properties, values); if (passed) {
/** * Uses variator functionality to test selected variant on more terms. This * is used when variant is represented by more terms. Since usually only one * term per variant is used, only one multiple variant is allowed per * variator and should be placed as the last one * * @param variant * Number of variant (last variant in variator) * @param properties * Properties map where to store property type * @param values * Values map where to store property value * @param terms * Array of terms used for variant * @return <code>true</code> in case of success, <code>false</code> * otherwise */ public boolean tryMultiTermVariant(int variant, Map<String, CSSProperty> properties, Map<String, Term<?>> values, Term<?>... terms) { this.terms = Arrays.asList(terms); // try inherit variant if (this.terms.size() == 1 && checkInherit(variant, this.terms.get(0), properties)) return true; return variant(variant, new IntegerRef(0), properties, values); }
@SuppressWarnings("unused") private boolean processBackgroundPosition(Declaration d, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { final Variator background = new BackgroundVariator(); return background.tryMultiTermVariant(BackgroundVariator.POSITION, properties, values, d.toArray(new Term<?>[0])); }
properties.put(names.get(i), createInherit(i)); properties.put(names.get(variant), createInherit(variant));
@SuppressWarnings("unused") private boolean processBorderLeftColor(Declaration d, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { final Variator borderSide = new BorderSideVariator("left"); return borderSide.tryOneTermVariant(BorderSideVariator.COLOR, d, properties, values); }
&& checkInherit(ALL_VARIANTS, terms.get(0), properties)) return true; if (!variantCondition(v, i)) continue; continue; passed = variant(v, i, properties, values); if (passed) {
/** * Uses variator functionality to test selected variant on more terms. This * is used when variant is represented by more terms. Since usually only one * term per variant is used, only one multiple variant is allowed per * variator and should be placed as the last one * * @param variant * Number of variant (last variant in variator) * @param properties * Properties map where to store property type * @param values * Values map where to store property value * @param terms * Array of terms used for variant * @return <code>true</code> in case of success, <code>false</code> * otherwise */ public boolean tryMultiTermVariant(int variant, Map<String, CSSProperty> properties, Map<String, Term<?>> values, Term<?>... terms) { this.terms = Arrays.asList(terms); // try inherit variant if (this.terms.size() == 1 && checkInherit(variant, this.terms.get(0), properties)) return true; return variant(variant, new IntegerRef(0), properties, values); }
@SuppressWarnings("unused") private boolean processBackgroundSize(Declaration d, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { final Variator background = new BackgroundVariator(); return background.tryMultiTermVariant(BackgroundVariator.SIZE, properties, values, d.toArray(new Term<?>[0])); }
properties.put(names.get(i), createInherit(i)); properties.put(names.get(variant), createInherit(variant));
@SuppressWarnings("unused") private boolean processBackground(Declaration d, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { Variator background = new BackgroundVariator(); background.assignTermsFromDeclaration(d); background.assignDefaults(properties, values); return background.vary(properties, values); }
@SuppressWarnings("unused") private boolean processBorderLeftStyle(Declaration d, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { final Variator borderSide = new BorderSideVariator("left"); return borderSide.tryOneTermVariant(BorderSideVariator.STYLE, d, properties, values); }
&& checkInherit(ALL_VARIANTS, terms.get(0), properties)) return true; if (!variantCondition(v, i)) continue; continue; passed = variant(v, i, properties, values); if (passed) {
/** * Uses variator functionality to test selected variant on more terms. This * is used when variant is represented by more terms. Since usually only one * term per variant is used, only one multiple variant is allowed per * variator and should be placed as the last one * * @param variant * Number of variant (last variant in variator) * @param properties * Properties map where to store property type * @param values * Values map where to store property value * @param terms * Array of terms used for variant * @return <code>true</code> in case of success, <code>false</code> * otherwise */ public boolean tryMultiTermVariant(int variant, Map<String, CSSProperty> properties, Map<String, Term<?>> values, Term<?>... terms) { this.terms = Arrays.asList(terms); // try inherit variant if (this.terms.size() == 1 && checkInherit(variant, this.terms.get(0), properties)) return true; return variant(variant, new IntegerRef(0), properties, values); }
@SuppressWarnings("unused") private boolean processBackgroundSize(Declaration d, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { final Variator background = new BackgroundVariator(); return background.tryMultiTermVariant(BackgroundVariator.SIZE, properties, values, d.toArray(new Term<?>[0])); }
properties.put(names.get(i), createInherit(i)); properties.put(names.get(variant), createInherit(variant));
@SuppressWarnings("unused") private boolean processBorderBottom(Declaration d, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { Variator borderSide = new BorderSideVariator("bottom"); borderSide.assignTermsFromDeclaration(d); borderSide.assignDefaults(properties, values); return borderSide.vary(properties, values); }
@SuppressWarnings("unused") private boolean processFontVariant(Declaration d, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { final Variator font = new FontVariator(); return font.tryOneTermVariant(FontVariator.VARIANT, d, properties, values); }
&& checkInherit(ALL_VARIANTS, terms.get(0), properties)) return true; if (!variantCondition(v, i)) continue; continue; passed = variant(v, i, properties, values); if (passed) {