summaryrefslogtreecommitdiff
path: root/content/handlers/html/html.c
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2020-02-21 10:46:21 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2020-02-21 10:48:00 +0000
commitdb370bfdb7a091bb85a4e2120e641fea0c663734 (patch)
tree93a8ae9cdeb3bfc0d917533eb9bea5be663e33b6 /content/handlers/html/html.c
parent4ef5c6cdb4f69b3fe232979cccc7c670a0938939 (diff)
downloadnetsurf-db370bfdb7a091bb85a4e2120e641fea0c663734.tar.gz
netsurf-db370bfdb7a091bb85a4e2120e641fea0c663734.tar.bz2
HTML: Complete content state machine after async script
The async script completion process needs to complete the content state machine so that browser throbbers eventually stop once async scripts have fetched and run, even if that happens *after* conversion finishes. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'content/handlers/html/html.c')
-rw-r--r--content/handlers/html/html.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index 6e389abe3..c7a9afebd 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -268,13 +268,31 @@ static void html_box_convert_done(html_content *c, bool success)
content_set_ready(&c->base);
- if (c->base.active == 0) {
- content_set_done(&c->base);
- }
+ html_proceed_to_done(c);
dom_node_unref(html);
}
+/* Documented in html_internal.h */
+nserror
+html_proceed_to_done(html_content *html)
+{
+ switch (content__get_status(&html->base)) {
+ case CONTENT_STATUS_READY:
+ if (html->base.active == 0) {
+ content_set_done(&html->base);
+ return NSERROR_OK;
+ }
+ break;
+ case CONTENT_STATUS_DONE:
+ return NSERROR_OK;
+ default:
+ NSLOG(netsurf, ERROR, "Content status unexpectedly not READY/DONE");
+ break;
+ }
+ return NSERROR_UNKNOWN;
+}
+
/** process link node */
static bool html_process_link(html_content *c, dom_node *node)