diff options
-rw-r--r-- | dw/outofflowmgr.cc | 13 | ||||
-rw-r--r-- | dw/outofflowmgr.hh | 1 | ||||
-rw-r--r-- | dw/textblock.cc | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/dw/outofflowmgr.cc b/dw/outofflowmgr.cc index 2f966d59..615f6efe 100644 --- a/dw/outofflowmgr.cc +++ b/dw/outofflowmgr.cc @@ -618,8 +618,21 @@ void OutOfFlowMgr::drawAbsolutelyPositioned (View *view, Rectangle *area) } } +/** + * This method consideres also the attributes not yet considered by + * dillo, so that the containing block is determined correctly, which + * leads sometimes to a cleaner rendering. + */ bool OutOfFlowMgr::isWidgetOutOfFlow (core::Widget *widget) { + return + widget->getStyle()->vloat != core::style::FLOAT_NONE || + widget->getStyle()->position == core::style::POSITION_ABSOLUTE || + widget->getStyle()->position == core::style::POSITION_FIXED; +} + +bool OutOfFlowMgr::isWidgetHandledByOOFM (core::Widget *widget) +{ // May be extended for fixed (and relative?) positions. return isWidgetFloat (widget); // TODO temporary disabled: || isWidgetAbsolutelyPositioned (widget); diff --git a/dw/outofflowmgr.hh b/dw/outofflowmgr.hh index c19f0428..67edcbd5 100644 --- a/dw/outofflowmgr.hh +++ b/dw/outofflowmgr.hh @@ -308,6 +308,7 @@ public: core::Widget *getWidgetAtPoint (int x, int y, int level); static bool isWidgetOutOfFlow (core::Widget *widget); + static bool isWidgetHandledByOOFM (core::Widget *widget); void addWidgetInFlow (Textblock *textblock, Textblock *parentBlock, int externalIndex); void addWidgetOOF (core::Widget *widget, Textblock *generatingBlock, diff --git a/dw/textblock.cc b/dw/textblock.cc index 683bdce5..35c9bb07 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -1892,7 +1892,7 @@ void Textblock::addWidget (core::Widget *widget, core::style::Style *style) if (containingBlock->outOfFlowMgr == NULL) containingBlock->outOfFlowMgr = new OutOfFlowMgr (containingBlock); - if (OutOfFlowMgr::isWidgetOutOfFlow (widget)) { + if (OutOfFlowMgr::isWidgetHandledByOOFM (widget)) { PRINTF (" -> out of flow.\n"); widget->setParent (containingBlock); |