summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2019-08-05 21:29:00 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2019-08-05 21:29:18 +0100
commit9318ee5d6a668a4c816cc82af9cd86ae826e30b7 (patch)
treea4570d3f89dcf711ed94610af4a9284e73955d6d /content
parent99984dfc57a5562a5f2fc624e143b24fd5543af3 (diff)
downloadnetsurf-9318ee5d6a668a4c816cc82af9cd86ae826e30b7.tar.gz
netsurf-9318ee5d6a668a4c816cc82af9cd86ae826e30b7.tar.bz2
html_begin_conversion: If we pause in completing parse, try again later.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'content')
-rw-r--r--content/handlers/html/html.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index ec4ff3572..bcbd4382a 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -1358,6 +1358,13 @@ html_begin_conversion(html_content *htmlc)
NSLOG(netsurf, INFO, "Completing parse (%p)", htmlc);
/* complete parsing */
error = dom_hubbub_parser_completed(htmlc->parser);
+ if (error == DOM_HUBBUB_HUBBUB_ERR_PAUSED && htmlc->base.active > 0) {
+ /* The act of completing the parse failed because we've
+ * encountered a sync script which needs to run
+ */
+ NSLOG(netsurf, INFO, "Completing parse brought synchronous JS to light, cannot complete yet");
+ return true;
+ }
if (error != DOM_HUBBUB_OK) {
NSLOG(netsurf, INFO, "Parsing failed");