From 9318ee5d6a668a4c816cc82af9cd86ae826e30b7 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Mon, 5 Aug 2019 21:29:00 +0100 Subject: html_begin_conversion: If we pause in completing parse, try again later. Signed-off-by: Daniel Silverstone --- content/handlers/html/html.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'content/handlers/html') 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"); -- cgit v1.2.3