summaryrefslogtreecommitdiff
path: root/css/css.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-02-27 20:11:39 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2011-02-27 20:11:39 +0000
commit86a2e0076d0789247a28f370d16583ee4fc87f05 (patch)
treeb3ae01afe554abbb0bc98787fef4cb0fe0be35ed /css/css.c
parentb79dcabd41b48111733dd49fd68ab65f1b97347b (diff)
downloadnetsurf-86a2e0076d0789247a28f370d16583ee4fc87f05.tar.gz
netsurf-86a2e0076d0789247a28f370d16583ee4fc87f05.tar.bz2
Fix bug #3194007: stop emitting duplicate READY/DONE events.
* Make content handlers responsible for setting READY/DONE state & emitting events. * Stop content_convert doing this when there is a registered convert function for the content type. svn path=/trunk/netsurf/; revision=11850
Diffstat (limited to 'css/css.c')
-rw-r--r--css/css.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/css/css.c b/css/css.c
index 0964869a2..ffae4db38 100644
--- a/css/css.c
+++ b/css/css.c
@@ -32,6 +32,9 @@
#include "utils/log.h"
#include "utils/messages.h"
+/* Define to trace import fetches */
+#undef NSCSS_IMPORT_TRACE
+
/**
* Context for import fetches
*/
@@ -370,14 +373,8 @@ void nscss_content_done(struct content_css_data *css, void *pw)
}
/* Finally, catch the content's users up with reality */
- if (css->import_count == 0) {
- /* No imports? Ok, so we've not returned from nscss_convert yet.
- * Just set the status, as content_convert will notify users */
- c->status = CONTENT_STATUS_DONE;
- } else {
- content_set_ready(c);
- content_set_done(c);
- }
+ content_set_ready(c);
+ content_set_done(c);
}
/*****************************************************************************
@@ -447,6 +444,12 @@ css_error nscss_handle_import(void *pw, css_stylesheet *parent,
return CSS_NOMEM;
}
+#ifdef NSCSS_IMPORT_TRACE
+ LOG(("Import %d '%s' -> (handle: %p ctx: %p)",
+ c->import_count, lwc_string_data(url),
+ c->imports[c->import_count].c, ctx));
+#endif
+
c->import_count++;
return CSS_OK;
@@ -466,6 +469,10 @@ nserror nscss_import(hlcache_handle *handle,
nscss_import_ctx *ctx = pw;
css_error error = CSS_OK;
+#ifdef NSCSS_IMPORT_TRACE
+ LOG(("Event %d for %p (%p)", event->type, handle, ctx));
+#endif
+
assert(ctx->css->imports[ctx->index].c == handle);
switch (event->type) {
@@ -510,6 +517,10 @@ css_error nscss_import_complete(nscss_import_ctx *ctx)
if (ctx->css->next_to_register == ctx->index)
error = nscss_register_imports(ctx->css);
+#ifdef NSCSS_IMPORT_TRACE
+ LOG(("Destroying import context %p for %d", ctx, ctx->index));
+#endif
+
/* No longer need import context */
free(ctx);