Author: jmb
Date: Thu Jun 29 12:55:21 2006
New Revision: 2672
URL:
http://svn.semichrome.net?rev=2672&view=rev
Log:
Position specifiers are relative to containing block's padding edge for
absolutely positioned boxes. Compensate for this.
Modified:
trunk/netsurf/render/layout.c
Modified: trunk/netsurf/render/layout.c
URL:
http://svn.semichrome.net/trunk/netsurf/render/layout.c?rev=2672&r1=2...
==============================================================================
--- trunk/netsurf/render/layout.c (original)
+++ trunk/netsurf/render/layout.c Thu Jun 29 12:55:21 2006
@@ -2613,6 +2613,16 @@
containing_block->width));
box->x = left + margin[LEFT] + border[LEFT];
+ if (containing_block->type == BOX_BLOCK ||
+ containing_block->type == BOX_INLINE_BLOCK ||
+ containing_block->type == BOX_TABLE_CELL) {
+ /* Block-level ancestor => compensate for ancestor's
+ * l,r padding */
+ box->x += containing_block->padding[RIGHT] -
+ containing_block->padding[LEFT];
+ } else {
+ /** \todo inline ancestors */
+ }
box->width = width;
box->height = height;
@@ -2726,6 +2736,16 @@
containing_block->height));
box->y = top + margin[TOP] + border[TOP];
+ if (containing_block->type == BOX_BLOCK ||
+ containing_block->type == BOX_INLINE_BLOCK ||
+ containing_block->type == BOX_TABLE_CELL) {
+ /* Block-level ancestor => compensate for ancestor's
+ * t,b padding */
+ box->y += containing_block->padding[BOTTOM] -
+ containing_block->padding[TOP];
+ } else {
+ /** \todo Inline ancestors */
+ }
box->height = height;
return true;