diff options
author | Vincent Sanders <vince@kyllikki.org> | 2012-07-30 18:18:11 +0100 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2012-07-30 22:56:40 +0100 |
commit | 4182685d1e90e082407a8e40a0b1db76cf9fbea2 (patch) | |
tree | 7462db0fd379031b1ceded84edf27bd49cbd9aed /render/html_script.c | |
parent | b0a41606ffe3b2cff04c68e0ae0aec96816cb857 (diff) | |
download | netsurf-4182685d1e90e082407a8e40a0b1db76cf9fbea2.tar.gz netsurf-4182685d1e90e082407a8e40a0b1db76cf9fbea2.tar.bz2 |
fix parse completion - working syncronous scripts
Diffstat (limited to 'render/html_script.c')
-rw-r--r-- | render/html_script.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/render/html_script.c b/render/html_script.c index 1e2c1b37d..7222f80e2 100644 --- a/render/html_script.c +++ b/render/html_script.c @@ -180,8 +180,8 @@ convert_script_async_cb(hlcache_handle *script, parent->base.active--; LOG(("%d fetches active", parent->base.active)); - /* script finished loading so try and continue execution */ - html_scripts_exec(parent); + + break; case CONTENT_MSG_ERROR: @@ -194,9 +194,6 @@ convert_script_async_cb(hlcache_handle *script, LOG(("%d fetches active", parent->base.active)); content_add_error(&parent->base, "?", 0); - /* script failed loading so try and continue execution */ - html_scripts_exec(parent); - break; case CONTENT_MSG_STATUS: @@ -209,9 +206,6 @@ convert_script_async_cb(hlcache_handle *script, assert(0); } - if (parent->base.active == 0) - html_finish_conversion(parent); - return NSERROR_OK; } @@ -248,8 +242,6 @@ convert_script_defer_cb(hlcache_handle *script, parent->base.active--; LOG(("%d fetches active", parent->base.active)); - /* script finished loading so try and continue execution */ - html_scripts_exec(parent); break; case CONTENT_MSG_ERROR: @@ -262,9 +254,6 @@ convert_script_defer_cb(hlcache_handle *script, LOG(("%d fetches active", parent->base.active)); content_add_error(&parent->base, "?", 0); - /* script failed loading so try and continue execution */ - html_scripts_exec(parent); - break; case CONTENT_MSG_STATUS: @@ -277,8 +266,12 @@ convert_script_defer_cb(hlcache_handle *script, assert(0); } - if (parent->base.active == 0) - html_finish_conversion(parent); + /* if there are no active fetches remaining begin post parse + * conversion + */ + if (parent->base.active == 0) { + html_begin_conversion(parent); + } return NSERROR_OK; } @@ -295,6 +288,7 @@ convert_script_sync_cb(hlcache_handle *script, unsigned int i; struct html_script *s; script_handler_t *script_handler; + dom_hubbub_error err; /* Find script */ for (i = 0, s = parent->scripts; i != parent->scripts_count; i++, s++) { @@ -330,7 +324,10 @@ convert_script_sync_cb(hlcache_handle *script, } /* continue parse */ - dom_hubbub_parser_pause(parent->parser, false); + err = dom_hubbub_parser_pause(parent->parser, false); + if (err != DOM_HUBBUB_OK) { + LOG(("unpause returned 0x%x", err)); + } break; @@ -360,6 +357,13 @@ convert_script_sync_cb(hlcache_handle *script, assert(0); } + /* if there are no active fetches remaining begin post parse + * conversion + */ + if (parent->base.active == 0) { + html_begin_conversion(parent); + } + return NSERROR_OK; } |