LayoutContext c,
CascadedStyle cascadedStyle,
boolean alwaysCreate) {
boolean hasContent = true;
PropertyDeclaration contentDecl = cascadedStyle.propertyByName(CSSName.CONTENT);
CalculatedStyle style = new EmptyStyle().deriveStyle(cascadedStyle);
if (style.isDisplayNone() && ! alwaysCreate) {
return null;
}
if (style.isIdent(CSSName.CONTENT, IdentValue.NONE) ||
style.isIdent(CSSName.CONTENT, IdentValue.NORMAL)) {
hasContent = false;
}
if (style.isAutoWidth() && ! alwaysCreate && ! hasContent) {
return null;
}
List children = new ArrayList();
ChildBoxInfo info = new ChildBoxInfo();
info.setContainsTableContent(true);
info.setLayoutRunningBlocks(true);
TableCellBox result = new TableCellBox();
result.setAnonymous(true);
result.setStyle(style);
result.setElement(c.getRootLayer().getMaster().getElement()); // XXX Doesn't make sense, but we need something here
if (hasContent && ! style.isDisplayNone()) {
children.addAll(createGeneratedMarginBoxContent(
c,
c.getRootLayer().getMaster().getElement(),
(PropertyValue)contentDecl.getValue(),
style,
info));
stripAllWhitespace(children);
}