aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-09-24 13:27:36 +0200
committerSebastian Geerken <devnull@localhost>2014-09-24 13:27:36 +0200
commitc35905bbe90dc552673de4048cdc603024698187 (patch)
treee8dfaec27fba228ea72f83ab0e594ef5fab2f585
parentb472fe79479ab5edc7a3d3397313a3c5e38c0440 (diff)
Relatively positioned elements may be a floats container.
-rw-r--r--dw/oofawarewidget.cc14
-rw-r--r--dw/oofawarewidget.hh4
2 files changed, 11 insertions, 7 deletions
diff --git a/dw/oofawarewidget.cc b/dw/oofawarewidget.cc
index f8e3c497..62a1e8d6 100644
--- a/dw/oofawarewidget.cc
+++ b/dw/oofawarewidget.cc
@@ -91,9 +91,12 @@ bool OOFAwareWidget::isOOFContainer (Widget *widget, int oofmIndex)
->isPossibleContainerParent (OOFM_FLOATS)) ||
// Inline blocks are containing blocks, too.
widget->getStyle()->display == core::style::DISPLAY_INLINE_BLOCK ||
- // Finally, "out of flow" in a narrower sense: floats; absolutely
- // and fixedly positioned elements.
- testWidgetOutOfFlow (widget)));
+ // Finally, "out of flow" in a narrower sense: floats;
+ // absolutely and fixedly positioned elements; furthermore,
+ // relatively positioned elements must already be
+ // considered here, since they may constitute a stacking
+ // context.
+ testWidgetOutOfFlow (widget) || testWidgetPositioned (widget)));
case OOFM_ABSOLUTE:
// Only the toplevel widget (as for all) as well as absolutely,
@@ -110,10 +113,7 @@ bool OOFAwareWidget::isOOFContainer (Widget *widget, int oofmIndex)
// children, like tables? TODO: Check CSS spec.)
return widget->instanceOf (OOFAwareWidget::CLASS_ID) &&
- (widget->getParent() == NULL ||
- testWidgetAbsolutelyPositioned (widget) ||
- testWidgetRelativelyPositioned (widget) ||
- testWidgetFixedlyPositioned (widget));
+ (widget->getParent() == NULL || testWidgetPositioned (widget));
case OOFM_FIXED:
// The single container for fixedly positioned elements is the
diff --git a/dw/oofawarewidget.hh b/dw/oofawarewidget.hh
index af6a18e0..afa5964a 100644
--- a/dw/oofawarewidget.hh
+++ b/dw/oofawarewidget.hh
@@ -150,6 +150,10 @@ protected:
{ return widget->getStyle()->position == core::style::POSITION_ABSOLUTE; }
static inline bool testWidgetFixedlyPositioned (Widget *widget)
{ return widget->getStyle()->position == core::style::POSITION_FIXED; }
+ static inline bool testWidgetPositioned (Widget *widget)
+ { return testWidgetAbsolutelyPositioned (widget) ||
+ testWidgetRelativelyPositioned (widget) ||
+ testWidgetFixedlyPositioned (widget); }
static inline bool testWidgetOutOfFlow (Widget *widget)
{ return testWidgetFloat (widget) || testWidgetAbsolutelyPositioned (widget)
|| testWidgetFixedlyPositioned (widget); }