html_begin_conversion: If we pause in completing parse, try again later.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2019-08-05 21:29:00 +01:00
parent 99984dfc57
commit 9318ee5d6a

View File

@ -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");