diff --git a/content/content.c b/content/content.c index 8b089cd1e..758a615ce 100644 --- a/content/content.c +++ b/content/content.c @@ -169,6 +169,7 @@ nserror content_llcache_callback(llcache_handle *llcache, (void) llcache_handle_get_source_data(llcache, &source_size); content_set_status(c, messages_get("Processing")); + msg_data.explicit_status_text = NULL; content_broadcast(c, CONTENT_MSG_STATUS, msg_data); content_convert(c); @@ -182,6 +183,7 @@ nserror content_llcache_callback(llcache_handle *llcache, break; case LLCACHE_EVENT_PROGRESS: content_set_status(c, event->data.msg); + msg_data.explicit_status_text = NULL; content_broadcast(c, CONTENT_MSG_STATUS, msg_data); break; } diff --git a/content/content.h b/content/content.h index ab569dd64..f1ff2a2c9 100644 --- a/content/content.h +++ b/content/content.h @@ -107,9 +107,13 @@ union content_msg_data { int object_width, object_height; } redraw; /** CONTENT_MSG_REFRESH - Minimum delay */ - int delay; + int delay; /** CONTENT_MSG_REFORMAT - Reformat should not cause a redraw */ bool background; + /** CONTENT_MSG_STATUS - Status message update. If NULL, the content's + * internal status text has been updated, and listener should use + * content_get_status_message() */ + const char *explicit_status_text; /** CONTENT_MSG_DOWNLOAD - Low-level cache handle */ struct llcache_handle *download; /** CONTENT_MSG_RFC5988_LINK - rfc5988 link data */ diff --git a/desktop/browser.c b/desktop/browser.c index 73fcc0490..b7869859f 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -1323,7 +1323,15 @@ nserror browser_window_callback(hlcache_handle *c, break; case CONTENT_MSG_STATUS: - browser_window_set_status(bw, content_get_status_message(c)); + if (event->data.explicit_status_text == NULL) { + /* Object content's status text updated */ + browser_window_set_status(bw, + content_get_status_message(c)); + } else { + /* Object content wants to set explicit message */ + browser_window_set_status(bw, + event->data.explicit_status_text); + } break; case CONTENT_MSG_REFORMAT: diff --git a/render/html.c b/render/html.c index fc2f2b8b7..7f3c761bb 100644 --- a/render/html.c +++ b/render/html.c @@ -240,6 +240,7 @@ void html_finish_conversion(html_content *c) /* convert xml tree to box tree */ LOG(("XML to box (%p)", c)); content_set_status(&c->base, messages_get("Processing")); + msg_data.explicit_status_text = NULL; content_broadcast(&c->base, CONTENT_MSG_STATUS, msg_data); exc = dom_document_get_document_element(c->document, (void *) &html); @@ -1168,14 +1169,18 @@ html_object_callback(hlcache_handle *object, LOG(("%d fetches active", c->base.active)); content_add_error(&c->base, "?", 0); - html_set_status(c, event->data.error); - content_broadcast(&c->base, CONTENT_MSG_STATUS, event->data); html_object_failed(box, c, o->background); break; case CONTENT_MSG_STATUS: - html_set_status(c, content_get_status_message(object)); - /* content_broadcast(&c->base, CONTENT_MSG_STATUS, 0); */ + if (event->data.explicit_status_text == NULL) { + /* Object content's status text updated */ + html_set_status(c, content_get_status_message(object)); + } else { + /* Object content wants to set explicit message */ + content_broadcast(&c->base, CONTENT_MSG_STATUS, + event->data); + } break; case CONTENT_MSG_REFORMAT: @@ -1406,9 +1411,17 @@ html_convert_css_callback(hlcache_handle *css, break; case CONTENT_MSG_STATUS: - html_set_status(parent, content_get_status_message(css)); - content_broadcast(&parent->base, CONTENT_MSG_STATUS, - event->data); + if (event->data.explicit_status_text == NULL) { + /* Object content's status text updated */ + html_set_status(parent, + content_get_status_message(css)); + content_broadcast(&parent->base, CONTENT_MSG_STATUS, + event->data); + } else { + /* Object content wants to set explicit message */ + content_broadcast(&parent->base, CONTENT_MSG_STATUS, + event->data); + } break; default: diff --git a/render/html_script.c b/render/html_script.c index 44b661d8f..446868b86 100644 --- a/render/html_script.c +++ b/render/html_script.c @@ -188,9 +188,6 @@ convert_script_async_cb(hlcache_handle *script, break; case CONTENT_MSG_STATUS: - html_set_status(parent, content_get_status_message(script)); - content_broadcast(&parent->base, CONTENT_MSG_STATUS, - event->data); break; default: @@ -248,9 +245,6 @@ convert_script_defer_cb(hlcache_handle *script, break; case CONTENT_MSG_STATUS: - html_set_status(parent, content_get_status_message(script)); - content_broadcast(&parent->base, CONTENT_MSG_STATUS, - event->data); break; default: @@ -345,9 +339,6 @@ convert_script_sync_cb(hlcache_handle *script, break; case CONTENT_MSG_STATUS: - html_set_status(parent, content_get_status_message(script)); - content_broadcast(&parent->base, CONTENT_MSG_STATUS, - event->data); break; default: