diff options
author | Vincent Sanders <vince@kyllikki.org> | 2014-08-04 00:36:14 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2014-08-04 00:37:21 +0100 |
commit | af16c38d2dbe2decfc45015bd4ee020cb52c608b (patch) | |
tree | de33b2d3448dd65272c6df813dfb217d5f963d27 /content | |
parent | c4d1ece421b3c7fb5f0b13c042d124671734afe2 (diff) | |
download | netsurf-af16c38d2dbe2decfc45015bd4ee020cb52c608b.tar.gz netsurf-af16c38d2dbe2decfc45015bd4ee020cb52c608b.tar.bz2 |
fix DOM tree dump debug
Diffstat (limited to 'content')
-rw-r--r-- | content/content.c | 11 | ||||
-rw-r--r-- | content/content.h | 16 | ||||
-rw-r--r-- | content/content_protected.h | 2 |
3 files changed, 23 insertions, 6 deletions
diff --git a/content/content.c b/content/content.c index 87dcfa226..4641571bd 100644 --- a/content/content.c +++ b/content/content.c @@ -860,14 +860,17 @@ void content_search_clear(struct hlcache_handle *h) } } - -void content_debug_dump(struct hlcache_handle *h, FILE *f) +/* exported interface documented in content/content.h */ +nserror content_debug_dump(struct hlcache_handle *h, FILE *f, enum content_debug op) { struct content *c = hlcache_handle_get_content(h); assert(c != 0); - if (c->handler->debug_dump != NULL) - c->handler->debug_dump(c, f); + if (c->handler->debug_dump == NULL) { + return NSERROR_NOT_IMPLEMENTED; + } + + return c->handler->debug_dump(c, f, op); } diff --git a/content/content.h b/content/content.h index a2d07926c..752370034 100644 --- a/content/content.h +++ b/content/content.h @@ -87,6 +87,12 @@ typedef enum { CONTENT_MSG_GADGETCLICK/**< A gadget has been clicked on (mainly for file) */ } content_msg; +/** Debugging dump operations */ +enum content_debug { + CONTENT_DEBUG_RENDER, /** Debug the contents rendering. */ + CONTENT_DEBUG_DOM /** Debug teh contents Document Object. */ +}; + /** RFC5988 metadata link */ struct content_rfc5988_link { struct content_rfc5988_link *next; /**< next rfc5988_link in list */ @@ -271,7 +277,15 @@ void content_search(struct hlcache_handle *h, void *context, search_flags_t flags, const char *string); void content_search_clear(struct hlcache_handle *h); -void content_debug_dump(struct hlcache_handle *h, FILE *f); +/** + * Dump debug information to file. + * + * \param h content handle to debug. + * \param f File to write output to. + * \param op Debug operation type. + */ +nserror content_debug_dump(struct hlcache_handle *h, FILE *f, enum content_debug op); + struct content_rfc5988_link *content_find_rfc5988_link(struct hlcache_handle *c, lwc_string *rel); diff --git a/content/content_protected.h b/content/content_protected.h index f5448c803..7d51e1b8c 100644 --- a/content/content_protected.h +++ b/content/content_protected.h @@ -76,7 +76,7 @@ struct content_handler { void (*search)(struct content *c, void *context, search_flags_t flags, const char *string); void (*search_clear)(struct content *c); - void (*debug_dump)(struct content *c, FILE *f); + nserror (*debug_dump)(struct content *c, FILE *f, enum content_debug op); nserror (*clone)(const struct content *old, struct content **newc); bool (*matches_quirks)(const struct content *c, bool quirks); content_type (*type)(void); |