Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/db370bfdb7a091bb85a4e2120e641fea0c663734
...commit
http://git.netsurf-browser.org/netsurf.git/commit/db370bfdb7a091bb85a4e2120e641fea0c663734
...tree
http://git.netsurf-browser.org/netsurf.git/tree/db370bfdb7a091bb85a4e2120e641fea0c663734
The branch, master has been updated
via db370bfdb7a091bb85a4e2120e641fea0c663734 (commit)
from 4ef5c6cdb4f69b3fe232979cccc7c670a0938939 (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=db370bfdb7a091bb85a4e2120e641fea0c663734
commit db370bfdb7a091bb85a4e2120e641fea0c663734
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
HTML: Complete content state machine after async script
The async script completion process needs to complete the
content state machine so that browser throbbers eventually
stop once async scripts have fetched and run, even if that
happens *after* conversion finishes.
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index 6e389ab..c7a9afe 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -268,13 +268,31 @@ static void html_box_convert_done(html_content *c, bool
success)
content_set_ready(&c->base);
- if (c->base.active == 0) {
- content_set_done(&c->base);
- }
+ html_proceed_to_done(c);
dom_node_unref(html);
}
+/* Documented in html_internal.h */
+nserror
+html_proceed_to_done(html_content *html)
+{
+ switch (content__get_status(&html->base)) {
+ case CONTENT_STATUS_READY:
+ if (html->base.active == 0) {
+ content_set_done(&html->base);
+ return NSERROR_OK;
+ }
+ break;
+ case CONTENT_STATUS_DONE:
+ return NSERROR_OK;
+ default:
+ NSLOG(netsurf, ERROR, "Content status unexpectedly not
READY/DONE");
+ break;
+ }
+ return NSERROR_UNKNOWN;
+}
+
/** process link node */
static bool html_process_link(html_content *c, dom_node *node)
diff --git a/content/handlers/html/html_internal.h
b/content/handlers/html/html_internal.h
index 2ff3410..9b363dc 100644
--- a/content/handlers/html/html_internal.h
+++ b/content/handlers/html/html_internal.h
@@ -396,6 +396,12 @@ nserror html_object_close_objects(html_content *html);
nserror html_object_open_objects(html_content *html, struct browser_window
*bw);
nserror html_object_abort_objects(html_content *html);
+/**
+ * Complete the HTML content state machine *iff* all scripts are finished
+ */
+nserror html_proceed_to_done(html_content *html);
+
+
/* Events */
/**
* Construct an event and fire it at the DOM
diff --git a/content/handlers/html/html_script.c
b/content/handlers/html/html_script.c
index e11e47c..ed73f50 100644
--- a/content/handlers/html/html_script.c
+++ b/content/handlers/html/html_script.c
@@ -108,7 +108,7 @@ nserror html_script_exec(html_content *c, bool allow_defer)
}
}
- return NSERROR_OK;
+ return html_proceed_to_done(c);
}
/* create new html script entry */
@@ -208,7 +208,7 @@ convert_script_async_cb(hlcache_handle *script,
* scripts as they come in.
*/
else if (parent->conversion_begun) {
- html_script_exec(parent, false);
+ return html_script_exec(parent, false);
}
return NSERROR_OK;
-----------------------------------------------------------------------
Summary of changes:
content/handlers/html/html.c | 24 +++++++++++++++++++++---
content/handlers/html/html_internal.h | 6 ++++++
content/handlers/html/html_script.c | 4 ++--
3 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index 6e389ab..c7a9afe 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -268,13 +268,31 @@ static void html_box_convert_done(html_content *c, bool
success)
content_set_ready(&c->base);
- if (c->base.active == 0) {
- content_set_done(&c->base);
- }
+ html_proceed_to_done(c);
dom_node_unref(html);
}
+/* Documented in html_internal.h */
+nserror
+html_proceed_to_done(html_content *html)
+{
+ switch (content__get_status(&html->base)) {
+ case CONTENT_STATUS_READY:
+ if (html->base.active == 0) {
+ content_set_done(&html->base);
+ return NSERROR_OK;
+ }
+ break;
+ case CONTENT_STATUS_DONE:
+ return NSERROR_OK;
+ default:
+ NSLOG(netsurf, ERROR, "Content status unexpectedly not
READY/DONE");
+ break;
+ }
+ return NSERROR_UNKNOWN;
+}
+
/** process link node */
static bool html_process_link(html_content *c, dom_node *node)
diff --git a/content/handlers/html/html_internal.h
b/content/handlers/html/html_internal.h
index 2ff3410..9b363dc 100644
--- a/content/handlers/html/html_internal.h
+++ b/content/handlers/html/html_internal.h
@@ -396,6 +396,12 @@ nserror html_object_close_objects(html_content *html);
nserror html_object_open_objects(html_content *html, struct browser_window
*bw);
nserror html_object_abort_objects(html_content *html);
+/**
+ * Complete the HTML content state machine *iff* all scripts are finished
+ */
+nserror html_proceed_to_done(html_content *html);
+
+
/* Events */
/**
* Construct an event and fire it at the DOM
diff --git a/content/handlers/html/html_script.c
b/content/handlers/html/html_script.c
index e11e47c..ed73f50 100644
--- a/content/handlers/html/html_script.c
+++ b/content/handlers/html/html_script.c
@@ -108,7 +108,7 @@ nserror html_script_exec(html_content *c, bool allow_defer)
}
}
- return NSERROR_OK;
+ return html_proceed_to_done(c);
}
/* create new html script entry */
@@ -208,7 +208,7 @@ convert_script_async_cb(hlcache_handle *script,
* scripts as they come in.
*/
else if (parent->conversion_begun) {
- html_script_exec(parent, false);
+ return html_script_exec(parent, false);
}
return NSERROR_OK;
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org