aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2013-07-04 10:57:43 +0200
committerSebastian Geerken <devnull@localhost>2013-07-04 10:57:43 +0200
commit2241c9cbc86185697bbfd25b451ef4e9881f28ac (patch)
treedde8d618dff7c66ec9eb00685101a8f73eb5c3d7
parent0faa47fc3e0b57bc559e32c26163ff1329abb521 (diff)
Differenciation isWidgetOutOfFlow / isWidgetHandledByOOFM.
-rw-r--r--dw/outofflowmgr.cc13
-rw-r--r--dw/outofflowmgr.hh1
-rw-r--r--dw/textblock.cc2
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);