private boolean canContain(ElementContainmentInfo child,ElementContainmentInfo top,int topIndex){
  int childTypes=child.types;
  int contents=top.contents;
  int transparencyAllowed=childTypes & (top.transparentToContents & ~contents);
  for (int containerIndex=topIndex - 1; transparencyAllowed != 0; --containerIndex) {
    if (containerIndex < 0) {
      contents|=transparencyAllowed;
      break;
    }
    ElementContainmentInfo container=openElements.get(containerIndex);
    contents|=transparencyAllowed & container.contents;
    transparencyAllowed=transparencyAllowed & container.transparentToContents & ~contents;
  }
  return (contents & childTypes) != 0;
}

private boolean canContain ( ElementContainmentInfo child , ElementContainmentInfo top , int topIndex ) { int childTypes = child . types ; int contents = top . contents ; int transparencyAllowed = childTypes & ( top . transparentToContents & ~ contents ) ; for ( int containerIndex = topIndex - 1 ; transparencyAllowed != 0 ; -- containerIndex ) { if ( containerIndex < 0 ) { contents |= transparencyAllowed ; break ; } ElementContainmentInfo container = openElements . get ( containerIndex ) ; contents |= transparencyAllowed & container . contents ; transparencyAllowed = transparencyAllowed & container . transparentToContents & ~ contents ; } return ( contents & childTypes ) != 0 ; }
takes into account transparency when figuring out what can be contained .
