}
}
public void calcMinMaxWidth(LayoutContext c) {
if (! isMinMaxCalculated()) {
RectPropertySet margin = getMargin(c);
BorderPropertySet border = getBorder(c);
RectPropertySet padding = getPadding(c);
int width = getCSSWidth(c);
if (width == -1) {
if (isReplaced()) {
width = getReplacedElement().getIntrinsicWidth();
} else {
int height = getCSSHeight(c);
ReplacedElement re = c.getReplacedElementFactory().createReplacedElement(
c, this, c.getUac(), width, height);
if (re != null) {
setReplacedElement(re);
width = getReplacedElement().getIntrinsicWidth();
}
}
}
if (isReplaced() || (width != -1 && ! isFixedWidthAdvisoryOnly())) {
_minWidth = _maxWidth =
(int) margin.left() + (int) border.left() + (int) padding.left() +
width +
(int) margin.right() + (int) border.right() + (int) padding.right();
} else {
int cw = -1;
if (width != -1) {
// Set a provisional content width on table cells so
// percentage values resolve correctly (but save and reset
// the existing value)
cw = getContentWidth();
setContentWidth(width);
}
_minWidth = _maxWidth =
(int) margin.left() + (int) border.left() + (int) padding.left() +
(int) margin.right() + (int) border.right() + (int) padding.right();
int minimumMaxWidth = _maxWidth;
if (width != -1) {
minimumMaxWidth += width;
}