Make inline-blocks have margins. Add defualt margin around form inputs.

svn path=/trunk/netsurf/; revision=3779
This commit is contained in:
Michael Drake 2008-01-27 17:39:14 +00:00
parent 053f2f830c
commit b2b6fa0f10
2 changed files with 5 additions and 5 deletions

View File

@ -154,7 +154,7 @@ form > * { margin-left: inherit; margin-right: inherit; }
input { background-color: #fff; color: #000; width: 10em;
height: 1.5em; text-align: left; border-width: 1px;
border-color: #000; border-style: solid; overflow: hidden;
padding: 0 2px; }
padding: 0 2px; margin: 1px;}
input[type=button], input[type=reset], input[type=submit], button {
background-color: #d9d9d9; color: #000; width: auto;
border-width: medium; border-color: #d9d9d9;

View File

@ -1081,7 +1081,6 @@ bool layout_line(struct box *first, int *width, int *y,
if (b->width == UNKNOWN_WIDTH)
if (!layout_float(b, *width, content))
return false;
/** \todo should margin be included? spec unclear */
h = b->border[TOP] + b->padding[TOP] + b->height +
b->padding[BOTTOM] + b->border[BOTTOM];
if (height < h)
@ -1508,7 +1507,7 @@ bool layout_line(struct box *first, int *width, int *y,
}
if (d->type == BOX_INLINE_BLOCK) {
d->x += x0;
d->y = *y + d->border[TOP];
d->y = *y + d->border[TOP] + d->margin[TOP];
}
if (d->type == BOX_INLINE_BLOCK &&
(d->style->position == CSS_POSITION_ABSOLUTE ||
@ -1516,8 +1515,9 @@ bool layout_line(struct box *first, int *width, int *y,
continue;
if ((d->type == BOX_INLINE && (d->object || d->gadget)) ||
d->type == BOX_INLINE_BLOCK) {
h = d->border[TOP] + d->padding[TOP] + d->height +
d->padding[BOTTOM] + d->border[BOTTOM];
h = d->margin[TOP] + d->border[TOP] + d->padding[TOP] +
d->height + d->padding[BOTTOM] +
d->border[BOTTOM] + d->margin[BOTTOM];
if (used_height < h)
used_height = h;
}