Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/eba05b0d389a83d09798099e8894e297c973ac6e
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/eba05b0d389a83d09798099e8894e297c973ac6e
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/eba05b0d389a83d09798099e8894e297c973ac6e

The branch, master has been updated
       via  eba05b0d389a83d09798099e8894e297c973ac6e (commit)
      from  918b1d0fed158fdb48a61536ff7aec7495916298 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=eba05b0d389a83d09798099e8894e297c973ac6e
commit eba05b0d389a83d09798099e8894e297c973ac6e
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>

    html_script: Count sync scripts to prevent unpausing early
    
    If there is more than one incomplete sync script then it's
    important that we don't unpause hubbub too early.  This commit
    adds a counter so that if there're unfinished sync scripts in
    the set, we don't unpause until the last one completes.
    
    Signed-off-by: Daniel Silverstone <[email protected]>

diff --git a/content/handlers/html/html_script.c 
b/content/handlers/html/html_script.c
index f4754fe..e11e47c 100644
--- a/content/handlers/html/html_script.c
+++ b/content/handlers/html/html_script.c
@@ -284,6 +284,15 @@ convert_script_sync_cb(hlcache_handle *script,
        struct html_script *s;
        script_handler_t *script_handler;
        dom_hubbub_error err;
+       unsigned int active_sync_scripts = 0;
+
+       /* Count sync scripts which have yet to complete (other than us) */
+       for (i = 0, s = parent->scripts; i != parent->scripts_count; i++, s++) {
+               if (s->type == HTML_SCRIPT_SYNC &&
+                   s->data.handle != script && s->already_started == false) {
+                       active_sync_scripts++;
+               }
+       }
 
        /* Find script */
        for (i = 0, s = parent->scripts; i != parent->scripts_count; i++, s++) {
@@ -314,7 +323,7 @@ convert_script_sync_cb(hlcache_handle *script,
                }
 
                /* continue parse */
-               if (parent->parser != NULL) {
+               if (parent->parser != NULL && active_sync_scripts == 0) {
                        err = dom_hubbub_parser_pause(parent->parser, false);
                        if (err != DOM_HUBBUB_OK) {
                                NSLOG(netsurf, INFO, "unpause returned 0x%x", 
err);
@@ -338,7 +347,7 @@ convert_script_sync_cb(hlcache_handle *script,
                s->already_started = true;
 
                /* continue parse */
-               if (parent->parser != NULL) {
+               if (parent->parser != NULL && active_sync_scripts == 0) {
                        err = dom_hubbub_parser_pause(parent->parser, false);
                        if (err != DOM_HUBBUB_OK) {
                                NSLOG(netsurf, INFO, "unpause returned 0x%x", 
err);


-----------------------------------------------------------------------

Summary of changes:
 content/handlers/html/html_script.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/content/handlers/html/html_script.c 
b/content/handlers/html/html_script.c
index f4754fe..e11e47c 100644
--- a/content/handlers/html/html_script.c
+++ b/content/handlers/html/html_script.c
@@ -284,6 +284,15 @@ convert_script_sync_cb(hlcache_handle *script,
        struct html_script *s;
        script_handler_t *script_handler;
        dom_hubbub_error err;
+       unsigned int active_sync_scripts = 0;
+
+       /* Count sync scripts which have yet to complete (other than us) */
+       for (i = 0, s = parent->scripts; i != parent->scripts_count; i++, s++) {
+               if (s->type == HTML_SCRIPT_SYNC &&
+                   s->data.handle != script && s->already_started == false) {
+                       active_sync_scripts++;
+               }
+       }
 
        /* Find script */
        for (i = 0, s = parent->scripts; i != parent->scripts_count; i++, s++) {
@@ -314,7 +323,7 @@ convert_script_sync_cb(hlcache_handle *script,
                }
 
                /* continue parse */
-               if (parent->parser != NULL) {
+               if (parent->parser != NULL && active_sync_scripts == 0) {
                        err = dom_hubbub_parser_pause(parent->parser, false);
                        if (err != DOM_HUBBUB_OK) {
                                NSLOG(netsurf, INFO, "unpause returned 0x%x", 
err);
@@ -338,7 +347,7 @@ convert_script_sync_cb(hlcache_handle *script,
                s->already_started = true;
 
                /* continue parse */
-               if (parent->parser != NULL) {
+               if (parent->parser != NULL && active_sync_scripts == 0) {
                        err = dom_hubbub_parser_pause(parent->parser, false);
                        if (err != DOM_HUBBUB_OK) {
                                NSLOG(netsurf, INFO, "unpause returned 0x%x", 
err);


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to