summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-07-13 18:07:12 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2014-07-13 18:07:12 +0100
commit0d3faeb4bd256883f4ec3fb4d391b9ceeec6866e (patch)
tree67d3bd7dc237b4b55fe24608f63e8b4e66452e40 /render
parent36411a2ba553d29e0805187c95d55e079bd2d9fe (diff)
downloadnetsurf-0d3faeb4bd256883f4ec3fb4d391b9ceeec6866e.tar.gz
netsurf-0d3faeb4bd256883f4ec3fb4d391b9ceeec6866e.tar.bz2
Allow suppression of style dump in box tree dumps.
Diffstat (limited to 'render')
-rw-r--r--render/box.c8
-rw-r--r--render/box.h2
-rw-r--r--render/html.c4
-rw-r--r--render/layout.c6
4 files changed, 10 insertions, 10 deletions
diff --git a/render/box.c b/render/box.c
index 53f6c75d0..dd7c31f69 100644
--- a/render/box.c
+++ b/render/box.c
@@ -880,7 +880,7 @@ bool box_visible(struct box *box)
* Print a box tree to a file.
*/
-void box_dump(FILE *stream, struct box *box, unsigned int depth)
+void box_dump(FILE *stream, struct box *box, unsigned int depth, bool style)
{
unsigned int i;
struct box *c, *prev;
@@ -935,7 +935,7 @@ void box_dump(FILE *stream, struct box *box, unsigned int depth)
}
if (box->gadget)
fprintf(stream, "(gadget) ");
- if (box->style)
+ if (style && box->style)
nscss_dump_computed_style(stream, box->style);
if (box->href)
fprintf(stream, " -> '%s'", nsurl_access(box->href));
@@ -971,7 +971,7 @@ void box_dump(FILE *stream, struct box *box, unsigned int depth)
for (i = 0; i != depth; i++)
fprintf(stream, " ");
fprintf(stream, "list_marker:\n");
- box_dump(stream, box->list_marker, depth + 1);
+ box_dump(stream, box->list_marker, depth + 1, style);
}
for (c = box->children; c && c->next; c = c->next)
@@ -988,7 +988,7 @@ void box_dump(FILE *stream, struct box *box, unsigned int depth)
fprintf(stream, "warning: box->prev %p (should be "
"%p) (box on next line)\n",
c->prev, prev);
- box_dump(stream, c, depth + 1);
+ box_dump(stream, c, depth + 1, style);
}
}
diff --git a/render/box.h b/render/box.h
index e781a66ec..988b2872c 100644
--- a/render/box.h
+++ b/render/box.h
@@ -331,7 +331,7 @@ struct box *box_pick_text_box(struct html_content *html,
int x, int y, int dir, int *dx, int *dy);
struct box *box_find_by_id(struct box *box, lwc_string *id);
bool box_visible(struct box *box);
-void box_dump(FILE *stream, struct box *box, unsigned int depth);
+void box_dump(FILE *stream, struct box *box, unsigned int depth, bool style);
bool box_extract_link(const char *rel, nsurl *base, nsurl **result);
bool box_handle_scrollbars(struct content *c, struct box *box,
diff --git a/render/html.c b/render/html.c
index 212124028..9e576486f 100644
--- a/render/html.c
+++ b/render/html.c
@@ -100,7 +100,7 @@ static void html_box_convert_done(html_content *c, bool success)
#if ALWAYS_DUMP_BOX
- box_dump(stderr, c->layout->children, 0);
+ box_dump(stderr, c->layout->children, 0, true);
#endif
#if ALWAYS_DUMP_FRAMESET
if (c->frameset)
@@ -1981,7 +1981,7 @@ static void html_debug_dump(struct content *c, FILE *f)
assert(html != NULL);
assert(html->layout != NULL);
- box_dump(f, html->layout, 0);
+ box_dump(f, html->layout, 0, true);
}
diff --git a/render/layout.c b/render/layout.c
index 891fc4283..975c8828f 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -827,7 +827,7 @@ void layout_minmax_block(struct box *block,
}
if (max < min) {
- box_dump(stderr, block, 0);
+ box_dump(stderr, block, 0, true);
assert(0);
}
@@ -2794,7 +2794,7 @@ bool layout_line(struct box *first, int *width, int *y,
LOG(("float %p already placed", b));
#endif
- box_dump(stderr, cont, 0);
+ box_dump(stderr, cont, 0, true);
assert(0);
}
b->next_float = cont->float_children;
@@ -4139,7 +4139,7 @@ void layout_minmax_table(struct box *table,
for (i = 0; i != table->columns; i++) {
if (col[i].max < col[i].min) {
- box_dump(stderr, table, 0);
+ box_dump(stderr, table, 0, true);
assert(0);
}
table_min += col[i].min;