private boolean appendSimpleSelector(SimpleSelector selector) { if (selector.hasLeadingCombinator()) append(selector.getLeadingCombinator()); appendSimpleSelectorHead(selector); appendSimpleSelectorTail(selector); return true; }
private void appendSimpleSelectorHead(SimpleSelector selector) { cssOnly.ensureSeparator(); if (!selector.isStar() || !selector.isEmptyForm()) { InterpolableName elementName = selector.getElementName(); cssAndSM.appendIgnoreNull(elementName.getName(), elementName.getUnderlyingStructure()); } }
private boolean isEmptySelector(Selector selector) { if (selector.isCombined()) return false; SelectorPart head = selector.getHead(); if (head.getType() != ASTCssNodeType.SIMPLE_SELECTOR) return false; SimpleSelector simpleHead = (SimpleSelector) head; if (!simpleHead.isEmptyForm() || !simpleHead.isStar()) { return false; } if (simpleHead.hasSubsequent()) return false; return true; }
private SimpleSelector createEmptySimpleSelector(ASTCssNode underlyingStructureSource) { SimpleSelector empty = new SimpleSelector(underlyingStructureSource.getUnderlyingStructure(), null, null, true); empty.setEmptyForm(true); return empty; }
private void appendSimpleSelectorTail(SimpleSelector selector) { List<ElementSubsequent> allChilds = selector.getSubsequent(); for (ElementSubsequent astCssNode : allChilds) { append(astCssNode); } }