@SuppressWarnings("unused") private boolean processClip(Declaration d, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { if (d.size() != 1) return false; Term<?> term = d.get(0); if (term instanceof TermIdent) { final Set<Clip> allowedClips = EnumSet.allOf(Clip.class); Clip clip = genericPropertyRaw(Clip.class, allowedClips, (TermIdent) term); if (clip != null) { properties.put("clip-top", clip); properties.put("clip-right", clip); properties.put("clip-bottom", clip); properties.put("clip-left", clip); return true; } return false; } else if (term instanceof TermFunction) { TermFunction termf = (TermFunction) term; // this is possibly valid rect() function if ("rect".equals(termf.getFunctionName()) && termf.size() == 4) { Repeater clip = new ClipRepeater(); clip.assignTerms(termf.getValue().toArray(new Term<?>[0])); return clip.repeat(properties, values); } } return false; }
private String checkForFormat(Term<?> term) { if (term instanceof TermFunction && term.getOperator() == Operator.SPACE) { final TermFunction fn = (TermFunction) term; if (fn.getFunctionName().equalsIgnoreCase("format") && fn.size() == 1 && fn.get(0) instanceof TermString) { return ((TermString) fn.get(0)).getValue(); } else return null; } else return null; }
private String checkForFormat(Term<?> term) { if (term instanceof TermFunction && term.getOperator() == Operator.SPACE) { final TermFunction fn = (TermFunction) term; if (fn.getFunctionName().equalsIgnoreCase("format") && fn.size() == 1 && fn.get(0) instanceof TermString) { return ((TermString) fn.get(0)).getValue(); } else return null; } else return null; }
if ((COLOR_RGB_NAME.equals(func.getFunctionName()) && func.size() == COLOR_PARAMS_COUNT) || COLOR_RGBA_NAME.equals(func.getFunctionName()) && func.size() == COLOR_PARAMS_COUNT + 1) { if (func.size() > COLOR_PARAMS_COUNT) else if ((COLOR_HSL_NAME.equals(func.getFunctionName()) && func.size() == COLOR_PARAMS_COUNT) || COLOR_HSLA_NAME.equals(func.getFunctionName()) && func.size() == COLOR_PARAMS_COUNT + 1) { if (func.size() > COLOR_PARAMS_COUNT)
if ((COLOR_RGB_NAME.equals(func.getFunctionName()) && func.size() == COLOR_PARAMS_COUNT) || COLOR_RGBA_NAME.equals(func.getFunctionName()) && func.size() == COLOR_PARAMS_COUNT + 1) { if (func.size() > COLOR_PARAMS_COUNT) else if ((COLOR_HSL_NAME.equals(func.getFunctionName()) && func.size() == COLOR_PARAMS_COUNT) || COLOR_HSLA_NAME.equals(func.getFunctionName()) && func.size() == COLOR_PARAMS_COUNT + 1) { if (func.size() > COLOR_PARAMS_COUNT)
if (fn.getFunctionName().equalsIgnoreCase("local") && fn.size() == 1 && fn.get(0) instanceof TermString)
if (fn.getFunctionName().equalsIgnoreCase("local") && fn.size() == 1 && fn.get(0) instanceof TermString)