@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; }