diff options
Diffstat (limited to 'dw')
-rw-r--r-- | dw/oofawarewidget.cc | 15 | ||||
-rw-r--r-- | dw/style.cc | 5 | ||||
-rw-r--r-- | dw/style.hh | 9 | ||||
-rw-r--r-- | dw/table.cc | 14 | ||||
-rw-r--r-- | dw/table.hh | 2 | ||||
-rw-r--r-- | dw/widget.cc | 6 |
6 files changed, 29 insertions, 22 deletions
diff --git a/dw/oofawarewidget.cc b/dw/oofawarewidget.cc index 99f297ff..7017ebfa 100644 --- a/dw/oofawarewidget.cc +++ b/dw/oofawarewidget.cc @@ -91,6 +91,9 @@ bool OOFAwareWidget::isOOFContainer (Widget *widget, int oofmIndex) ->isPossibleContainerParent (OOFM_FLOATS)) || // Inline blocks are containing blocks, too. widget->getStyle()->display == core::style::DISPLAY_INLINE_BLOCK || + // Same for blocks with 'overview' set to another value than + // (the default value) 'visible'. + widget->getStyle()->overflow != core::style::OVERFLOW_VISIBLE || // Finally, "out of flow" in a narrower sense: floats; // absolutely and fixedly positioned elements; furthermore, // relatively positioned elements must already be @@ -102,16 +105,8 @@ bool OOFAwareWidget::isOOFContainer (Widget *widget, int oofmIndex) // Only the toplevel widget (as for all) as well as absolutely, // relatively, and fixedly positioned elements constitute the // containing block for absolutely positioned elements, but - // neither floats nor other elements like table cells. - // - // (Notice that relative positions are not yet supported, but - // only tested to get the correct containing block. Furthermore, - // it seems that this test would be incorrect for floats.) - // - // We also test whether this widget is a textblock: is this - // necessary? (What about other absolutely widgets containing - // children, like tables? TODO: Check CSS spec.) - + // neither floats nor other elements like table cells, or + // elements with 'overview' set to another value than 'visible'. return widget->instanceOf (OOFAwareWidget::CLASS_ID) && (widget->getParent() == NULL || testWidgetPositioned (widget)); diff --git a/dw/style.cc b/dw/style.cc index 1c2978b4..830613fa 100644 --- a/dw/style.cc +++ b/dw/style.cc @@ -76,6 +76,7 @@ void StyleAttrs::initValues () minWidth = maxWidth = minHeight = maxHeight = LENGTH_AUTO; vloat = FLOAT_NONE; clear = CLEAR_NONE; + overflow = OVERFLOW_VISIBLE; position = POSITION_STATIC; top = bottom = left = right = LENGTH_AUTO; textIndent = 0; @@ -107,6 +108,7 @@ void StyleAttrs::resetValues () textAlignChar = '.'; vloat = FLOAT_NONE; /** \todo Correct? Check specification. */ clear = CLEAR_NONE; /** \todo Correct? Check specification. */ + overflow = OVERFLOW_VISIBLE; position = POSITION_STATIC; /** \todo Correct? Check specification. */ top = bottom = left = right = LENGTH_AUTO; /** \todo Correct? Check specification. */ @@ -168,6 +170,7 @@ bool StyleAttrs::equals (object::Object *other) { textTransform == otherAttrs->textTransform && vloat == otherAttrs->vloat && clear == otherAttrs->clear && + overflow == otherAttrs->overflow && position == otherAttrs->position && top == otherAttrs->top && bottom == otherAttrs->bottom && @@ -225,6 +228,7 @@ int StyleAttrs::hashValue () { textTransform + vloat + clear + + overflow + position + top + bottom + @@ -352,6 +356,7 @@ void Style::copyAttrs (StyleAttrs *attrs) textTransform = attrs->textTransform; vloat = attrs->vloat; clear = attrs->clear; + overflow = attrs->overflow; position = attrs->position; top = attrs->top; bottom = attrs->bottom; diff --git a/dw/style.hh b/dw/style.hh index 9c6bedf1..43fff0a1 100644 --- a/dw/style.hh +++ b/dw/style.hh @@ -333,6 +333,13 @@ enum FontVariant { FONT_VARIANT_SMALL_CAPS }; +enum Overflow { + OVERFLOW_VISIBLE, + OVERFLOW_HIDDEN, + OVERFLOW_SCROLL, + OVERFLOW_AUTO +}; + enum Position { POSITION_STATIC, POSITION_RELATIVE, @@ -540,6 +547,8 @@ public: FloatType vloat; /* "float" is a keyword. */ ClearType clear; + Overflow overflow; + Position position; Length top, bottom, left, right; diff --git a/dw/table.cc b/dw/table.cc index 4259111a..ce45b7ad 100644 --- a/dw/table.cc +++ b/dw/table.cc @@ -753,12 +753,16 @@ void Table::forceCalcCellSizes (bool calcHeights) getExtremes (&extremes); int availWidth = getAvailWidth (true); - int totalWidth = availWidth - - ((numCols + 1) * getStyle()->hBorderSpacing + boxDiffWidth ()); - + // When adjust_table_min_width is set, use the minimal (intrinsic) + // width for correction. + int corrWidth = + Table::getAdjustTableMinWidth () ? extremes.minWidthIntrinsic : 0; + int totalWidth = misc::max (availWidth, corrWidth) + - ((numCols + 1) * getStyle()->hBorderSpacing + boxDiffWidth ()); + DBG_OBJ_MSGF ("resize", 1, - "totalWidth = %d - ((%d - 1) * %d + %d) = <b>%d</b>", - availWidth, numCols, getStyle()->hBorderSpacing, + "totalWidth = max (%d, %d) - ((%d - 1) * %d + %d) = <b>%d</b>", + availWidth, corrWidth, numCols, getStyle()->hBorderSpacing, boxDiffWidth (), totalWidth); colWidths->setSize (numCols, 0); diff --git a/dw/table.hh b/dw/table.hh index c47ff465..560a2cb7 100644 --- a/dw/table.hh +++ b/dw/table.hh @@ -485,7 +485,7 @@ public: inline static void setAdjustTableMinWidth (bool adjustTableMinWidth) { Table::adjustTableMinWidth = adjustTableMinWidth; } - inline static int getAdjustTableMinWidth () + inline static bool getAdjustTableMinWidth () { return Table::adjustTableMinWidth; } Table(bool limitTextWidth); diff --git a/dw/widget.cc b/dw/widget.cc index 19083f61..553439ff 100644 --- a/dw/widget.cc +++ b/dw/widget.cc @@ -608,9 +608,6 @@ int Widget::getAvailWidth (bool forceValue) DBG_OBJ_MSG_END (); } - if (width != -1) - width = misc::max (width, getMinWidth (NULL, forceValue)); - DBG_OBJ_MSGF ("resize", 1, "=> %d", width); DBG_OBJ_LEAVE (); @@ -1553,9 +1550,6 @@ int Widget::getAvailWidthOfChild (Widget *child, bool forceValue) } } - if (width != -1) - width = misc::max (width, child->getMinWidth (NULL, forceValue)); - DBG_OBJ_MSGF ("resize", 1, "=> %d", width); DBG_OBJ_LEAVE (); |