summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2010-07-06 20:23:07 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2010-07-06 20:23:07 +0000
commit71644097be64de4ca949f25a5985abfa8aec48b7 (patch)
tree5b0ed36e55d50b91a560a4e2ba28d78ab50a4de7 /render
parent2d4222def89f3160d9b5e6f03eb935a2091932a7 (diff)
downloadnetsurf-71644097be64de4ca949f25a5985abfa8aec48b7.tar.gz
netsurf-71644097be64de4ca949f25a5985abfa8aec48b7.tar.bz2
Remove dead assignements and add assert to check table cells aren't set to span no columns at layout time (Note: colspan=0 is treated as colspan=1 by box normalisation. It should probably be handled in table_calculate_columns_types() properly. Either way, there shouldn't be colspans of 0 by the time we get to layout.)
svn path=/trunk/netsurf/; revision=10601
Diffstat (limited to 'render')
-rw-r--r--render/layout.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/render/layout.c b/render/layout.c
index f483f04d8..80cd4fae1 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -1527,26 +1527,23 @@ void layout_find_dimensions(int available_width, int viewport_height,
}
if (padding) {
- enum css_padding_e type;
css_fixed value = 0;
css_unit unit = CSS_UNIT_PX;
switch (i) {
case TOP:
- type = css_computed_padding_top(style,
- &value, &unit);
+ css_computed_padding_top(style, &value, &unit);
break;
case RIGHT:
- type = css_computed_padding_right(style,
- &value, &unit);
+ css_computed_padding_right(style, &value,
+ &unit);
break;
case BOTTOM:
- type = css_computed_padding_bottom(style,
- &value, &unit);
+ css_computed_padding_bottom(style, &value,
+ &unit);
break;
case LEFT:
- type = css_computed_padding_left(style,
- &value, &unit);
+ css_computed_padding_left(style, &value, &unit);
break;
}
@@ -1561,7 +1558,6 @@ void layout_find_dimensions(int available_width, int viewport_height,
/* Table cell borders are populated in table.c */
if (border && box->type != BOX_TABLE_CELL) {
- enum css_border_width_e wtype;
enum css_border_style_e bstyle = CSS_BORDER_STYLE_NONE;
enum css_border_color_e bcolor =
CSS_BORDER_COLOR_TRANSPARENT;
@@ -1571,30 +1567,30 @@ void layout_find_dimensions(int available_width, int viewport_height,
switch (i) {
case TOP:
- wtype = css_computed_border_top_width(style,
- &value, &unit);
+ css_computed_border_top_width(style, &value,
+ &unit);
bstyle = css_computed_border_top_style(style);
bcolor = css_computed_border_top_color(style,
&color);
break;
case RIGHT:
- wtype = css_computed_border_right_width(style,
- &value, &unit);
+ css_computed_border_right_width(style, &value,
+ &unit);
bstyle = css_computed_border_right_style(style);
bcolor = css_computed_border_right_color(style,
&color);
break;
case BOTTOM:
- wtype = css_computed_border_bottom_width(style,
- &value, &unit);
+ css_computed_border_bottom_width(style, &value,
+ &unit);
bstyle = css_computed_border_bottom_style(
style);
bcolor = css_computed_border_bottom_color(style,
&color);
break;
case LEFT:
- wtype = css_computed_border_left_width(style,
- &value, &unit);
+ css_computed_border_left_width(style, &value,
+ &unit);
bstyle = css_computed_border_left_style(style);
bcolor = css_computed_border_left_color(style,
&color);
@@ -3513,6 +3509,9 @@ void layout_minmax_table(struct box *table,
for (cell = row->children; cell; cell = cell->next) {
assert(cell->type == BOX_TABLE_CELL);
assert(cell->style);
+ /** TODO: Handle colspan="0" correctly.
+ * It's currently converted to 1 in box normaisation */
+ assert(cell->columns != 0);
if (cell->columns != 1)
continue;