Пример #1
0
  private boolean appendSimpleSelector(SimpleSelector selector) {
    if (selector.hasLeadingCombinator()) append(selector.getLeadingCombinator());

    appendSimpleSelectorHead(selector);
    appendSimpleSelectorTail(selector);
    return true;
  }
Пример #2
0
 private void appendSimpleSelectorHead(SimpleSelector selector) {
   cssOnly.ensureSeparator();
   if (!selector.isStar() || !selector.isEmptyForm()) {
     InterpolableName elementName = selector.getElementName();
     cssAndSM.appendIgnoreNull(elementName.getName(), elementName.getUnderlyingStructure());
   }
 }
Пример #3
0
  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;
  }
Пример #4
0
 private SimpleSelector createEmptySimpleSelector(ASTCssNode underlyingStructureSource) {
   SimpleSelector empty =
       new SimpleSelector(underlyingStructureSource.getUnderlyingStructure(), null, null, true);
   empty.setEmptyForm(true);
   return empty;
 }
Пример #5
0
 private void appendSimpleSelectorTail(SimpleSelector selector) {
   List<ElementSubsequent> allChilds = selector.getSubsequent();
   for (ElementSubsequent astCssNode : allChilds) {
     append(astCssNode);
   }
 }