Author: tlsa
Date: Fri Jun 6 09:54:19 2008
New Revision: 4270
URL:
http://source.netsurf-browser.org?rev=4270&view=rev
Log:
Establish a new block formatting context for blocks with non-visisble overflow style.
(9.4.1)
Modified:
trunk/netsurf/render/layout.c
Modified: trunk/netsurf/render/layout.c
URL:
http://source.netsurf-browser.org/trunk/netsurf/render/layout.c?rev=4270&...
==============================================================================
--- trunk/netsurf/render/layout.c (original)
+++ trunk/netsurf/render/layout.c Fri Jun 6 09:54:19 2008
@@ -290,6 +290,9 @@
(box->style->position == CSS_POSITION_ABSOLUTE||
box->style->position == CSS_POSITION_FIXED)) {
box->x = box->parent->padding[LEFT];
+ /* absolute positioned; this element will establish
+ * its own block context when it gets laid out later,
+ * so no need to look at its children now. */
goto advance_to_next_box;
}
@@ -334,6 +337,36 @@
cy = y;
}
}
+
+ /* Unless the box has an overflow style of visible, the box
+ * establishes a new block context. */
+ if (box->type != BOX_INLINE_CONTAINER && box->style &&
+ box->style->overflow != CSS_OVERFLOW_VISIBLE) {
+ layout_block_context(box, content);
+
+ if (box->type == BOX_BLOCK || box->object)
+ cy += box->padding[TOP];
+
+ if (box->type == BOX_BLOCK && box->height == AUTO) {
+ box->height = 0;
+ layout_block_add_scrollbar(box, BOTTOM);
+ }
+
+ cy += box->height + box->padding[BOTTOM] +
+ box->border[BOTTOM];
+ max_pos_margin = max_neg_margin = 0;
+ if (max_pos_margin < box->margin[BOTTOM])
+ max_pos_margin = box->margin[BOTTOM];
+ else if (max_neg_margin < -box->margin[BOTTOM])
+ max_neg_margin = -box->margin[BOTTOM];
+ cx -= box->x;
+ y = box->y + box->padding[TOP] + box->height +
+ box->padding[BOTTOM] +
+ box->border[BOTTOM];
+ /* Skip children, because they are done in the new
+ * block context */
+ goto advance_to_next_box;
+ }
LOG(("box %p, cx %i, cy %i", box, cx, cy));